require_once('class.openid.v3.php');
/**
- * Class for user management in a SQL Database (e.g. MySQL, SQLite)
+ * Class for user OpenId backend
*/
class OC_USER_OPENID extends OC_User_Backend {
/**
if( $run ){
//delete the user from all backends
foreach(self::$_usedBackends as $backend){
- if($backend->implementsActions(OC_USER_BACKEND_DELETE_USER)){
- $backend->deleteUser($uid);
- }
+ $backend->deleteUser($uid);
}
// We have to delete the user from all groups
foreach( OC_Group::getUserGroups( $uid ) as $i ){
public static function getUsers(){
$users=array();
foreach(self::$_usedBackends as $backend){
- if($backend->implementsActions(OC_USER_BACKEND_GET_USERS)){
- $backendUsers=$backend->getUsers();
- if(is_array($backendUsers)){
- $users=array_merge($users,$backendUsers);
- }
+ $backendUsers=$backend->getUsers();
+ if(is_array($backendUsers)){
+ $users=array_merge($users,$backendUsers);
}
}
return $users;
*/
public static function userExists($uid){
foreach(self::$_usedBackends as $backend){
- if($backend->implementsActions(OC_USER_BACKEND_USER_EXISTS)){
- $result=$backend->userExists($uid);
- if($result===true){
- return true;
- }
+ $result=$backend->userExists($uid);
+ if($result===true){
+ return true;
}
}
return false;
* actions that user backends can define
*/
define('OC_USER_BACKEND_CREATE_USER', 0x000001);
-define('OC_USER_BACKEND_DELETE_USER', 0x000010);
-define('OC_USER_BACKEND_SET_PASSWORD', 0x000100);
-define('OC_USER_BACKEND_CHECK_PASSWORD', 0x001000);
-define('OC_USER_BACKEND_GET_USERS', 0x010000);
-define('OC_USER_BACKEND_USER_EXISTS', 0x100000);
+define('OC_USER_BACKEND_SET_PASSWORD', 0x000010);
+define('OC_USER_BACKEND_CHECK_PASSWORD', 0x000100);
/**
protected $possibleActions = array(
OC_USER_BACKEND_CREATE_USER => 'createUser',
- OC_USER_BACKEND_DELETE_USER => 'deleteUser',
OC_USER_BACKEND_SET_PASSWORD => 'setPassword',
OC_USER_BACKEND_CHECK_PASSWORD => 'checkPassword',
- OC_USER_BACKEND_GET_USERS => 'getUsers',
- OC_USER_BACKEND_USER_EXISTS => 'userExists'
);
/**
public function implementsActions($actions){
return (bool)($this->getSupportedActions() & $actions);
}
+
+ /**
+ * @brief delete a user
+ * @param $uid The username of the user to delete
+ * @returns true/false
+ *
+ * Deletes a user
+ */
+ public function deleteUser( $uid ){
+ return false;
+ }
+
+ /**
+ * @brief Get a list of all users
+ * @returns array with all uids
+ *
+ * Get a list of all users.
+ */
+ public function getUsers(){
+ return array();
+ }
+
+ /**
+ * @brief check if a user exists
+ * @param string $uid the username
+ * @return boolean
+ */
+ public function userExists($uid){
+ return false;
+ }
}
return OC_USER_BACKEND_NOT_IMPLEMENTED;
}
- /**
- * @brief delete a user
- * @param $uid The username of the user to delete
- * @returns true/false
- *
- * Deletes a user
- */
- public function deleteUser( $uid ){
- return OC_USER_BACKEND_NOT_IMPLEMENTED;
- }
-
/**
* @brief Set password
* @param $uid The username
public function checkPassword($uid, $password){
return OC_USER_BACKEND_NOT_IMPLEMENTED;
}
-
- /**
- * @brief Get a list of all users
- * @returns array with all uids
- *
- * Get a list of all users.
- */
- public function getUsers(){
- return OC_USER_BACKEND_NOT_IMPLEMENTED;
- }
-
- /**
- * @brief check if a user exists
- * @param string $uid the username
- * @return boolean
- */
- public function userExists($uid){
- return OC_USER_BACKEND_NOT_IMPLEMENTED;
- }
}