\n" . $msg_text . "\n";
+ }
+
+ exit;
+
+}
+
?>
\ No newline at end of file
diff --git a/phpBB/includes/post.php b/phpBB/includes/post.php
index ac364f6472..db77d05498 100644
--- a/phpBB/includes/post.php
+++ b/phpBB/includes/post.php
@@ -28,6 +28,8 @@ function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid
{
global $board_config;
+ $allowed_html_tags = split(",", $board_config['allow_html_tags']);
+
//
// Clean up the message
//
@@ -48,9 +50,9 @@ function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid
$length = $end_html - $start_html + 1;
$tagallowed = 0;
- for($i = 0; $i < sizeof($board_config['allow_html_tags']); $i++)
+ for($i = 0; $i < sizeof($allowed_html_tags); $i++)
{
- $match_tag = trim($board_config['allow_html_tags'][$i]);
+ $match_tag = trim($allowed_html_tags[$i]);
if( preg_match("/^[\/]?" . $match_tag . "( .*?)*$/i", trim(substr($message, $start_html + 1, $length - 2))) )
{
diff --git a/phpBB/language/email/admin_activate_english.tpl b/phpBB/language/email/admin_activate_english.tpl
new file mode 100644
index 0000000000..ece89ca1b0
--- /dev/null
+++ b/phpBB/language/email/admin_activate_english.tpl
@@ -0,0 +1,7 @@
+Hello,
+
+The account owned by "{USERNAME}" has been deactivated or newly created, you should check the details of this user (if required) and activate it using the following link:
+
+{U_ACTIVATE}
+
+{EMAIL_SIG}
\ No newline at end of file
diff --git a/phpBB/language/email/admin_welcome_activated_english.tpl b/phpBB/language/email/admin_welcome_activated_english.tpl
new file mode 100644
index 0000000000..1fbed221ba
--- /dev/null
+++ b/phpBB/language/email/admin_welcome_activated_english.tpl
@@ -0,0 +1,5 @@
+Hello {USERNAME},
+
+Your account has now been activated, you may login using the username and password you received in a previous email.
+
+{EMAIL_SIG}
\ No newline at end of file
diff --git a/phpBB/language/email/admin_welcome_inactive_english.tpl b/phpBB/language/email/admin_welcome_inactive_english.tpl
new file mode 100644
index 0000000000..44b66bf63e
--- /dev/null
+++ b/phpBB/language/email/admin_welcome_inactive_english.tpl
@@ -0,0 +1,16 @@
+{WELCOME_MSG}
+
+Please keep this email for your records. Your account information is as follows:
+
+----------------------------
+Username: {USERNAME}
+Password: {PASSWORD}
+----------------------------
+
+Your account is currently inactive, the administrator of the board will need to activate it before you can log in. You will receive another email when this has occured.
+
+Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
+
+Thank you for registering.
+
+{EMAIL_SIG}
\ No newline at end of file
diff --git a/phpBB/language/email/topic_notify_english.tpl b/phpBB/language/email/topic_notify_english.tpl
index 1280ab15d4..0ca46072b8 100644
--- a/phpBB/language/email/topic_notify_english.tpl
+++ b/phpBB/language/email/topic_notify_english.tpl
@@ -2,10 +2,10 @@ Hello {USERNAME},
You are receiving this email because you are watching the topic, "{TOPIC_TITLE}" at {SITENAME}. This topic has received a reply since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic.
-{TOPIC_URL}
+{U_TOPIC}
If you no longer wish to watch this topic you can either click the "Stop watching this topic link" found at the bottom of the topic above, or by clicking the following link:
-{UN_WATCH_URL}
+{U_STOP_WATCHING_TOPIC}
{EMAIL_SIG}
\ No newline at end of file
diff --git a/phpBB/language/email/user_activate_english.tpl b/phpBB/language/email/user_activate_english.tpl
new file mode 100644
index 0000000000..5d9457814e
--- /dev/null
+++ b/phpBB/language/email/user_activate_english.tpl
@@ -0,0 +1,7 @@
+Hello {USERNAME},
+
+Your account on {SITENAME} has been deactivated, most likely due to changes made to your profile. In order to reactivate your account you must click on the link below:
+
+{U_ACTIVATE}
+
+{EMAIL_SIG}
\ No newline at end of file
diff --git a/phpBB/language/email/user_welcome_english.tpl b/phpBB/language/email/user_welcome_english.tpl
new file mode 100644
index 0000000000..cd56a43ca9
--- /dev/null
+++ b/phpBB/language/email/user_welcome_english.tpl
@@ -0,0 +1,14 @@
+{WELCOME_MSG}
+
+Please keep this email for your records. Your account information is as follows:
+
+----------------------------
+Username: {USERNAME}
+Password: {PASSWORD}
+----------------------------
+
+Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
+
+Thank you for registering.
+
+{EMAIL_SIG}
\ No newline at end of file
diff --git a/phpBB/language/email/user_welcome_inactive_english.tpl b/phpBB/language/email/user_welcome_inactive_english.tpl
new file mode 100644
index 0000000000..81e4d41c12
--- /dev/null
+++ b/phpBB/language/email/user_welcome_inactive_english.tpl
@@ -0,0 +1,18 @@
+{WELCOME_MSG}
+
+Please keep this email for your records. Your account information is as follows:
+
+----------------------------
+Username: {USERNAME}
+Password: {PASSWORD}
+----------------------------
+
+Your account is currently inactive. You cannot use it until you visit the following link:
+
+{U_ACTIVATE}
+
+Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
+
+Thank you for registering.
+
+{EMAIL_SIG}
\ No newline at end of file
diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php
index ea18d29ffc..13f39cdc2d 100755
--- a/phpBB/language/lang_english.php
+++ b/phpBB/language/lang_english.php
@@ -137,6 +137,7 @@ $lang['You_last_visit'] = "You last visited on";
$lang['Welcome_to'] = "Welcome to"; // Followed by site name
$lang['Register'] = "Register";
$lang['Profile'] = "Profile";
+$lang['Edit_profile'] = "Edit your profile";
$lang['Search'] = "Search";
$lang['Private_msgs'] = "Private Messages";
$lang['Memberlist'] = "Memberlist";
@@ -358,7 +359,7 @@ $lang['No_such_user'] = "Sorry but no such user exists";
$lang['Message_sent'] = "Your message has been sent";
$lang['to_return_inbox'] = " to return to your Inbox"; // This follows a "Click HERE ... "
-$lang['to_return_index'] = " to return to the Forum Index"; // This follows a "Click HERE ... "
+$lang['to_return_index'] = " to return to the Index"; // This follows a "Click HERE ... "
$lang['Re'] = "Re"; // Re as in 'Response to'
@@ -367,7 +368,6 @@ $lang['Send_a_reply'] = "Reply to a private message";
$lang['Edit_message'] = "Edit private message";
$lang['Notification_subject'] = "New Private Message has arrived";
-$lang['Notification_email'] = "Hello " . $to_userdata['username'] . "\n\n, You have received a new private message on your account at " . $board_config['sitename'] . ". To view it immediately click the following link " . $pm_url . ", you may of course visit the site later your message will be stored in your Inbox.\n";
$lang['Find_username'] = "Find a username";
$lang['Find'] = "Find";
@@ -395,7 +395,7 @@ $lang['Contact'] = "Contact";
$lang['Email_address'] = "Email address";
$lang['Email'] = "Email";
$lang['Private_message'] = "Send Private Message";
-$lang['Hidden_email'] = "[ Hidden email address ]";
+$lang['Hidden_email'] = "[ Hidden ]";
$lang['Search_user_posts'] = "Search for posts by this user";
$lang['Interests'] = "Interests";
$lang['Occupation'] = "Occupation";
@@ -405,7 +405,7 @@ $lang['of_total'] = "of total"; // follows percentage of total posts
$lang['Wrong_Profile'] = "You cannot modify a profile that is not your own.";
$lang['Bad_username'] = "The username you choose has been taken or is disallowed by the administrator.";
-$lang['Sorry_banned_or_taken_email'] = "Sorry but the email address you gave has either been banned or is already registered to another user. You may try an alternative address, if that is also banned then you should contact the board administrator for advice.";
+$lang['Sorry_banned_or_taken_email'] = "Sorry but the email address you gave has either been banned, is already registered to another user or is invalid. Please try an alternative address, if that is also banned you should contact the board administrator for advice";
$lang['Only_one_avatar'] = "Only one type of avatar can be specified";
$lang['File_no_data'] = "The file at the URL you gave contains no data";
$lang['No_connection_URL'] = "A connection could not be made to the URL you gave";
@@ -464,13 +464,16 @@ $lang['Avatar_filetype'] = "The avatar filetype must be .jpg, .gif or .png";
$lang['Avatar_filesize'] = "The avatar image file size must more than 0 kB and less than " . round($board_config['avatar_filesize'] / 1024) . " kB";
$lang['Avatar_imagesize'] = "The avatar must be less than " . $board_config['avatar_max_width'] . " pixels wide and " . $board_config['avatar_max_height'] . " pixels high";
+$lang['Welcome_subject'] = "Welcome to " . $board_config['sitename'] . " Forums";
+$lang['New_account_subject'] = "New user account";
+$lang['Account_activated_subject'] = "Account Activated";
+
$lang['Account_added'] = "Thank you for registering, your account has been created. You may now login with your username and password";
$lang['Account_inactive'] = "Your account has been created. However, this forum requires account activation, an activation key has been sent to the email address you provided. Pease check your email for further information";
+$lang['Account_inactive_admin'] = "Your account has been created. However, this forum requires account activation by the administrator. An email has been sent to them and you will be informed when your account has been activated";
$lang['Account_active'] = "Your account has now been activated. Thank you for registering";
+$lang['Account_active_admin'] = "The account has now been activated";
$lang['Reactivate'] = "Reactivate your account!";
-
-$lang['Welcome_subject'] = "Welcome to " . $board_config['sitename'] . " Forums";
-
$lang['COPPA'] = "Your account has been created but has to be approved, please check your email for details.";
$lang['Welcome_COPPA'] = "Your account has been created, however in complance with the COPPA act you must print out this page and have you parent or guardian mail it to: " . $lang['Mailing_address'] . " Or fax it to: " . $lang['Fax_info'] . " Once this information has been received your account will be activated by the administrator and you will receive an email notification.";
@@ -539,7 +542,7 @@ $lang['Search_for_any'] = "Search for any terms or use query as entered";
$lang['Search_for_all'] = "Search for all terms";
$lang['Search_author'] = "Search for Author";
$lang['Return_first'] = "Return first"; // followed by xxx characters
-$lang['characters'] = "characters";
+$lang['characters_posts'] = "characters of posts";
$lang['Search_previous'] = "Search previous"; // followed by days, weeks, months, year, all
$lang['Sort_by'] = "Sort by";
$lang['Sort_Ascending'] = "Sort Ascending";
@@ -547,6 +550,9 @@ $lang['Sort_Decending'] = "Sort Descending";
$lang['Display_results'] = "Display results as";
$lang['All'] = "All";
$lang['No_search_match'] = "No topics or posts met your search criteria";
+$lang['found'] = "found"; // this precedes the number of matches found and follows Search
+$lang['match'] = "Match"; // this and the following entry proceed the number of matches found
+$lang['matches'] = "Matches";
$lang['Search_new'] = "View posts since last visit";
//
// Topic Admin <= Should be blank for now
diff --git a/phpBB/profile.php b/phpBB/profile.php
index 0ca4d15e2c..92f94f7039 100644
--- a/phpBB/profile.php
+++ b/phpBB/profile.php
@@ -23,6 +23,8 @@
$phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
+include($phpbb_root_path . 'includes/post.'.$phpEx);
+include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
//
// Start session management
@@ -34,10 +36,9 @@ init_userprefs($userdata);
//
-//
+// -----------------------
// Page specific functions
//
-
//
// Check to see if email address is banned
// or already present in the DB
@@ -48,35 +49,42 @@ function validate_email($email)
if($email != "")
{
- $sql = "SELECT ban_email
- FROM " . BANLIST_TABLE;
- if(!$result = $db->sql_query($sql))
+ if( preg_match("/^[a-z0-9\.\-_]+@[a-z0-9\-_]+\.([a-z0-9\-_]+\.)?[a-z]+$/is", $email) )
{
- message_die(GENERAL_ERROR, "Couldn't obtain email ban information.", "", __LINE__, __FILE__, $sql);
- }
- $ban_email_list = $db->sql_fetchrowset($result);
- for($i = 0; $i < count($ban_email_list); $i++)
- {
- $match_email = str_replace("*@", ".*@", $ban_email_list[$i]['ban_email']);
- if( preg_match("/^" . $match_email . "$/is", $email) )
+ $sql = "SELECT ban_email
+ FROM " . BANLIST_TABLE;
+ if(!$result = $db->sql_query($sql))
+ {
+ message_die(GENERAL_ERROR, "Couldn't obtain email ban information.", "", __LINE__, __FILE__, $sql);
+ }
+ $ban_email_list = $db->sql_fetchrowset($result);
+ for($i = 0; $i < count($ban_email_list); $i++)
+ {
+ $match_email = str_replace("*@", ".*@", $ban_email_list[$i]['ban_email']);
+ if( preg_match("/^" . $match_email . "$/is", $email) )
+ {
+ return(0);
+ }
+ }
+ $sql = "SELECT user_email
+ FROM " . USERS_TABLE . "
+ WHERE user_email = '" . $email . "'";
+ if(!$result = $db->sql_query($sql))
+ {
+ message_die(GENERAL_ERROR, "Couldn't obtain user email information.", "", __LINE__, __FILE__, $sql);
+ }
+ $email_taken = $db->sql_fetchrow($result);
+ if($email_taken['user_email'] != "")
{
return(0);
}
+
+ return(1);
}
- $sql = "SELECT user_email
- FROM " . USERS_TABLE . "
- WHERE user_email = '" . $email . "'";
- if(!$result = $db->sql_query($sql))
- {
- message_die(GENERAL_ERROR, "Couldn't obtain user email information.", "", __LINE__, __FILE__, $sql);
- }
- $email_taken = $db->sql_fetchrow($result);
- if($email_taken['user_email'] != "")
+ else
{
return(0);
}
-
- return(1);
}
else
{
@@ -117,9 +125,17 @@ function validate_optional_fields(&$icq, &$aim, &$msnm, &$yim, &$website, &$loca
// website has to start with http://, followed by something with length at least 3 that
// contains at least one dot.
- if (!preg_match("#^http\\:\\/\\/[a-z0-9]+\.[a-z0-9]+#i", $website))
+ if($website != "")
{
- $website = "";
+ if( !ereg("^http\:\/\/", $website) )
+ {
+ $website = "http://" . $website;
+ }
+
+ if (!preg_match("#^http\\:\\/\\/[a-z0-9]+\.[a-z0-9]+#i", $website))
+ {
+ $website = "";
+ }
}
// location has to have length >= 2.
@@ -163,7 +179,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
//
// Begin page proper
//
- if($mode == "viewprofile")
+ if( $mode == "viewprofile" )
{
//
// Output page header and
@@ -192,8 +208,9 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
// End header
//
- if(!$HTTP_GET_VARS[POST_USERS_URL])
+ if( !$HTTP_GET_VARS[POST_USERS_URL] )
{
+ // CHANGE THIS!
message_die(GENERAL_ERROR, "You must supply the user ID number of the user you want to view", "", __LINE__, __FILE__);
}
$profiledata = get_userdata_from_id($HTTP_GET_VARS[POST_USERS_URL]);
@@ -204,7 +221,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
//
$regdate = $profiledata['user_regdate'];
- $memberdays = (time() - $regdate) / (24*60*60);
+ $memberdays = round( ( time() - $regdate ) / 86400 );
$posts_per_day = sprintf("%.2f", $profiledata['user_posts'] / $memberdays);
// Get the users percentage of total posts
@@ -218,16 +235,16 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
$percentage = 0;
}
- if($profiledata['user_viewemail'])
+ if( $profiledata['user_viewemail'] )
{
// Replace the @ with 'at'. Some anti-spam mesures.
$email_addr = str_replace("@", " at ", $profiledata['user_email']);
$email = "$email_addr";
- $email_img = "";
+ $email_img = "";
}
else
{
- $email = $lang['Hidden_email'];
+ $email = "";
$email_img = "";
}
@@ -261,7 +278,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
$search_img = "";
$search = "" . $lang['Search_user_posts'] . "";
- $www_img = ($profiledata['user_website']) ? "" : " ";
+ $www_img = ($profiledata['user_website']) ? "" : " ";
$pm_img = "";
@@ -320,7 +337,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
else if($mode == "editprofile" || $mode == "register")
{
- if(!$userdata['session_logged_in'] && $mode == "editprofile")
+ if( !$userdata['session_logged_in'] && $mode == "editprofile" )
{
header(append_sid("Location: login.$phpEx?forward_page=$PHP_SELF&mode=editprofile"));
}
@@ -367,9 +384,9 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
}
- else if(isset($HTTP_POST_VARS['submit']) || $mode == "register")
+ else if( isset($HTTP_POST_VARS['submit']) || $mode == "register" )
{
- if($mode == "editprofile")
+ if( $mode == "editprofile" )
{
$user_id = $HTTP_POST_VARS['user_id'];
$current_email = trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['current_email'])));
@@ -386,13 +403,6 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
$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'])) : "";
- if($website != "")
- {
- if( !ereg("^http\:\/\/", $website) )
- {
- $website = "http://" . $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'])) : "";
@@ -402,18 +412,17 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
// empty strings if they fail.
validate_optional_fields($icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature);
- $viewemail = (isset($HTTP_POST_VARS['viewemail'])) ? ( ($HTTP_POST_VARS['viewemail']) ? 1 : 0 ) : 0;
- $allowviewonline = (isset($HTTP_POST_VARS['hideonline'])) ? ( ($HTTP_POST_VARS['hideonline']) ? 0 : 1 ) : 1;
- $notifyreply = (isset($HTTP_POST_VARS['notifyreply'])) ? ( ($HTTP_POST_VARS['notifyreply']) ? 1 : 0 ) : 0;
- $notifypm = (isset($HTTP_POST_VARS['notifypm'])) ? ( ($HTTP_POST_VARS['notifypm']) ? 1 : 0 ) : 1;
- $attachsig = (isset($HTTP_POST_VARS['attachsig'])) ? ( ($HTTP_POST_VARS['attachsig']) ? 1 : 0 ) : 0;
+ $viewemail = (isset($HTTP_POST_VARS['viewemail'])) ? ( ($HTTP_POST_VARS['viewemail']) ? TRUE : 0 ) : 0;
+ $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;
+ $attachsig = (isset($HTTP_POST_VARS['attachsig'])) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : 0;
- $allowhtml = (isset($HTTP_POST_VARS['allowhtml'])) ? ( ($HTTP_POST_VARS['allowhtml']) ? 1 : 0 ) : $board_config['allow_html'];
- $allowbbcode = (isset($HTTP_POST_VARS['allowbbcode'])) ? ( ($HTTP_POST_VARS['allowbbcode']) ? 1 : 0 ) : $board_config['allow_bbcode'];
- $allowsmilies = (isset($HTTP_POST_VARS['allowsmilies'])) ? ( ($HTTP_POST_VARS['allowsmilies']) ? 1 : 0 ) : $board_config['allow_smilies'];
+ $allowhtml = (isset($HTTP_POST_VARS['allowhtml'])) ? ( ($HTTP_POST_VARS['allowhtml']) ? TRUE : 0 ) : $userdata['user_allowhtml'];
+ $allowbbcode = (isset($HTTP_POST_VARS['allowbbcode'])) ? ( ($HTTP_POST_VARS['allowbbcode']) ? TRUE : 0 ) : $userdata['user_allowbbcode'];
+ $allowsmilies = (isset($HTTP_POST_VARS['allowsmilies'])) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $userdata['user_allowsmilies'];
- $user_template = ( isset($HTTP_POST_VARS['style']) ) ? substr($HTTP_POST_VARS['style'], 0, strrpos($HTTP_POST_VARS['style'], "_")) : $board_config['board_template'];
- $user_theme = ( isset($HTTP_POST_VARS['style']) ) ? substr($HTTP_POST_VARS['style'], strrpos($HTTP_POST_VARS['style'], "_") + 1) : $board_config['default_theme'];
+ $user_style = ( isset($HTTP_POST_VARS['style']) ) ? $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'])) ? $HTTP_POST_VARS['timezone'] : $board_config['board_timezone'];
@@ -443,19 +452,16 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
}
else if($mode == "register")
{
- $coppa = (!$HTTP_POST_VARS['coppa'] && !$HTTP_GET_VARS['coppa']) ? 0 : 1;
+ $coppa = (!$HTTP_POST_VARS['coppa'] && !$HTTP_GET_VARS['coppa']) ? 0 : TRUE;
- if(empty($username) || empty($password) || empty($password_confirm) || empty($email))
+ if( empty($username) || empty($password) || empty($password_confirm) || empty($email) )
{
$error = TRUE;
$error_msg = $lang['Fields_empty'];
}
}
- //
- // Do a ban check on this email address
- //
- if(!empty($password) && !empty($password_confirm))
+ if( !empty($password) && !empty($password_confirm) )
{
// Awww, the user wants to change their password, isn't that cute..
if($password != $password_confirm)
@@ -469,12 +475,15 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
$passwd_sql = "user_password = '$password', ";
}
}
- else if($password && !$password_confirm)
+ else if( ( $password && !$password_confirm ) || ( !$password && $password_confirm ) )
{
$error = TRUE;
$error_msg = $lang['Password_mismatch'];
}
+ //
+ // Do a ban check on this email address
+ //
if($email != $userdata['user_email'] || $mode == "register")
{
if(!validate_email($email))
@@ -799,11 +808,17 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
}
}
+ if( $signature != "" )
+ {
+ $signature_bbcode_uid = ( $allowbbcode ) ? make_bbcode_uid() : "";
+ $signature = prepare_message($signature, $allowhtml, $allowbbcode, $allowsmilies, $signature_bbcode_uid);
+ }
+
if(!$error)
{
if($mode == "editprofile")
{
- if($email != $current_email && $board_config['require_activation'])
+ if($email != $current_email && ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN ) )
{
$user_active = 0;
$user_actkey = generate_activation_key();
@@ -812,7 +827,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
// The user is inactive, remove their session forcing them to login again before they can post.
//
$sql = "DELETE FROM " . SESSIONS_TABLE . "
- WHERE session_user_id = " . $userdata['user_id'];
+ WHERE session_user_id = " . $userdata['user_id'];
$db->sql_query($sql);
@@ -824,42 +839,58 @@ 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_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_template = '$user_template', user_active = $user_active, user_actkey = '$user_actkey', user_theme = $user_theme" . $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_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))
{
- if($user_active == 0)
+ if( $user_active == 0 )
{
//
// The users account has been deactivated, send them an email with a new activation key
//
- $email_headers = "From: " . $board_config['email_from'] . "\r\n";
+ include($phpbb_root_path . 'includes/emailer.'.$phpEx);
+ $emailer = new emailer($board_config['smtp_delivery']);
+
+ $email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
$path = (dirname($HTTP_SERVER_VARS['REQUEST_URI']) == "/") ? "" : dirname($HTTP_SERVER_VARS['REQUEST_URI']);
- $emailer->use_template("activate");
- $emailer->email_address($email);
+ if( $board_config['require_activation'] == USER_ACTIVATION_SELF )
+ {
+ $emailer->use_template("user_activate");
+ $emailer->email_address($email);
+ }
+ else
+ {
+ $emailer->use_template("admin_activate");
+ $emailer->email_address($board_config['board_email']);
+ }
$emailer->set_subject($lang['Reactivate']);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
"SITENAME" => $board_config['sitename'],
"USERNAME" => $username,
- "EMAIL_SIG" => $board_config['board_email'],
+ "EMAIL_SIG" => str_replace(" ", "\n", "-- \n" . $board_config['board_email_sig']),
"U_ACTIVATE" => "http://" . $HTTP_SERVER_VARS['SERVER_NAME'] . $path . "/profile.$phpEx?mode=activate&act_key=$act_key")
);
$emailer->send();
$emailer->reset();
+
+ $message = $lang['Profile_updated'] . "