|
04.11.2005, 00:38
Часть 5
Открываем includes/smtp.php
Находим (31):
PHP код:
while (substr($server_response, 3, 1) != ' ')
Выше добавьте:
Открываем includes/usercp_activate.php
Находим (50):
PHP код:
if (intval($board_config['require_activation']) == USER_ACTIVATION_ADMIN && $userdata['user_level'] != ADMIN) { message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); }
Замените на:
PHP код:
if (intval($board_config['require_activation']) == USER_ACTIVATION_ADMIN && $row['user_newpasswd'] == '') { if (!$userdata['session_logged_in']) { redirect(append_sid('login.' . $phpEx . '?redirect=profile.' . $phpEx . '&mode=activate&' . POST_USERS_URL . '=' . $row['user_id'] . '&act_key=' . trim($HTTP_GET_VARS['act_key']))); } else if ($userdata['user_level'] != ADMIN) { message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); } }
Открываем includes/usercp_avatar.php
Находим (71):
PHP код:
function user_avatar_gallery($mode, &$error, &$error_msg, $avatar_filename) { global $board_config; $avatar_filename = str_replace(array('../', '..\\', './', '.\\'), '', $avatar_filename); if ($avatar_filename{0} == '/' || $avatar_filename{0} == "\\") { return ''; } if ( file_exists(@phpbb_realpath($board_config['avatar_gallery_path'] . '/' . $avatar_filename)) && ($mode == 'editprofile') ) { $return = ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY; } else
Заменяем на:
PHP код:
function user_avatar_gallery($mode, &$error, &$error_msg, $avatar_filename, $avatar_category) { global $board_config; $avatar_filename = phpbb_ltrim(basename($avatar_filename), "'"); $avatar_category = phpbb_ltrim(basename($avatar_category), "'"); if(!preg_match('/(\.gif$|\.png$|\.jpg|\.jpeg)$/is', $avatar_filename)) { return ''; } if ($avatar_filename == "" || $avatar_category == "") { return ''; } if ( file_exists(@phpbb_realpath($board_config['avatar_gallery_path'] . '/' . $avatar_category . '/' . $avatar_filename)) && ($mode == 'editprofile') ) { $return = ", user_avatar = '" . str_replace("\'", "''", $avatar_category . '/' . $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY; } else
Находим (123):
PHP код:
$ini_val = ( @phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
Ниже добавляем:
PHP код:
$width = $height = 0; $type = '';
Находим (185):
PHP код:
list($width, $height) = @getimagesize($tmp_filename);
Заменяем на:
PHP код:
list($width, $height, $type) = @getimagesize($tmp_filename);
Находим (211):
PHP код:
list($width, $height) = @getimagesize($avatar_filename);
Заменяем на:
PHP код:
list($width, $height, $type) = @getimagesize($avatar_filename);
Находим (219):
PHP код:
if ( $width > 0 && $height > 0 && $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] )
Выше добавляем:
PHP код:
switch ($type) { // GIF case 1: if ($imgtype != '.gif') { @unlink($tmp_filename); message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__); } break; // JPG, JPC, JP2, JPX, JB2 case 2: case 9: case 10: case 11: case 12: if ($imgtype != '.jpg' && $imgtype != '.jpeg') { @unlink($tmp_filename); message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__); } break; // PNG case 3: if ($imgtype != '.png') { @unlink($tmp_filename); message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__); } break; default: @unlink($tmp_filename); message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__); }
Находим (261):
PHP код:
if ( file_exists(@phpbb_realpath('./' . $board_config['avatar_path'] . '/' . $current_avatar)) ) { @unlink('./' . $board_config['avatar_path'] . '/' . $current_avatar); }
Заменяем на:
PHP код:
user_avatar_delete($current_type, $current_avatar);
Находим (327):
PHP код:
$avatar_images[$file][$avatar_row_count][$avatar_col_count] = $file . '/' . $sub_file;
Заменяем на:
PHP код:
$avatar_images[$file][$avatar_row_count][$avatar_col_count] = $sub_file;
Находим (373):
PHP код:
"AVATAR_IMAGE" => $board_config['avatar_gallery_path'] . '/' . $avatar_images[$category][$i][$j],
Заменяем на:
PHP код:
"AVATAR_IMAGE" => $board_config['avatar_gallery_path'] . '/' . $category . '/' . $avatar_images[$category][$i][$j],
Находим (385):
PHP код:
$s_hidden_vars = '<input type="hidden" name="sid" value="' . $session_id . '" /><input type="hidden" name="agreed" value="true" />';
Заменяем на:
PHP код:
$s_hidden_vars = '<input type="hidden" name="sid" value="' . $session_id . '" /><input type="hidden" name="agreed" value="true" /><input type="hidden" name="avatarcatname" value="' . $category . '" />';
|
|