diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-11-26 12:17:28 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-11-27 13:47:32 +0100 |
commit | 0ed86c099319f856569ed19697685c43a456ee52 (patch) | |
tree | 9735c9632404aa68c996e1fd223faa484302e6c9 /lib/private/user/backend.php | |
parent | 24511c6f00a9cf7fe86a13d1d006537c1f8410ca (diff) | |
download | nextcloud-server-0ed86c099319f856569ed19697685c43a456ee52.tar.gz nextcloud-server-0ed86c099319f856569ed19697685c43a456ee52.zip |
Move OC_USER_BACKEND_* constants to OC_User_Backend class
Diffstat (limited to 'lib/private/user/backend.php')
-rw-r--r-- | lib/private/user/backend.php | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/lib/private/user/backend.php b/lib/private/user/backend.php index 1f0a524117d..5e0eef4771a 100644 --- a/lib/private/user/backend.php +++ b/lib/private/user/backend.php @@ -25,19 +25,28 @@ /** * error code for functions not provided by the user backend + * @deprecated Use \OC_User_Backend::NOT_IMPLEMENTED instead */ define('OC_USER_BACKEND_NOT_IMPLEMENTED', -501); /** * actions that user backends can define */ +/** @deprecated Use \OC_User_Backend::CREATE_USER instead */ define('OC_USER_BACKEND_CREATE_USER', 1 << 0); +/** @deprecated Use \OC_User_Backend::SET_PASSWORD instead */ define('OC_USER_BACKEND_SET_PASSWORD', 1 << 4); +/** @deprecated Use \OC_User_Backend::CHECK_PASSWORD instead */ define('OC_USER_BACKEND_CHECK_PASSWORD', 1 << 8); +/** @deprecated Use \OC_User_Backend::GET_HOME instead */ define('OC_USER_BACKEND_GET_HOME', 1 << 12); +/** @deprecated Use \OC_User_Backend::GET_DISPLAYNAME instead */ define('OC_USER_BACKEND_GET_DISPLAYNAME', 1 << 16); +/** @deprecated Use \OC_User_Backend::SET_DISPLAYNAME instead */ define('OC_USER_BACKEND_SET_DISPLAYNAME', 1 << 20); +/** @deprecated Use \OC_User_Backend::PROVIDE_AVATAR instead */ define('OC_USER_BACKEND_PROVIDE_AVATAR', 1 << 24); +/** @deprecated Use \OC_User_Backend::COUNT_USERS instead */ define('OC_USER_BACKEND_COUNT_USERS', 1 << 28); /** @@ -47,16 +56,32 @@ define('OC_USER_BACKEND_COUNT_USERS', 1 << 28); * Subclass this for your own backends, and see OC_User_Example for descriptions */ abstract class OC_User_Backend implements OC_User_Interface { + /** + * error code for functions not provided by the user backend + */ + const NOT_IMPLEMENTED = -501; + + /** + * actions that user backends can define + */ + const CREATE_USER = 1; // 1 << 0 + const SET_PASSWORD = 16; // 1 << 4 + const CHECK_PASSWORD = 256; // 1 << 8 + const GET_HOME = 4096; // 1 << 12 + const GET_DISPLAYNAME = 65536; // 1 << 16 + const SET_DISPLAYNAME = 1048576; // 1 << 20 + const PROVIDE_AVATAR = 16777216; // 1 << 24 + const COUNT_USERS = 268435456; // 1 << 28 protected $possibleActions = array( - OC_USER_BACKEND_CREATE_USER => 'createUser', - 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', - OC_USER_BACKEND_PROVIDE_AVATAR => 'canChangeAvatar', - OC_USER_BACKEND_COUNT_USERS => 'countUsers', + self::CREATE_USER => 'createUser', + self::SET_PASSWORD => 'setPassword', + self::CHECK_PASSWORD => 'checkPassword', + self::GET_HOME => 'getHome', + self::GET_DISPLAYNAME => 'getDisplayName', + self::SET_DISPLAYNAME => 'setDisplayName', + self::PROVIDE_AVATAR => 'canChangeAvatar', + self::COUNT_USERS => 'countUsers', ); /** @@ -64,7 +89,7 @@ abstract class OC_User_Backend implements OC_User_Interface { * @return int bitwise-or'ed actions * * Returns the supported actions as int to be - * compared with OC_USER_BACKEND_CREATE_USER etc. + * compared with self::CREATE_USER etc. */ public function getSupportedActions() { $actions = 0; @@ -83,7 +108,7 @@ abstract class OC_User_Backend implements OC_User_Interface { * @return boolean * * Returns the supported actions as int to be - * compared with OC_USER_BACKEND_CREATE_USER etc. + * compared with self::CREATE_USER etc. */ public function implementsActions($actions) { return (bool)($this->getSupportedActions() & $actions); |