summaryrefslogtreecommitdiffstats
path: root/lib/user/backend.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/user/backend.php')
-rw-r--r--lib/user/backend.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/user/backend.php b/lib/user/backend.php
index 2a95db93690..56fa3195978 100644
--- a/lib/user/backend.php
+++ b/lib/user/backend.php
@@ -35,6 +35,8 @@ define('OC_USER_BACKEND_CREATE_USER', 0x000001);
define('OC_USER_BACKEND_SET_PASSWORD', 0x000010);
define('OC_USER_BACKEND_CHECK_PASSWORD', 0x000100);
define('OC_USER_BACKEND_GET_HOME', 0x001000);
+define('OC_USER_BACKEND_GET_DISPLAYNAME', 0x010000);
+define('OC_USER_BACKEND_SET_DISPLAYNAME', 0x010000);
/**
@@ -50,6 +52,8 @@ abstract class OC_User_Backend implements OC_User_Interface {
OC_USER_BACKEND_SET_PASSWORD => 'setPassword',
OC_USER_BACKEND_CHECK_PASSWORD => 'checkPassword',
OC_USER_BACKEND_GET_HOME => 'getHome',
+ OC_USER_BACKEND_GET_DISPLAYNAME => 'getDisplayName',
+ OC_USER_BACKEND_SET_DISPLAYNAME => 'setDisplayName',
);
/**
@@ -120,4 +124,28 @@ abstract class OC_User_Backend implements OC_User_Interface {
public function getHome($uid) {
return false;
}
+
+ /**
+ * @brief get display name of the user
+ * @param $uid user ID of the user
+ * @return display name
+ */
+ public function getDisplayName($uid) {
+ return $uid;
+ }
+
+ /**
+ * @brief Get a list of all display names
+ * @returns array with all displayNames (value) and the correspondig uids (key)
+ *
+ * Get a list of all display names and user ids.
+ */
+ public function getDisplayNames($search = '', $limit = null, $offset = null) {
+ $displayNames = array();
+ $users = $this->getUsers($search, $limit, $offset);
+ foreach ( $users as $user) {
+ $displayNames[$user] = $user;
+ }
+ return $displayNames;
+ }
}