return \OC_USER::getDisplayName();\r
}
+ /**\r
+ * @brief Get a list of all display names\r
+ * @returns array with all display names and the correspondig uids\r
+ *\r
+ * Get a list of all display names.\r
+ */\r
+ public static function getDisplayNames($search = '', $limit = null, $offset = null) {\r
+ return \OC_USER::getDisplayNames($search, $limit, $offset);\r
+ }
+
/**
* @brief Check if the user is logged in
* @returns true/false
asort($users);
return $users;
}
+
+ /**\r
+ * @brief Get a list of all users display name\r
+ * @returns associative array with all display names and corresponding uids\r
+ *\r
+ * Get a list of all users.\r
+ */\r
+ public static function getDisplayNames($search = '', $limit = null, $offset = null) {\r
+ $displayNames = array();\r
+ foreach (self::$_usedBackends as $backend) {\r
+ $backendDisplayNames = $backend->getDisplayNames($search, $limit, $offset);\r
+ if (is_array($backendDisplayNames)) {\r
+ $displayNames = array_merge($displayNames, $backendDisplayNames);\r
+ }\r
+ }\r
+ ksort($displayNames);\r
+ return $displayNames;\r
+ }
/**
* @brief check if a user exists
public function getDisplayName($uid) {
return $uid;
}
+
+ /**\r
+ * @brief Get a list of all display names\r
+ * @returns array with all displayNames and the correspondig uids\r
+ *\r
+ * Get a list of all display names.\r
+ */\r
+ public function getDisplayNames($search = '', $limit = null, $offset = null) {\r
+ $displayNames = array();
+ $users = $this->getUsers($search, $limit, $offset);
+ foreach ( $users as $user) {
+ $displayNames[$user] = $user;
+ }
+ return $displayNames;\r
+ }
}
if($isadmin) {
$accessiblegroups = OC_Group::getGroups();
- $accessibleusers = OC_User::getUsers('', 30);
+ $accessibleusers = OC_User::getDisplayNames('', 30);
$subadmins = OC_SubAdmin::getAllSubAdmins();
}else{
$accessiblegroups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser());
$defaultQuotaIsUserDefined=array_search($defaultQuota, $quotaPreset)===false && array_search($defaultQuota, array('none', 'default'))===false;
// load users and quota
-foreach($accessibleusers as $i) {
+foreach($accessibleusers as $displayName => $uid) {
$quota=OC_Preferences::getValue($i, 'files', 'quota', 'default');
$isQuotaUserDefined=array_search($quota, $quotaPreset)===false && array_search($quota, array('none', 'default'))===false;
+ $name = $displayName;
+ if ( $displayName != $uid ) {
+ $name = $name . ' ('.$uid.')';
+ }
+
$users[] = array(
- "name" => $i,
- "groups" => join( ", ", /*array_intersect(*/OC_Group::getUserGroups($i)/*, OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()))*/),
+ "name" => $name,
+ "groups" => join( ", ", /*array_intersect(*/OC_Group::getUserGroups($uid)/*, OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()))*/),
'quota'=>$quota,
'isQuotaUserDefined'=>$isQuotaUserDefined,
- 'subadmin'=>implode(', ', OC_SubAdmin::getSubAdminsGroups($i)));
+ 'subadmin'=>implode(', ', OC_SubAdmin::getSubAdminsGroups($iuid)));
}
foreach( $accessiblegroups as $i ) {