Skip to content

Commit

Permalink
Merge branch 'master' of git@mantisbt.org:mantisbt
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis committed Jun 16, 2009
2 parents e80c06c + 7871f6c commit 79f5bc2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions manage_proj_create.php
Expand Up @@ -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() ) ) {
Expand Down
7 changes: 6 additions & 1 deletion manage_proj_create_page.php
Expand Up @@ -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
Expand Down

0 comments on commit 79f5bc2

Please sign in to comment.