From 3e79a2c85058e040ad5664a48650371b4752d0a7 Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 15 Jan 2009 10:23:11 +0000 Subject: Refs #641: Email changer now prevents changing to the same as another user. git-svn-id: https://code.elgg.org/elgg/trunk@2569 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/email/save.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'actions') diff --git a/actions/email/save.php b/actions/email/save.php index 236e011cb..4c2301c92 100644 --- a/actions/email/save.php +++ b/actions/email/save.php @@ -25,17 +25,23 @@ $user = get_entity($user_id); if ($user) - { - if ($user->email != $email) { - $user->email = $email; - if ($user->save()) - { - request_user_validation($user->getGUID()); - system_message(elgg_echo('email:save:success')); + { + if (!get_user_by_email($email)) + { + + if ($user->email != $email) { + $user->email = $email; + if ($user->save()) + { + request_user_validation($user->getGUID()); + system_message(elgg_echo('email:save:success')); + } + else + register_error(elgg_echo('email:save:fail')); } - else - register_error(elgg_echo('email:save:fail')); } + else + register_error(elgg_echo('registration:dupeemail')); } else register_error(elgg_echo('email:save:fail')); -- cgit v1.2.3