aboutsummaryrefslogtreecommitdiff
path: root/actions/user/name.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/user/name.php')
-rw-r--r--actions/user/name.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/actions/user/name.php b/actions/user/name.php
index 65809323c..d00b86a17 100644
--- a/actions/user/name.php
+++ b/actions/user/name.php
@@ -26,11 +26,14 @@
if (($user) && ($name))
{
- $user->name = $name;
- if ($user->save())
- system_message(elgg_echo('user:name:success'));
- else
- register_error(elgg_echo('user:name:fail'));
+ if (strcmp($name, $user->name)!=0)
+ {
+ $user->name = $name;
+ if ($user->save())
+ system_message(elgg_echo('user:name:success'));
+ else
+ register_error(elgg_echo('user:name:fail'));
+ }
}
else
register_error(elgg_echo('user:name:fail'));