aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-11-21 13:02:37 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-11-21 13:02:37 +0000
commitac2c2c688e997cd3998ae3139b0bf0205a4fc95c (patch)
tree345df97c46bd3225c16f589d5b53bfce7b7680c2
parent3c6e635bec42f408701397579cba004eaca0c960 (diff)
downloadforums-ac2c2c688e997cd3998ae3139b0bf0205a4fc95c.tar
forums-ac2c2c688e997cd3998ae3139b0bf0205a4fc95c.tar.gz
forums-ac2c2c688e997cd3998ae3139b0bf0205a4fc95c.tar.bz2
forums-ac2c2c688e997cd3998ae3139b0bf0205a4fc95c.tar.xz
forums-ac2c2c688e997cd3998ae3139b0bf0205a4fc95c.zip
Added pop-up control for PM's to profile
git-svn-id: file:///svn/phpbb/trunk@1403 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/admin/admin_users.php507
-rw-r--r--phpBB/includes/page_header.php5
-rw-r--r--phpBB/language/lang_english/lang_main.php4
-rw-r--r--phpBB/profile.php13
-rw-r--r--phpBB/templates/subSilver/admin/user_edit_body.tpl10
-rw-r--r--phpBB/templates/subSilver/profile_add_body.tpl8
6 files changed, 298 insertions, 249 deletions
diff --git a/phpBB/admin/admin_users.php b/phpBB/admin/admin_users.php
index 995038e6ba..4134a0398d 100644
--- a/phpBB/admin/admin_users.php
+++ b/phpBB/admin/admin_users.php
@@ -30,16 +30,16 @@ if($setmodules == 1)
//
// Load default header
-// We need to tell the pagestart file not to load page headers
-// because of the use of META tags.
//
-
$phpbb_root_dir = "./../";
-$no_page_header = TRUE;
+
require('pagestart.inc');
include($phpbb_root_dir . 'includes/bbcode.'.$phpEx);
include($phpbb_root_dir . 'includes/post.'.$phpEx);
+//
+//
+//
if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
{
$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
@@ -127,73 +127,266 @@ function validate_optional_fields(&$icq, &$aim, &$msnm, &$yim, &$website, &$loca
//
// Begin program
//
-if( $mode == "searchuser" )
-{
- //
- // Remove this later
- //
- exit;
-}
-else if( $mode == "edit" && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_GET_VARS[POST_USERS_URL]) || isset($HTTP_POST_VARS[POST_USERS_URL]) ) )
+if( $mode == "edit" || $mode == "save" && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_GET_VARS[POST_USERS_URL]) || isset($HTTP_POST_VARS[POST_USERS_URL]) ) )
{
- include('page_header_admin.' . $phpEx);
+
//
- // Let's find out a little about them...
+ // Ok, the profile has been modified and submitted, let's update
//
- if( isset($HTTP_GET_VARS[POST_USERS_URL]) || isset($HTTP_POST_VARS[POST_USERS_URL]) )
+ if( $mode == "save" && isset($HTTP_POST_VARS['submit']) )
{
- $user_id = ( isset($HTTP_POST_VARS[POST_USERS_URL]) ) ? $HTTP_POST_VARS[POST_USERS_URL] : $HTTP_GET_VARS[POST_USERS_URL];
- $this_userdata = get_userdata_from_id($user_id);
- }
- else
- {
- $this_userdata = get_userdata($HTTP_POST_VARS['username']);
+ $user_id = intval($HTTP_POST_VARS['id']);
+
+ $username = (!empty($HTTP_POST_VARS['username'])) ? trim(strip_tags($HTTP_POST_VARS['username'])) : "";
+ $email = (!empty($HTTP_POST_VARS['email'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : "";
+
+ $password = (!empty($HTTP_POST_VARS['password'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password']))) : "";
+ $password_confirm = (!empty($HTTP_POST_VARS['password_confirm'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password_confirm']))) : "";
+
+ $icq = (!empty($HTTP_POST_VARS['icq'])) ? trim(strip_tags($HTTP_POST_VARS['icq'])) : "";
+ $aim = (!empty($HTTP_POST_VARS['aim'])) ? trim(strip_tags($HTTP_POST_VARS['aim'])) : "";
+ $msn = (!empty($HTTP_POST_VARS['msn'])) ? trim(strip_tags($HTTP_POST_VARS['msn'])) : "";
+ $yim = (!empty($HTTP_POST_VARS['yim'])) ? trim(strip_tags($HTTP_POST_VARS['yim'])) : "";
+
+ $website = (!empty($HTTP_POST_VARS['website'])) ? trim(strip_tags($HTTP_POST_VARS['website'])) : "";
+ $location = (!empty($HTTP_POST_VARS['location'])) ? trim(strip_tags($HTTP_POST_VARS['location'])) : "";
+ $occupation = (!empty($HTTP_POST_VARS['occupation'])) ? trim(strip_tags($HTTP_POST_VARS['occupation'])) : "";
+ $interests = (!empty($HTTP_POST_VARS['interests'])) ? trim(strip_tags($HTTP_POST_VARS['interests'])) : "";
+ $signature = (!empty($HTTP_POST_VARS['signature'])) ? trim(strip_tags(str_replace("<br />", "\n", $HTTP_POST_VARS['signature']))) : "";
+
+ validate_optional_fields($icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature);
+
+ $viewemail = (isset($HTTP_POST_VARS['viewemail'])) ? intval($HTTP_POST_VARS['viewemail']) : 0;
+ $allowviewonline = (isset($HTTP_POST_VARS['hideonline'])) ? ( ($HTTP_POST_VARS['hideonline']) ? 0 : 1 ) : 1;
+ $notifypm = (isset($HTTP_POST_VARS['notifypm'])) ? intval($HTTP_POST_VARS['notifypm']) : 1;
+ $popuppm = (isset($HTTP_POST_VARS['popup_pm'])) ? ( ($HTTP_POST_VARS['popup_pm']) ? TRUE : 0 ) : TRUE;
+ $attachsig = (isset($HTTP_POST_VARS['attachsig'])) ? intval($HTTP_POST_VARS['attachsig']) : 0;
+
+ $allowhtml = (isset($HTTP_POST_VARS['allowhtml'])) ? intval($HTTP_POST_VARS['allowhtml']) : $board_config['allow_html'];
+ $allowbbcode = (isset($HTTP_POST_VARS['allowbbcode'])) ? intval($HTTP_POST_VARS['allowbbcode']) : $board_config['allow_bbcode'];
+ $allowsmilies = (isset($HTTP_POST_VARS['allowsmilies'])) ? intval($HTTP_POST_VARS['allowsmilies']) : $board_config['allow_smilies'];
+
+ $user_style = ($HTTP_POST_VARS['style']) ? intval($HTTP_POST_VARS['style']) : $board_config['default_style'];
+ $user_lang = ($HTTP_POST_VARS['language']) ? $HTTP_POST_VARS['language'] : $board_config['default_lang'];
+ $user_timezone = (isset($HTTP_POST_VARS['timezone'])) ? doubleval($HTTP_POST_VARS['timezone']) : $board_config['board_timezone'];
+ $user_template = ($HTTP_POST_VARS['template']) ? $HTTP_POST_VARS['template'] : $board_config['board_template'];
+ $user_dateformat = ($HTTP_POST_VARS['dateformat']) ? trim($HTTP_POST_VARS['dateformat']) : $board_config['default_dateformat'];
+
+ $user_status = (!empty($HTTP_POST_VARS['user_status'])) ? intval($HTTP_POST_VARS['user_status']) : 0;
+ $user_allowpm = (!empty($HTTP_POST_VARS['user_allowpm'])) ? intval($HTTP_POST_VARS['user_allowpm']) : 0;
+ $user_allowavatar = (!empty($HTTP_POST_VARS['user_allowavatar'])) ? intval($HTTP_POST_VARS['user_allowavatar']) : 0;
+ $user_rank = (!empty($HTTP_POST_VARS['user_rank'])) ? intval($HTTP_POST_VARS['user_rank']) : 0;
+
+ if( isset($HTTP_POST_VARS['submit']) )
+ {
+ $error = FALSE;
+ $passwd_sql = "";
+ }
+ else
+ {
+ $error = TRUE;
+ $passwd_sql = "";
+ }
+
+ if( !empty($password) && !empty($password_confirm) )
+ {
+ // Awww, the user wants to change their password, isn't that cute..
+ if($password != $password_confirm)
+ {
+ $error = TRUE;
+ $error_msg .= $lang['Password_mismatch'];
+ }
+ else
+ {
+ $password = md5($password);
+ $passwd_sql = "user_password = '$password', ";
+ }
+ }
+ else if( $password && !$password_confirm )
+ {
+ $error = TRUE;
+ $error_msg .= $lang['Password_mismatch'];
+ }
+ else if( !$password && $password_confirm )
+ {
+ $error = TRUE;
+ $error_msg .= $lang['Password_mismatch'];
+ }
+
+ if( $signature != "" )
+ {
+ $signature_bbcode_uid = ( $allowbbcode ) ? make_bbcode_uid() : "";
+ $signature = prepare_message($signature, $allowhtml, $allowbbcode, $allowsmilies, $signature_bbcode_uid);
+ }
+
+ if( isset($HTTP_POST_VARS['avatardel']) )
+ {
+ if( $user_avatar_type == USER_AVATAR_UPLOAD )
+ {
+ if( @file_exists("./../" . $board_config['avatar_path'] . "/" . $user_avatar) )
+ {
+ @unlink("./../" . $board_config['avatar_path'] . "/" . $user_avatar);
+ }
+ }
+ $avatar_sql = ", user_avatar = '', user_avatar_type = " . USER_AVATAR_NONE;
+ }
+
+ if( !$error )
+ {
+ if( $HTTP_POST_VARS['deleteuser'] )
+ {
+ $sql = "UPDATE " . POSTS_TABLE . "
+ SET poster_id = '-1', post_username = '$username'
+ WHERE poster_id = $user_id";
+ if( $result = $db->sql_query($sql) )
+ {
+ $sql = "UPDATE " . TOPICS_TABLE . "
+ SET topic_poster = '-1'
+ WHERE topic_poster = $user_id";
+ if( $result = $db->sql_query($sql) )
+ {
+ $sql = "DELETE FROM " . USERS_TABLE . "
+ WHERE user_id = $user_id";
+ if( $result = $db->sql_query($sql) )
+ {
+ $sql = "DELETE FROM " . USER_GROUP_TABLE . "
+ WHERE user_id = $user_id";
+ $result = @$db->sql_query($sql);
+
+ $message = $lang['User_deleted'];
+ }
+ else
+ {
+ $error = TRUE;
+ }
+ }
+ else
+ {
+ $error = TRUE;
+ }
+ }
+ else
+ {
+ $error = TRUE;
+ }
+
+ if( $error == TRUE )
+ {
+ $error_msg .= $lang['Admin_user_fail'];
+ }
+ }
+ else
+ {
+ $sql = "UPDATE " . USERS_TABLE . "
+ SET " . $username_sql . $passwd_sql . "user_email = '$email', user_icq = '$icq', user_website = '$website', user_occ = '$occupation', user_from = '$location', user_interests = '$interests', user_sig = '$signature', user_viewemail = $viewemail, user_aim = '$aim', user_yim = '$yim', user_msnm = '$msn', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '$user_lang', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '$user_dateformat', user_active = $user_status, user_actkey = '$user_actkey', user_rank = $user_rank" . $avatar_sql . "
+ WHERE user_id = $user_id";
+ if( $result = $db->sql_query($sql) )
+ {
+ $message .= $lang['Admin_user_updated'];
+ }
+ else
+ {
+ $error = TRUE;
+ $error_msg .= $lang['Admin_user_fail'];
+ }
+ }
+
+ $message .= "<br /><br />" . sprintf($lang['Click_return_useradmin'], "<a href=\"" . append_sid("admin_users.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
+
+ message_die(GENERAL_MESSAGE, $message);
+ }
+ else
+ {
+ $template->set_filenames(array(
+ "reg_header" => "error_body.tpl")
+ );
+ $template->assign_vars(array(
+ "ERROR_MESSAGE" => $error_msg)
+ );
+ $template->assign_var_from_handle("ERROR_BOX", "reg_header");
+
+ $username = stripslashes($username);
+ $email = stripslashes($email);
+ $password = "";
+ $password_confirm = "";
+
+ $icq = stripslashes($icq);
+ $aim = stripslashes($aim);
+ $msn = stripslashes($msn);
+ $yim = stripslashes($yim);
+
+ $website = stripslashes($website);
+ $location = stripslashes($location);
+ $occupation = stripslashes($occupation);
+ $interests = stripslashes($interests);
+ $signature = stripslashes($signature);
+
+ $user_lang = stripslashes($user_lang);
+ $user_dateformat = stripslashes($user_dateformat);
+ }
}
//
- // Now parse and display it as a template
+ // Let's find out a little about them...
//
- $user_id = $this_userdata['user_id'];
- $username = $this_userdata['username'];
- $email = $this_userdata['user_email'];
- $password = "";
- $password_confirm = "";
-
- $icq = $this_userdata['user_icq'];
- $aim = $this_userdata['user_aim'];
- $msn = $this_userdata['user_msnm'];
- $yim = $this_userdata['user_yim'];
-
- $website = $this_userdata['user_website'];
- $location = $this_userdata['user_from'];
- $occupation = $this_userdata['user_occ'];
- $interests = $this_userdata['user_interests'];
- $signature = $this_userdata['user_sig'];
-
- $viewemail = $this_userdata['user_viewemail'];
- $notifypm = $this_userdata['user_notify_pm'];
- $attachsig = $this_userdata['user_attachsig'];
- $allowhtml = $this_userdata['user_allowhtml'];
- $allowbbcode = $this_userdata['user_allowbbcode'];
- $allowsmilies = $this_userdata['user_allowsmile'];
- $allowviewonline = $this_userdata['user_allow_viewonline'];
-
- $user_avatar = $this_userdata['user_avatar'];
- $user_avatar_type = $this_userdata['user_avatar_type'];
- $user_style = $this_userdata['user_style'];
- $user_lang = $this_userdata['user_lang'];
- $user_timezone = $this_userdata['user_timezone'];
- $user_dateformat = $this_userdata['user_dateformat'];
-
- $user_status = $this_userdata['user_active'];
- $user_allowavatar = $this_userdata['user_allowavatar'];
- $user_allowpm = $this_userdata['user_allow_pm'];
-
- $COPPA = false;
+ if( !isset($HTTP_POST_VARS['submit']) && $mode != "save" )
+ {
+ if( isset($HTTP_GET_VARS[POST_USERS_URL]) || isset($HTTP_POST_VARS[POST_USERS_URL]) )
+ {
+ $user_id = ( isset($HTTP_POST_VARS[POST_USERS_URL]) ) ? $HTTP_POST_VARS[POST_USERS_URL] : $HTTP_GET_VARS[POST_USERS_URL];
+ $this_userdata = get_userdata_from_id($user_id);
+ }
+ else
+ {
+ $this_userdata = get_userdata($HTTP_POST_VARS['username']);
+ }
+
+ //
+ // Now parse and display it as a template
+ //
+ $user_id = $this_userdata['user_id'];
+ $username = $this_userdata['username'];
+ $email = $this_userdata['user_email'];
+ $password = "";
+ $password_confirm = "";
+
+ $icq = $this_userdata['user_icq'];
+ $aim = $this_userdata['user_aim'];
+ $msn = $this_userdata['user_msnm'];
+ $yim = $this_userdata['user_yim'];
+
+ $website = $this_userdata['user_website'];
+ $location = $this_userdata['user_from'];
+ $occupation = $this_userdata['user_occ'];
+ $interests = $this_userdata['user_interests'];
+ $signature = $this_userdata['user_sig'];
+
+ $viewemail = $this_userdata['user_viewemail'];
+ $notifypm = $this_userdata['user_notify_pm'];
+ $popuppm = $userdata['user_popup_pm'];
+ $attachsig = $this_userdata['user_attachsig'];
+ $allowhtml = $this_userdata['user_allowhtml'];
+ $allowbbcode = $this_userdata['user_allowbbcode'];
+ $allowsmilies = $this_userdata['user_allowsmile'];
+ $allowviewonline = $this_userdata['user_allow_viewonline'];
+
+ $user_avatar = $this_userdata['user_avatar'];
+ $user_avatar_type = $this_userdata['user_avatar_type'];
+ $user_style = $this_userdata['user_style'];
+ $user_lang = $this_userdata['user_lang'];
+ $user_timezone = $this_userdata['user_timezone'];
+ $user_dateformat = $this_userdata['user_dateformat'];
+
+ $user_status = $this_userdata['user_active'];
+ $user_allowavatar = $this_userdata['user_allowavatar'];
+ $user_allowpm = $this_userdata['user_allow_pm'];
+
+ $COPPA = false;
- $html_status = ($userdata['user_allowhtml']) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF'];
- $bbcode_status = ($userdata['user_allowbbcode']) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF'];
- $smilies_status = ($userdata['user_allowsmile']) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF'];
+ $html_status = ($this_userdata['user_allowhtml']) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF'];
+ $bbcode_status = ($this_userdata['user_allowbbcode']) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF'];
+ $smilies_status = ($this_userdata['user_allowsmile']) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF'];
+ }
$s_hidden_fields = '<input type="hidden" name="mode" value="save" /><input type="hidden" name="agreed" value="true" /><input type="hidden" name="coppa" value="' . $coppa . '" />';
$s_hidden_fields .= '<input type="hidden" name="id" value="' . $this_userdata['user_id'] . '" />';
@@ -247,9 +440,6 @@ else if( $mode == "edit" && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_
);
$template->assign_vars(array(
- "L_USER_TITLE" => $lang['User'] . " " . $lang['User_admin'],
- "L_USER_EXPLAIN" => $lang['User_admin_explain'],
-
"USERNAME" => $username,
"EMAIL" => $email,
"YIM" => $yim,
@@ -267,6 +457,8 @@ else if( $mode == "edit" && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_
"HIDE_USER_NO" => ($allowviewonline) ? "checked=\"checked\"" : "",
"NOTIFY_PM_YES" => ($notifypm) ? "checked=\"checked\"" : "",
"NOTIFY_PM_NO" => (!$notifypm) ? "checked=\"checked\"" : "",
+ "POPUP_PM_YES" => ($popuppm) ? "checked=\"checked\"" : "",
+ "POPUP_PM_NO" => (!$popuppm) ? "checked=\"checked\"" : "",
"ALWAYS_ADD_SIGNATURE_YES" => ($attachsig) ? "checked=\"checked\"" : "",
"ALWAYS_ADD_SIGNATURE_NO" => (!$attachsig) ? "checked=\"checked\"" : "",
"ALWAYS_ALLOW_BBCODE_YES" => ($allowbbcode) ? "checked=\"checked\"" : "",
@@ -288,6 +480,8 @@ else if( $mode == "edit" && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_
"USER_ACTIVE_NO" => (!$user_status) ? "checked=\"checked\"" : "",
"RANK_SELECT_BOX" => $rank_select_box,
+ "L_USER_TITLE" => $lang['User_admin'],
+ "L_USER_EXPLAIN" => $lang['User_admin_explain'],
"L_PASSWORD_IF_CHANGED" => $lang['password_if_changed'],
"L_PASSWORD_CONFIRM_IF_CHANGED" => $lang['password_confirm_if_changed'],
"L_SUBMIT" => $lang['Submit'],
@@ -327,6 +521,7 @@ else if( $mode == "edit" && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_
"L_SIGNATURE" => $lang['Signature'],
"L_SIGNATURE_EXPLAIN" => sprintf($lang['Signature_explain'], $board_config['max_sig_chars']),
"L_NOTIFY_ON_PRIVMSG" => $lang['Notify_on_privmsg'],
+ "L_POPUP_ON_PRIVMSG" => $lang['Popup_on_privmsg'],
"L_PREFERENCES" => $lang['Preferences'],
"L_PUBLIC_VIEW_EMAIL" => $lang['Public_view_email'],
"L_ITEMS_REQUIRED" => $lang['Items_required'],
@@ -349,188 +544,10 @@ else if( $mode == "edit" && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_
);
$template->pparse("body");
-}
-else if( $mode == "save" && isset($HTTP_POST_VARS['submit']) )
-{
- //
- // Ok, the profile has been modified and submitted, let's update
- //
-
- //
- // First let's declare our "Return Address"
- //
- $return_address = append_sid("admin_users." . $phpEx);
-
- $user_id = intval($HTTP_POST_VARS['id']);
-
- $username = (!empty($HTTP_POST_VARS['username'])) ? trim(strip_tags($HTTP_POST_VARS['username'])) : "";
- $email = (!empty($HTTP_POST_VARS['email'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['email']))) : "";
-
- $password = (!empty($HTTP_POST_VARS['password'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password']))) : "";
- $password_confirm = (!empty($HTTP_POST_VARS['password_confirm'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['password_confirm']))) : "";
-
- $icq = (!empty($HTTP_POST_VARS['icq'])) ? trim(strip_tags($HTTP_POST_VARS['icq'])) : "";
- $aim = (!empty($HTTP_POST_VARS['aim'])) ? trim(strip_tags($HTTP_POST_VARS['aim'])) : "";
- $msn = (!empty($HTTP_POST_VARS['msn'])) ? trim(strip_tags($HTTP_POST_VARS['msn'])) : "";
- $yim = (!empty($HTTP_POST_VARS['yim'])) ? trim(strip_tags($HTTP_POST_VARS['yim'])) : "";
-
- $website = (!empty($HTTP_POST_VARS['website'])) ? trim(strip_tags($HTTP_POST_VARS['website'])) : "";
- $location = (!empty($HTTP_POST_VARS['location'])) ? trim(strip_tags($HTTP_POST_VARS['location'])) : "";
- $occupation = (!empty($HTTP_POST_VARS['occupation'])) ? trim(strip_tags($HTTP_POST_VARS['occupation'])) : "";
- $interests = (!empty($HTTP_POST_VARS['interests'])) ? trim(strip_tags($HTTP_POST_VARS['interests'])) : "";
- $signature = (!empty($HTTP_POST_VARS['signature'])) ? trim(strip_tags(str_replace("<br />", "\n", $HTTP_POST_VARS['signature']))) : "";
-
- validate_optional_fields($icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature);
-
- $viewemail = (isset($HTTP_POST_VARS['viewemail'])) ? intval($HTTP_POST_VARS['viewemail']) : 0;
- $allowviewonline = (isset($HTTP_POST_VARS['hideonline'])) ? ( ($HTTP_POST_VARS['hideonline']) ? 0 : 1 ) : 1;
- $notifypm = (isset($HTTP_POST_VARS['notifypm'])) ? intval($HTTP_POST_VARS['notifypm']) : 1;
- $attachsig = (isset($HTTP_POST_VARS['attachsig'])) ? intval($HTTP_POST_VARS['attachsig']) : 0;
-
- $allowhtml = (isset($HTTP_POST_VARS['allowhtml'])) ? intval($HTTP_POST_VARS['allowhtml']) : $board_config['allow_html'];
- $allowbbcode = (isset($HTTP_POST_VARS['allowbbcode'])) ? intval($HTTP_POST_VARS['allowbbcode']) : $board_config['allow_bbcode'];
- $allowsmilies = (isset($HTTP_POST_VARS['allowsmilies'])) ? intval($HTTP_POST_VARS['allowsmilies']) : $board_config['allow_smilies'];
-
- $user_style = ($HTTP_POST_VARS['style']) ? intval($HTTP_POST_VARS['style']) : $board_config['default_style'];
- $user_lang = ($HTTP_POST_VARS['language']) ? $HTTP_POST_VARS['language'] : $board_config['default_lang'];
- $user_timezone = (isset($HTTP_POST_VARS['timezone'])) ? doubleval($HTTP_POST_VARS['timezone']) : $board_config['board_timezone'];
- $user_template = ($HTTP_POST_VARS['template']) ? $HTTP_POST_VARS['template'] : $board_config['board_template'];
- $user_dateformat = ($HTTP_POST_VARS['dateformat']) ? trim($HTTP_POST_VARS['dateformat']) : $board_config['default_dateformat'];
-
- $user_status = (!empty($HTTP_POST_VARS['user_status'])) ? intval($HTTP_POST_VARS['user_status']) : 0;
- $user_allowpm = (!empty($HTTP_POST_VARS['user_allowpm'])) ? intval($HTTP_POST_VARS['user_allowpm']) : 0;
- $user_allowavatar = (!empty($HTTP_POST_VARS['user_allowavatar'])) ? intval($HTTP_POST_VARS['user_allowavatar']) : 0;
- $user_rank = (!empty($HTTP_POST_VARS['user_rank'])) ? intval($HTTP_POST_VARS['user_rank']) : 0;
-
- if(isset($HTTP_POST_VARS['submit']))
- {
- $error = FALSE;
- $passwd_sql = "";
- }
- else
- {
- $error = TRUE;
- $passwd_sql = "";
- }
- if(!empty($password) && !empty($password_confirm))
- {
- // Awww, the user wants to change their password, isn't that cute..
- if($password != $password_confirm)
- {
- $error = TRUE;
- $error_msg .= $lang['Password_mismatch'];
- }
- else
- {
- $password = md5($password);
- $passwd_sql = "user_password = '$password', ";
- }
- }
- else if($password && !$password_confirm)
- {
- $error = TRUE;
- $error_msg .= $lang['Password_mismatch'];
- }
- else if(!$password && $password_confirm)
- {
- $error = TRUE;
- $error_msg .= $lang['Password_mismatch'];
- }
-
- if( $signature != "" )
- {
- $signature_bbcode_uid = ( $allowbbcode ) ? make_bbcode_uid() : "";
- $signature = prepare_message($signature, $allowhtml, $allowbbcode, $allowsmilies, $signature_bbcode_uid);
- }
-
- if( isset($HTTP_POST_VARS['avatardel']) )
- {
- if( $user_avatar_type == USER_AVATAR_UPLOAD )
- {
- if( file_exists("./../" . $board_config['avatar_path'] . "/" . $user_avatar) )
- {
- @unlink("./../" . $board_config['avatar_path'] . "/" . $user_avatar);
- }
- }
- $avatar_sql = ", user_avatar = '', user_avatar_type = " . USER_AVATAR_NONE;
- }
-
- if(!$error)
- {
- if( $HTTP_POST_VARS['deleteuser'] )
- {
- $sql = "UPDATE " . POSTS_TABLE . "
- SET poster_id = '-1', post_username = '$username'
- WHERE poster_id = $user_id";
- if( $result = $db->sql_query($sql) )
- {
- $sql = "UPDATE " . TOPICS_TABLE . "
- SET topic_poster = '-1'
- WHERE topic_poster = $user_id";
- if( $result = $db->sql_query($sql) )
- {
- $sql = "DELETE FROM " . USERS_TABLE . "
- WHERE user_id = $user_id";
- if( $result = $db->sql_query($sql) )
- {
- $sql = "DELETE FROM " . USER_GROUP_TABLE . "
- WHERE user_id = $user_id";
- $result = @$db->sql_query($sql);
-
- $message = $lang['User_deleted'];
- }
- else
- {
- $error = TRUE;
- }
- }
- else
- {
- $error = TRUE;
- }
- }
- else
- {
- $error = TRUE;
- }
-
- if( $error == TRUE )
- {
- $error_msg .= $lang['Admin_user_fail'];
- }
- }
- else
- {
- $sql = "UPDATE " . USERS_TABLE . "
- SET " . $username_sql . $passwd_sql . "user_email = '$email', user_icq = '$icq', user_website = '$website', user_occ = '$occupation', user_from = '$location', user_interests = '$interests', user_sig = '$signature', user_viewemail = $viewemail, user_aim = '$aim', user_yim = '$yim', user_msnm = '$msn', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_lang = '$user_lang', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '$user_dateformat', user_active = $user_status, user_actkey = '$user_actkey', user_rank = $user_rank" . $avatar_sql . "
- WHERE user_id = $user_id";
- if( $result = $db->sql_query($sql) )
- {
- $message .= $lang['Admin_user_updated'];
- }
- else
- {
- $error = TRUE;
- $error_msg .= $lang['Admin_user_fail'];
- }
- }
- $template->assign_vars(array(
- "META" => '<meta http-equiv="refresh" content="3;url=' . $return_address . '">')
- );
- message_die(GENERAL_MESSAGE, $message . "<br />" . sprintf($lang['Click_return_useradmin'], "<a href=\"" . $return_address . "\">", "</a>"), $lang['User_admin']);
- }
- else
- {
- $template->assign_vars(array(
- "META" => '<meta http-equiv="refresh" content="3;url=' . $return_address . '">')
- );
- message_die(GENERAL_ERROR, $error_msg . "<br />" . sprintf($lang['Click_return_useradmin'], "<a href=\"" . $return_address . "\">", "</a>"), $lang['User_admin']);
- }
}
else
{
- include('page_header_admin.' . $phpEx);
//
// Default user selection box
//
@@ -555,9 +572,9 @@ else
);
$template->assign_vars(array(
- "L_USER_TITLE" => $lang['User'] . " " . $lang['User_admin'],
+ "L_USER_TITLE" => $lang['User_admin'],
"L_USER_EXPLAIN" => $lang['User_admin_explain'],
- "L_USER_SELECT" => $lang['Select_a'] . " " . $lang['User'],
+ "L_USER_SELECT" => $lang['Select_a_User'],
"L_LOOK_UP" => $lang['Look_up_user'],
"L_FIND_USERNAME" => $lang['Find_username'],
diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php
index 0de7bfeb8e..c5aa78032e 100644
--- a/phpBB/includes/page_header.php
+++ b/phpBB/includes/page_header.php
@@ -327,6 +327,11 @@ $template->assign_vars(array(
if( !$userdata['session_logged_in'] )
{
$template->assign_block_vars("switch_user_logged_out", array());
+
+ if( $userdata['user_popup_pm'] )
+ {
+ $template->assign_block_vars("switch_enable_pm_popup", array());
+ }
}
else
{
diff --git a/phpBB/language/lang_english/lang_main.php b/phpBB/language/lang_english/lang_main.php
index e580170c27..c66e32c653 100644
--- a/phpBB/language/lang_english/lang_main.php
+++ b/phpBB/language/lang_english/lang_main.php
@@ -503,7 +503,9 @@ $lang['Select_category'] = "Select category";
$lang['Delete_Image'] = "Delete Image";
$lang['Current_Image'] = "Current Image";
-$lang['Notify_on_privmsg'] = "Notify on Private Message";
+$lang['Notify_on_privmsg'] = "Notify on new Private Message";
+$lang['Popup_on_privmsg'] = "Pop up window on new Private Message";
+$lang['Popup_on_privmsg_explain'] = "Some templates may open a new window to inform you when new private messages arrive";
$lang['Hide_user'] = "Hide your online status";
$lang['Profile_updated'] = "Your profile has been updated";
diff --git a/phpBB/profile.php b/phpBB/profile.php
index 54edce1fcb..87c705cc73 100644
--- a/phpBB/profile.php
+++ b/phpBB/profile.php
@@ -498,6 +498,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
$allowviewonline = (isset($HTTP_POST_VARS['hideonline'])) ? ( ($HTTP_POST_VARS['hideonline']) ? 0 : TRUE ) : TRUE;
$notifyreply = (isset($HTTP_POST_VARS['notifyreply'])) ? ( ($HTTP_POST_VARS['notifyreply']) ? TRUE : 0 ) : 0;
$notifypm = (isset($HTTP_POST_VARS['notifypm'])) ? ( ($HTTP_POST_VARS['notifypm']) ? TRUE : 0 ) : TRUE;
+ $popuppm = (isset($HTTP_POST_VARS['popup_pm'])) ? ( ($HTTP_POST_VARS['popup_pm']) ? TRUE : 0 ) : TRUE;
$attachsig = (isset($HTTP_POST_VARS['attachsig'])) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : 0;
$allowhtml = (isset($HTTP_POST_VARS['allowhtml'])) ? ( ($HTTP_POST_VARS['allowhtml']) ? TRUE : 0 ) : $userdata['user_allowhtml'];
@@ -982,7 +983,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
}
$sql = "UPDATE " . USERS_TABLE . "
- SET " . $username_sql . $passwd_sql . "user_email = '$email', user_icq = '$icq', user_website = '$website', user_occ = '$occupation', user_from = '$location', user_interests = '$interests', user_sig = '$signature', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '$aim', user_yim = '$yim', user_msnm = '$msn', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_timezone = $user_timezone, user_dateformat = '$user_dateformat', user_lang = '$user_lang', user_style = $user_style, user_active = $user_active, user_actkey = '$user_actkey'" . $avatar_sql . "
+ SET " . $username_sql . $passwd_sql . "user_email = '$email', user_icq = '$icq', user_website = '$website', user_occ = '$occupation', user_from = '$location', user_interests = '$interests', user_sig = '$signature', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '$aim', user_yim = '$yim', user_msnm = '$msn', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_timezone = $user_timezone, user_dateformat = '$user_dateformat', user_lang = '$user_lang', user_style = $user_style, user_active = $user_active, user_actkey = '$user_actkey'" . $avatar_sql . "
WHERE user_id = $user_id";
if( $result = $db->sql_query($sql) )
@@ -1055,8 +1056,8 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
//
// Get current date
//
- $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
- VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$icq', '$website', '$occupation', '$location', '$interests', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, '$aim', '$yim', '$msn', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, ";
+ $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
+ VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$icq', '$website', '$occupation', '$location', '$interests', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, '$aim', '$yim', '$msn', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popuppm $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, ";
if( $board_config['require_activation'] ==USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN || $coppa == 1)
{
@@ -1238,6 +1239,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
$viewemail = $userdata['user_viewemail'];
$notifypm = $userdata['user_notify_pm'];
+ $popuppm = $userdata['user_popup_pm'];
$notifyreply = $userdata['user_notify'];
$attachsig = $userdata['user_attachsig'];
$allowhtml = $userdata['user_allowhtml'];
@@ -1374,6 +1376,7 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
$s_hidden_vars .= '<input type="hidden" name="signature" value="' . addslashes($signature) . '" />';
$s_hidden_vars .= '<input type="hidden" name="viewemail" value="' . $viewemail . '" />';
$s_hidden_vars .= '<input type="hidden" name="notifypm" value="' . $notifypm . '" />';
+ $s_hidden_vars .= '<input type="hidden" name="popup_pm" value="' . $popuppm . '" />';
$s_hidden_vars .= '<input type="hidden" name="notifyreply" value="' . $notifyreply . '" />';
$s_hidden_vars .= '<input type="hidden" name="attachsig" value="' . $attachsig . '" />';
$s_hidden_vars .= '<input type="hidden" name="allowhtml" value="' . $allowhtml . '" />';
@@ -1514,6 +1517,8 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
"HIDE_USER_NO" => ($allowviewonline) ? "checked=\"checked\"" : "",
"NOTIFY_PM_YES" => ($notifypm) ? "checked=\"checked\"" : "",
"NOTIFY_PM_NO" => (!$notifypm) ? "checked=\"checked\"" : "",
+ "POPUP_PM_YES" => ($popuppm) ? "checked=\"checked\"" : "",
+ "POPUP_PM_NO" => (!$popuppm) ? "checked=\"checked\"" : "",
"ALWAYS_ADD_SIGNATURE_YES" => ($attachsig) ? "checked=\"checked\"" : "",
"ALWAYS_ADD_SIGNATURE_NO" => (!$attachsig) ? "checked=\"checked\"" : "",
"NOTIFY_REPLY_YES" => ($notifyreply) ? "checked=\"checked\"" : "",
@@ -1580,6 +1585,8 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
"L_NOTIFY_ON_REPLY" => $lang['Always_notify'],
"L_NOTIFY_ON_REPLY_EXPLAIN" => $lang['Always_notify_explain'],
"L_NOTIFY_ON_PRIVMSG" => $lang['Notify_on_privmsg'],
+ "L_POPUP_ON_PRIVMSG" => $lang['Popup_on_privmsg'],
+ "L_POPUP_ON_PRIVMSG_EXPLAIN" => $lang['Popup_on_privmsg_explain'],
"L_PREFERENCES" => $lang['Preferences'],
"L_PUBLIC_VIEW_EMAIL" => $lang['Public_view_email'],
"L_ITEMS_REQUIRED" => $lang['Items_required'],
diff --git a/phpBB/templates/subSilver/admin/user_edit_body.tpl b/phpBB/templates/subSilver/admin/user_edit_body.tpl
index 5a666c86a1..517b3abef8 100644
--- a/phpBB/templates/subSilver/admin/user_edit_body.tpl
+++ b/phpBB/templates/subSilver/admin/user_edit_body.tpl
@@ -3,6 +3,8 @@
<p>{L_USER_EXPLAIN}</p>
+{ERROR_BOX}
+
<form action="{S_PROFILE_ACTION}" 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>
@@ -135,6 +137,14 @@
<span class="gen">{L_NO}</span></td>
</tr>
<tr>
+ <td class="row1"><span class="gen">{L_POPUP_ON_PRIVMSG}:</span></td>
+ <td class="row2">
+ <input type="radio" name="popup_pm" value="1" {POPUP_PM_YES} />
+ <span class="gen">{L_YES}</span>&nbsp;&nbsp;
+ <input type="radio" name="popup_pm" value="0" {POPUP_PM_NO} />
+ <span class="gen">{L_NO}</span></td>
+ </tr>
+ <tr>
<td class="row1"><span class="gen">{L_ALWAYS_ADD_SIGNATURE}:</span></td>
<td class="row2">
<input type="radio" name="attachsig" value="1" {ALWAYS_ADD_SIGNATURE_YES} />
diff --git a/phpBB/templates/subSilver/profile_add_body.tpl b/phpBB/templates/subSilver/profile_add_body.tpl
index 7c842f1532..83a1a812ea 100644
--- a/phpBB/templates/subSilver/profile_add_body.tpl
+++ b/phpBB/templates/subSilver/profile_add_body.tpl
@@ -153,6 +153,14 @@
<span class="gen">{L_NO}</span></td>
</tr>
<tr>
+ <td class="row1"><span class="gen">{L_POPUP_ON_PRIVMSG}:</span><br /><span class="gensmall">{L_POPUP_ON_PRIVMSG_EXPLAIN}</span></td>
+ <td class="row2">
+ <input type="radio" name="popup_pm" value="1" {POPUP_PM_YES} />
+ <span class="gen">{L_YES}</span>&nbsp;&nbsp;
+ <input type="radio" name="popup_pm" value="0" {POPUP_PM_NO} />
+ <span class="gen">{L_NO}</span></td>
+ </tr>
+ <tr>
<td class="row1"><span class="gen">{L_ALWAYS_ADD_SIGNATURE}:</span></td>
<td class="row2">
<input type="radio" name="attachsig" value="1" {ALWAYS_ADD_SIGNATURE_YES} />