aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-11-06 17:22:59 +0100
committerRobin Appelman <icewind@owncloud.com>2014-11-06 18:31:40 +0100
commitc21d1da01a9a5fb81d75b42c4c514743dc827caa (patch)
tree7cedefb571c2b60281419c3d5bc3ed2ecd8b9f96
parent7ecd2207157efffabdf5ec8f36c6f4accc348fc4 (diff)
downloadnextcloud-server-c21d1da01a9a5fb81d75b42c4c514743dc827caa.tar.gz
nextcloud-server-c21d1da01a9a5fb81d75b42c4c514743dc827caa.zip
Support displaynames for dummy user backend
-rw-r--r--lib/private/user/dummy.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/private/user/dummy.php b/lib/private/user/dummy.php
index dbcbb2a46f7..fd0201734fa 100644
--- a/lib/private/user/dummy.php
+++ b/lib/private/user/dummy.php
@@ -26,9 +26,11 @@
*/
class OC_User_Dummy extends OC_User_Backend {
private $users = array();
+ private $displayNames = array();
/**
* Create a new user
+ *
* @param string $uid The username of the user to create
* @param string $password The password of the new user
* @return bool
@@ -47,6 +49,7 @@ class OC_User_Dummy extends OC_User_Backend {
/**
* delete a user
+ *
* @param string $uid The username of the user to delete
* @return bool
*
@@ -63,6 +66,7 @@ class OC_User_Dummy extends OC_User_Backend {
/**
* Set password
+ *
* @param string $uid The username
* @param string $password The new password
* @return bool
@@ -80,6 +84,7 @@ class OC_User_Dummy extends OC_User_Backend {
/**
* Check if the password is correct
+ *
* @param string $uid The username
* @param string $password The password
* @return string
@@ -97,6 +102,7 @@ class OC_User_Dummy extends OC_User_Backend {
/**
* Get a list of all users
+ *
* @param string $search
* @param int $limit
* @param int $offset
@@ -105,12 +111,12 @@ class OC_User_Dummy extends OC_User_Backend {
* Get a list of all users.
*/
public function getUsers($search = '', $limit = null, $offset = null) {
- if(empty($search)) {
+ if (empty($search)) {
return array_keys($this->users);
}
$result = array();
- foreach(array_keys($this->users) as $user) {
- if(stripos($user, $search) !== false) {
+ foreach (array_keys($this->users) as $user) {
+ if (stripos($user, $search) !== false) {
$result[] = $user;
}
}
@@ -119,6 +125,7 @@ class OC_User_Dummy extends OC_User_Backend {
/**
* check if a user exists
+ *
* @param string $uid the username
* @return boolean
*/
@@ -141,4 +148,12 @@ class OC_User_Dummy extends OC_User_Backend {
public function countUsers() {
return 0;
}
+
+ public function setDisplayName($uid, $displayName) {
+ $this->displayNames[$uid] = $displayName;
+ }
+
+ public function getDisplayName($uid) {
+ return isset($this->displayNames[$uid])? $this->displayNames[$uid]: $uid;
+ }
}