Skip to content
Snippets Groups Projects
Commit 8b76590f authored by Robin Appelman's avatar Robin Appelman
Browse files

fix creating users

parent 6452f5b5
Branches
No related tags found
No related merge requests found
...@@ -166,8 +166,10 @@ class OC_USER { ...@@ -166,8 +166,10 @@ class OC_USER {
if( $run ){ if( $run ){
//delete the user from all backends //delete the user from all backends
foreach(self::$_usedBackends as $backend){ 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 // We have to delete the user from all groups
foreach( OC_GROUP::getUserGroups( $uid ) as $i ){ foreach( OC_GROUP::getUserGroups( $uid ) as $i ){
OC_GROUP::removeFromGroup( $uid, $i ); OC_GROUP::removeFromGroup( $uid, $i );
...@@ -270,10 +272,12 @@ class OC_USER { ...@@ -270,10 +272,12 @@ class OC_USER {
if( $run ){ if( $run ){
foreach(self::$_usedBackends as $backend){ foreach(self::$_usedBackends as $backend){
if($backend->implementsActions(OC_USER_BACKEND_SET_PASSWORD)){
if($backend->userExists($uid)){ if($backend->userExists($uid)){
$backend->setPassword($uid,$password); $backend->setPassword($uid,$password);
} }
} }
}
OC_HOOK::emit( "OC_USER", "post_setPassword", array( "uid" => $uid, "password" => $password )); OC_HOOK::emit( "OC_USER", "post_setPassword", array( "uid" => $uid, "password" => $password ));
return true; return true;
} }
...@@ -292,12 +296,14 @@ class OC_USER { ...@@ -292,12 +296,14 @@ class OC_USER {
*/ */
public static function checkPassword( $uid, $password ){ public static function checkPassword( $uid, $password ){
foreach(self::$_usedBackends as $backend){ foreach(self::$_usedBackends as $backend){
if($backend->implementsActions(OC_USER_BACKEND_CHECK_PASSWORD)){
$result=$backend->checkPassword( $uid, $password ); $result=$backend->checkPassword( $uid, $password );
if($result===true){ if($result===true){
return true; return true;
} }
} }
} }
}
/** /**
* @brief Get a list of all users * @brief Get a list of all users
...@@ -322,11 +328,13 @@ class OC_USER { ...@@ -322,11 +328,13 @@ class OC_USER {
*/ */
public static function userExists($uid){ public static function userExists($uid){
foreach(self::$_usedBackends as $backend){ foreach(self::$_usedBackends as $backend){
if($backend->implementsActions(OC_USER_BACKEND_USER_EXISTS)){
$result=$backend->userExists($uid); $result=$backend->userExists($uid);
if($result===true){ if($result===true){
return true; return true;
} }
} }
}
return false; return false;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment