diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-01-28 14:09:11 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-01-28 14:09:11 +0100 |
commit | e0f2ed2757b698448d49fa3e73340ce9ced25e7a (patch) | |
tree | a786746e555089386efae118277c031f7524be0a /lib/user.php | |
parent | 022a7b13b828fd1ffb4beb7f63cca45bf4ffff1e (diff) | |
download | nextcloud-server-e0f2ed2757b698448d49fa3e73340ce9ced25e7a.tar.gz nextcloud-server-e0f2ed2757b698448d49fa3e73340ce9ced25e7a.zip |
interface and API to change display names
Diffstat (limited to 'lib/user.php')
-rw-r--r-- | lib/user.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/user.php b/lib/user.php index 65f899aa27c..b91abd71fe6 100644 --- a/lib/user.php +++ b/lib/user.php @@ -269,10 +269,25 @@ class OC_User { /**
* @brief Sets user display name for session
*/
- private static function setDisplayName($uid) { - $_SESSION['display_name'] = self::determineDisplayName($uid);
+ public static function setDisplayName($uid, $displayName = null) { + $result = false; + if ($displayName ) {
+ foreach(self::$_usedBackends as $backend) {
+ if($backend->implementsActions(OC_USER_BACKEND_SET_DISPLAYNAME)) {
+ if($backend->userExists($uid)) {
+ $success |= $backend->setDisplayName($uid, $displayName);
+ }
+ }
+ } + } else { + $displayName = self::determineDisplayName($uid); + $result = true; + } + $_SESSION['display_name'] = $displayName; + return result;
} + /**
* @brief get display name
* @param $uid The username
|