summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-02-06 11:38:03 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-02-06 11:38:03 +0100
commit9d73e7eb1e0dae044ef386211b214e01624a3364 (patch)
tree11d85b61a0260291f9430d3602591a11f873d8b2 /lib
parent335b6cd0609b269b3b8c85baed2eeed94f654c3d (diff)
downloadnextcloud-server-9d73e7eb1e0dae044ef386211b214e01624a3364.tar.gz
nextcloud-server-9d73e7eb1e0dae044ef386211b214e01624a3364.zip
let the user change his display name, if supported by the back-end
Diffstat (limited to 'lib')
-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