diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/admin/admin_board.php | 9 | ||||
-rw-r--r-- | phpBB/admin/admin_db_utilities.php | 7 | ||||
-rw-r--r-- | phpBB/admin/admin_users.php | 18 | ||||
-rwxr-xr-x | phpBB/templates/Default/profile_add_body.tpl | 2 | ||||
-rw-r--r-- | phpBB/templates/Euclid/profile_add_body.tpl | 2 | ||||
-rw-r--r-- | phpBB/templates/subSilver/admin/board_config_body.tpl | 2 | ||||
-rw-r--r-- | phpBB/templates/subSilver/admin/user_edit_body.tpl | 2 | ||||
-rw-r--r-- | phpBB/templates/subSilver/profile_add_body.tpl | 2 |
8 files changed, 36 insertions, 8 deletions
diff --git a/phpBB/admin/admin_board.php b/phpBB/admin/admin_board.php index b858968fb4..2c55f5fc2c 100644 --- a/phpBB/admin/admin_board.php +++ b/phpBB/admin/admin_board.php @@ -123,6 +123,15 @@ $template->set_filenames(array( "body" => "admin/board_config_body.tpl") ); // +// Check to see if file uploads are possible before displaying +// avatar upload option. +// +if( (get_cfg_var('file_uploads') != 0) && (strtolower(get_cfg_var('file_uploads')) != 'off') && (phpversion() != '4.0.4pl1') ) +{ + $template->assign_block_vars('switch_uploads_possible', array()); +} + +// // Escape any quotes in the site description for proper display in the text // box on the admin page // diff --git a/phpBB/admin/admin_db_utilities.php b/phpBB/admin/admin_db_utilities.php index 595d4fe6d7..664904ec7a 100644 --- a/phpBB/admin/admin_db_utilities.php +++ b/phpBB/admin/admin_db_utilities.php @@ -32,7 +32,10 @@ if( !empty($setmodules) ) { $filename = basename(__FILE__); $module['General']['Backup_DB'] = $filename . "?perform=backup"; - $module['General']['Restore_DB'] = $filename . "?perform=restore"; + if( (get_cfg_var('file_uploads') != 0) && (strtolower(get_cfg_var('file_uploads')) != 'off') && (phpversion() != '4.0.4pl1') ) + { + $module['General']['Restore_DB'] = $filename . "?perform=restore"; + } return; } @@ -731,7 +734,7 @@ if( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) $template->set_filenames(array( "body" => "admin/db_utils_backup_body.tpl") ); - + $s_hidden_fields = "<input type=\"hidden\" name=\"perform\" value=\"backup\" /><input type=\"hidden\" name=\"drop\" value=\"1\" /><input type=\"hidden\" name=\"perform\" value=\"$perform\" />"; $template->assign_vars(array( diff --git a/phpBB/admin/admin_users.php b/phpBB/admin/admin_users.php index 1606383bba..bbc9905fda 100644 --- a/phpBB/admin/admin_users.php +++ b/phpBB/admin/admin_users.php @@ -127,6 +127,7 @@ function validate_optional_fields(&$icq, &$aim, &$msnm, &$yim, &$website, &$loca // // Begin program // + if( $mode == "edit" || $mode == "save" && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_GET_VARS[POST_USERS_URL]) || isset($HTTP_POST_VARS[POST_USERS_URL]) ) ) { @@ -977,7 +978,19 @@ if( $mode == "edit" || $mode == "save" && ( isset($HTTP_POST_VARS['username']) | $template->set_filenames(array( "body" => "admin/user_edit_body.tpl") ); - + + // + // Let's do an overall check for settings/versions which would prevent + // us from doing file uploads.... + // + if( (get_cfg_var('file_uploads') == 0) || (strtolower(get_cfg_var('file_uploads')) == 'off') || (phpversion() == '4.0.4pl1') || (!$board_config['allow_avatar_upload']) ) + { + $form_enctype = ''; + } + else + { + $form_enctype = 'enctype="multipart/form-data"'; + } $template->assign_vars(array( "USERNAME" => $username, "EMAIL" => $email, @@ -1077,6 +1090,7 @@ if( $mode == "edit" || $mode == "save" && ( isset($HTTP_POST_VARS['username']) | "L_PROFILE_INFO_NOTICE" => $lang['Profile_info_warn'], "L_CONFIRM" => $lang['Confirm'], "L_EMAIL_ADDRESS" => $lang['Email_address'], + "S_FORM_ENCTYPE" => $form_enctype, "HTML_STATUS" => $html_status, "BBCODE_STATUS" => sprintf($bbcode_status, '<a href="../' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'), @@ -1144,4 +1158,4 @@ else include('page_footer_admin.'.$phpEx); -?>
\ No newline at end of file +?> diff --git a/phpBB/templates/Default/profile_add_body.tpl b/phpBB/templates/Default/profile_add_body.tpl index ca9b56ff86..f919f8fab6 100755 --- a/phpBB/templates/Default/profile_add_body.tpl +++ b/phpBB/templates/Default/profile_add_body.tpl @@ -1,5 +1,5 @@ <tr> - <td><form action="{S_PROFILE_ACTION}" enctype="multipart/form-data" method="post"> + <td><form action="{S_PROFILE_ACTION}" {S_FORM_ENCTYPE} method="post"> <table border="0" align="center" width="100%" bgcolor="#000000" cellpadding="0" cellspacing="1"> <tr> <td> diff --git a/phpBB/templates/Euclid/profile_add_body.tpl b/phpBB/templates/Euclid/profile_add_body.tpl index 43f316fabb..86d5202a86 100644 --- a/phpBB/templates/Euclid/profile_add_body.tpl +++ b/phpBB/templates/Euclid/profile_add_body.tpl @@ -1,5 +1,5 @@ -<form action="{S_PROFILE_ACTION}" enctype="multipart/form-data" method="post"><table width="98%" cellspacing="0" cellpadding="4" border="0" align="center"> +<form action="{S_PROFILE_ACTION}" {S_FORM_ENCTYPE} method="post"><table width="98%" cellspacing="0" cellpadding="4" border="0" align="center"> <tr> <td align="left"><span class="gensmall"><a href="{U_INDEX}">{L_INDEX}</a></span></td> </tr> diff --git a/phpBB/templates/subSilver/admin/board_config_body.tpl b/phpBB/templates/subSilver/admin/board_config_body.tpl index e3739d49c4..0447747cb6 100644 --- a/phpBB/templates/subSilver/admin/board_config_body.tpl +++ b/phpBB/templates/subSilver/admin/board_config_body.tpl @@ -178,10 +178,12 @@ <td class="row1">{L_ALLOW_REMOTE} <br /><span class="gensmall">{L_ALLOW_REMOTE_EXPLAIN}</span></td> <td class="row2"><input type="radio" name="allow_avatar_remote" value="1" {AVATARS_REMOTE_YES} /> {L_YES} <input type="radio" name="allow_avatar_remote" value="0" {AVATARS_REMOTE_NO} /> {L_NO}</td> </tr> + <!-- BEGIN switch_uploads_possible --> <tr> <td class="row1">{L_ALLOW_UPLOAD}</td> <td class="row2"><input type="radio" name="allow_avatar_upload" value="1" {AVATARS_UPLOAD_YES} /> {L_YES} <input type="radio" name="allow_avatar_upload" value="0" {AVATARS_UPLOAD_NO} /> {L_NO}</td> </tr> + <!-- END switch_uploads_possible --> <tr> <td class="row1">{L_MAX_FILESIZE}<br /><span class="gensmall">{L_MAX_FILESIZE_EXPLAIN}</span></td> <td class="row2"><input type="text" size="4" maxlength="10" name="avatar_filesize" value="{AVATAR_FILESIZE}" /> Bytes</td> diff --git a/phpBB/templates/subSilver/admin/user_edit_body.tpl b/phpBB/templates/subSilver/admin/user_edit_body.tpl index 209adbca4d..1790582c98 100644 --- a/phpBB/templates/subSilver/admin/user_edit_body.tpl +++ b/phpBB/templates/subSilver/admin/user_edit_body.tpl @@ -5,7 +5,7 @@ {ERROR_BOX} -<form action="{S_PROFILE_ACTION}" enctype="multipart/form-data" method="post"><table width="98%" cellspacing="1" cellpadding="4" border="0" align="center" class="forumline"> +<form action="{S_PROFILE_ACTION}" {S_FORM_ENCTYPE} method="post"><table width="98%" cellspacing="1" cellpadding="4" border="0" align="center" class="forumline"> <tr> <th class="thHead" colspan="2">{L_REGISTRATION_INFO}</th> </tr> diff --git a/phpBB/templates/subSilver/profile_add_body.tpl b/phpBB/templates/subSilver/profile_add_body.tpl index 165652cd51..05ebadee9f 100644 --- a/phpBB/templates/subSilver/profile_add_body.tpl +++ b/phpBB/templates/subSilver/profile_add_body.tpl @@ -1,5 +1,5 @@ -<form action="{S_PROFILE_ACTION}" enctype="multipart/form-data" method="post"> +<form action="{S_PROFILE_ACTION}" {S_FORM_ENCTYPE} method="post"> {ERROR_BOX} <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center"> |