diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-12-21 02:22:07 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-12-21 02:22:07 +0000 |
commit | 44d7feaffce820765cae98c735b402bb2e7ccac3 (patch) | |
tree | eb216d6f1d01ac39f63245aac587a06a6bf6a20a | |
parent | 88a58755da44c5eb3c2297b83bbce62b821ac7fd (diff) | |
download | forums-44d7feaffce820765cae98c735b402bb2e7ccac3.tar forums-44d7feaffce820765cae98c735b402bb2e7ccac3.tar.gz forums-44d7feaffce820765cae98c735b402bb2e7ccac3.tar.bz2 forums-44d7feaffce820765cae98c735b402bb2e7ccac3.tar.xz forums-44d7feaffce820765cae98c735b402bb2e7ccac3.zip |
Admin send/view emails + fix avatar strangeness ... hopefully
git-svn-id: file:///svn/phpbb/trunk@1654 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/profile.php | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/phpBB/profile.php b/phpBB/profile.php index e2d84988bb..ac64dbe972 100644 --- a/phpBB/profile.php +++ b/phpBB/profile.php @@ -258,7 +258,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) $percentage = 0; } - if( !empty($profiledata['user_viewemail']) ) + if( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN ) { $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $profiledata['user_id']) : "mailto:" . $profiledata['user_email']; @@ -731,7 +731,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) } $avatar_sql = ", user_avatar = '', user_avatar_type = " . USER_AVATAR_NONE; } - else if( $board_config['allow_avatar_upload'] && !$error ) + else if( ( $user_avatar_loc != "" || !empty($user_avatar_url) ) && $board_config['allow_avatar_upload'] && !$error ) { // // Only allow one type of upload, either a @@ -747,7 +747,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) $error_msg .= $lang['Only_one_avatar']; } - if( $user_avatar_loc != "" && $board_config['allow_avatar_upload'] ) + if( $user_avatar_loc != "" ) { if( file_exists($user_avatar_loc) && ereg(".jpg$|.gif$|.png$", $user_avatar_name) ) { @@ -823,7 +823,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $lang['Avatar_filetype'] : $lang['Avatar_filetype']; } } - else if( !empty($user_avatar_url) && $board_config['allow_avatar_upload'] ) + else if( !empty($user_avatar_url) ) { // // First check what port we should connect @@ -959,33 +959,27 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $l_avatar_size : $l_avatar_size; } } - else if( $board_config['allow_avatar_remote'] && !$error ) + else if( $user_avatar_remoteurl != "" && $board_config['allow_avatar_remote'] && $avatar_sql == "" && !$error ) { - if($user_avatar_remoteurl != "" && $avatar_sql == "") + if( !preg_match("#^http:\/\/#i", $user_avatar_remoteurl) ) { - if( !preg_match("#^http:\/\/#i", $user_avatar_remoteurl) ) - { - $user_avatar_remoteurl = "http://" . $user_avatar_remoteurl; - } + $user_avatar_remoteurl = "http://" . $user_avatar_remoteurl; + } - if( preg_match("#^http:\/\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+\/.*?\.(gif|jpg|png)$#is", $user_avatar_remoteurl) ) - { - $avatar_sql = ", user_avatar = '$user_avatar_remoteurl', user_avatar_type = " . USER_AVATAR_REMOTE; - } - else - { - $error = true; - $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format']; - } + if( preg_match("#^http:\/\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+\/.*?\.(gif|jpg|png)$#is", $user_avatar_remoteurl) ) + { + $avatar_sql = ", user_avatar = '$user_avatar_remoteurl', user_avatar_type = " . USER_AVATAR_REMOTE; } - } - else if( $board_config['allow_avatar_local'] && !$error ) - { - if( $user_avatar_local != "" && $avatar_sql == "" ) + else { - $avatar_sql = ", user_avatar = '$user_avatar_local', user_avatar_type = " . USER_AVATAR_GALLERY; + $error = true; + $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format']; } } + else if( $user_avatar_local != "" && $board_config['allow_avatar_local'] && $avatar_sql == "" && !$error ) + { + $avatar_sql = ", user_avatar = '$user_avatar_local', user_avatar_type = " . USER_AVATAR_GALLERY; + } if( !$error ) { @@ -1338,7 +1332,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) $avatar_images = array(); while( $file = @readdir($dir) ) { - if( $file != "." && $file != ".." && !is_file($file) && !is_link($file) ) + if( $file != "." && $file != ".." && !is_file($board_config['avatar_gallery_path'] . "/" . $file) && !is_link($board_config['avatar_gallery_path'] . "/" . $file) ) { $sub_dir = @opendir($board_config['avatar_gallery_path'] . "/" . $file); @@ -1909,7 +1903,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) $user_email = $row['user_email']; $user_lang = $row['user_lang']; - if( $row['user_viewemail'] ) + if( $row['user_viewemail'] || $userdata['user_level'] == ADMIN ) { if( time() - $userdata['user_emailtime'] < $board_config['flood_interval'] ) { |