From: <gi...@ma...> - 2009-06-16 21:14:29
|
The branch, master has been updated via 7871f6cf2b9437efe8daa8b7b0d1675e0f578150 (commit) from 748d601afe73bf7d5d1f18a0d1685687172372c1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7871f6cf2b9437efe8daa8b7b0d1675e0f578150 Author: David Hicks <hic...@op...> Date: Wed Jun 17 07:06:06 2009 +1000 Show default upload path when creating project Implementation of bug #8250 When creating a project, the user has an option to specify a separate upload folder on a per-project basis. Previously this field was left blank by default. This patch shows the default value to the user - as long as they're an administrator. This helps make it a little easier to see if a new path needs to be specified that is different from the default. For security reasons the absolute upload path is only shown to administrators. ----------------------------------------------------------------------- Summary of changes: manage_proj_create.php | 7 +++++++ manage_proj_create_page.php | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletions(-) ----------------------------------------------------------------------- commit 7871f6cf2b9437efe8daa8b7b0d1675e0f578150 Author: David Hicks <hic...@op...> Date: Wed Jun 17 07:06:06 2009 +1000 Show default upload path when creating project Implementation of bug #8250 When creating a project, the user has an option to specify a separate upload folder on a per-project basis. Previously this field was left blank by default. This patch shows the default value to the user - as long as they're an administrator. This helps make it a little easier to see if a new path needs to be specified that is different from the default. For security reasons the absolute upload path is only shown to administrators. diff --git a/manage_proj_create.php b/manage_proj_create.php index b7b5f29..444b1bc 100644 --- a/manage_proj_create.php +++ b/manage_proj_create.php @@ -46,6 +46,13 @@ project_ensure_exists( $f_parent_id ); } + # If the provided path is the same as the default, make the path blank. + # This means that if the default upload path is changed, you don't have + # to update the upload path for every single project. + if ( !strcmp( $f_file_path, config_get( 'absolute_path_default_upload_folder' ) ) ) { + $f_file_path = ''; + } + $t_project_id = project_create( strip_tags( $f_name ), $f_description, $f_status, $f_view_state, $f_file_path, true, $f_inherit_global ); if ( ( $f_view_state == VS_PRIVATE ) && ( false === current_user_is_administrator() ) ) { diff --git a/manage_proj_create_page.php b/manage_proj_create_page.php index 7faf78d..00c2a71 100644 --- a/manage_proj_create_page.php +++ b/manage_proj_create_page.php @@ -107,13 +107,18 @@ } if ( config_get( 'allow_file_upload' ) ) { + $t_default_upload_path = ''; + # Don't reveal the absolute path to non-administrators for security reasons + if ( current_user_is_administrator ) { + $t_default_upload_path = config_get( 'absolute_path_default_upload_folder' ); + } ?> <tr class="row-2"> <td class="category"> <?php echo lang_get( 'upload_file_path' ) ?> </td> <td> - <input type="text" name="file_path" size="70" maxlength="250" /> + <input type="text" name="file_path" size="70" maxlength="250" value="<?php echo $t_default_upload_path ?>" /> </td> </tr> <?php ----------------------------------------------------------------------- -- Mantis Bug Tracker |