introduce new virtual method hasUserListings() to determine if a user backend can list it's users.
This commit is contained in:
parent
037fcde133
commit
5731a1b01c
|
@ -261,4 +261,10 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface {
|
|||
return (bool)((OC_USER_BACKEND_CHECK_PASSWORD | OC_USER_BACKEND_GET_HOME) & $actions);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasUserListings() {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -183,4 +183,12 @@ class User_Proxy extends lib\Proxy implements \OCP\UserInterface {
|
|||
public function deleteUser($uid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasUserListings() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -65,6 +65,12 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasUserListings() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* we don´t know the users so all we can do it return an empty array here
|
||||
|
|
|
@ -555,7 +555,7 @@ class OC_User {
|
|||
|
||||
public static function userExistsForCreation($uid) {
|
||||
foreach(self::$_usedBackends as $backend) {
|
||||
if(!$backend->implementsActions(OC_USER_BACKEND_CREATE_USER))
|
||||
if(!$backend->hasUserListings())
|
||||
continue;
|
||||
|
||||
$result=$backend->userExists($uid);
|
||||
|
|
|
@ -136,7 +136,7 @@ abstract class OC_User_Backend implements OC_User_Interface {
|
|||
|
||||
/**
|
||||
* @brief Get a list of all display names
|
||||
* @returns array with all displayNames (value) and the correspondig uids (key)
|
||||
* @returns array with all displayNames (value) and the corresponding uids (key)
|
||||
*
|
||||
* Get a list of all display names and user ids.
|
||||
*/
|
||||
|
@ -148,4 +148,12 @@ abstract class OC_User_Backend implements OC_User_Interface {
|
|||
}
|
||||
return $displayNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check if a user list is available or not
|
||||
* @return boolean if users can be listed or not
|
||||
*/
|
||||
public function hasUserListings() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -256,4 +256,12 @@ class OC_User_Database extends OC_User_Backend {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasUserListings() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -112,4 +112,11 @@ class OC_User_Dummy extends OC_User_Backend {
|
|||
public function userExists($uid) {
|
||||
return isset($this->users[$uid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasUserListings() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,10 +66,15 @@ interface OC_User_Interface {
|
|||
|
||||
/**
|
||||
* @brief Get a list of all display names
|
||||
* @returns array with all displayNames (value) and the correspondig uids (key)
|
||||
* @returns array with all displayNames (value) and the corresponding uids (key)
|
||||
*
|
||||
* Get a list of all display names and user ids.
|
||||
*/
|
||||
public function getDisplayNames($search = '', $limit = null, $offset = null);
|
||||
|
||||
/**
|
||||
* @brief Check if a user list is available or not
|
||||
* @return boolean if users can be listed or not
|
||||
*/
|
||||
public function hasUserListings();
|
||||
}
|
Loading…
Reference in New Issue