aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-01-15 10:23:11 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-01-15 10:23:11 +0000
commit3e79a2c85058e040ad5664a48650371b4752d0a7 (patch)
tree17cf0cbaf4f200f8edad689103a923d855119e3b /actions
parentf4d6c6567fb9c23a9654e704045f03dbf10e467e (diff)
downloadelgg-3e79a2c85058e040ad5664a48650371b4752d0a7.tar.gz
elgg-3e79a2c85058e040ad5664a48650371b4752d0a7.tar.bz2
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
Diffstat (limited to 'actions')
-rw-r--r--actions/email/save.php24
1 files changed, 15 insertions, 9 deletions
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'));