summaryrefslogtreecommitdiffstats
path: root/lib/user.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/user.php')
-rw-r--r--lib/user.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/user.php b/lib/user.php
index f953d221543..9dc8cca97a6 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -275,7 +275,7 @@ class OC_User {
foreach(self::$_usedBackends as $backend) {
if($backend->implementsActions(OC_USER_BACKEND_SET_DISPLAYNAME)) {
if($backend->userExists($uid)) {
- $success |= $backend->setDisplayName($uid, $displayName);
+ $result |= $backend->setDisplayName($uid, $displayName);
}
}
}
@@ -436,6 +436,24 @@ class OC_User {
}
return false;
}
+
+ /**
+ * @brief Check whether user can change his display name
+ * @param $uid The username
+ * @returns true/false
+ *
+ * Check whether a specified user can change his display name
+ */
+ public static function canUserChangeDisplayName($uid) {
+ foreach(self::$_usedBackends as $backend) {
+ if($backend->implementsActions(OC_USER_BACKEND_SET_DISPLAYNAME)) {
+ if($backend->userExists($uid)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
/**
* @brief Check if the password is correct