1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 04:38:27 +01:00

Bugtracker #5174 - more helpful message, block duplicate emails

This commit is contained in:
e107steved 2011-04-12 21:11:16 +00:00
parent 349d7ce640
commit c79f22efd1
2 changed files with 14 additions and 3 deletions

View File

@ -142,6 +142,8 @@ define("LAN_SIGNUP_100", "Admin Approval Pending");
define('LAN_SIGNUP_101', 'Update of records failed - please contact the site administrator');
//define('LAN_SIGNUP_102', 'Signup refused');
define('LAN_SIGNUP_103', 'Too many users already using IP address: ');
define('LAN_SIGNUP_105', 'Unable to action your request - please contact the site administrator'); // Two people with same password.
define('LAN_SIGNUP_106', 'Unable to action your request - do you already have an account here?'); // Trying to set email same as existing
define("LAN_LOGINNAME", "Username");

View File

@ -78,7 +78,7 @@ if((e_QUERY == 'resend') && !USER && ($pref['user_reg_veri'] == 1))
{ // Account already activated
$ns -> tablerender(LAN_SIGNUP_40,LAN_SIGNUP_41."<br />");
require_once(FOOTERF);
exit;
exit();
}
@ -87,7 +87,8 @@ if((e_QUERY == 'resend') && !USER && ($pref['user_reg_veri'] == 1))
{
require_once(e_HANDLER."message_handler.php");
message_handler("ALERT",LAN_SIGNUP_64.': '.$clean_email); // email (or other info) not valid.
exit;
require_once(FOOTERF);
exit();
}
$row = $sql -> db_Fetch();
// We should have a user record here
@ -96,6 +97,13 @@ if((e_QUERY == 'resend') && !USER && ($pref['user_reg_veri'] == 1))
{ // Need to change the email address - check password to make sure
if ($userMethods->CheckPassword($_POST['resend_password'], $row['user_loginname'], $row['user_password']) === TRUE)
{
if ($sql->db_select('user', 'user_id, user_email', "user_email='".$new_email."'"))
{ // Email address already used by someone
require_once(e_HANDLER."message_handler.php");
message_handler("ALERT",LAN_SIGNUP_106); // Duplicate email
require_once(FOOTERF);
exit();
}
if($sql->db_Update("user", "user_email='".$new_email."' WHERE user_id = '".$row['user_id']."' LIMIT 1 "))
{
$row['user_email'] = $new_email;
@ -105,7 +113,8 @@ if((e_QUERY == 'resend') && !USER && ($pref['user_reg_veri'] == 1))
{
require_once(e_HANDLER."message_handler.php");
message_handler("ALERT",LAN_SIGNUP_52); // Incorrect Password.
exit;
require_once(FOOTERF);
exit();
}
}