fix creating users
This commit is contained in:
parent
6452f5b5cb
commit
8b76590f5d
1 changed files with 17 additions and 9 deletions
|
@ -166,8 +166,10 @@ class OC_USER {
|
|||
if( $run ){
|
||||
//delete the user from all backends
|
||||
foreach(self::$_usedBackends as $backend){
|
||||
if($backend->implementsActions(OC_USER_BACKEND_DELETE_USER)){
|
||||
$backend->deleteUser($uid);
|
||||
}
|
||||
}
|
||||
// We have to delete the user from all groups
|
||||
foreach( OC_GROUP::getUserGroups( $uid ) as $i ){
|
||||
OC_GROUP::removeFromGroup( $uid, $i );
|
||||
|
@ -270,10 +272,12 @@ class OC_USER {
|
|||
|
||||
if( $run ){
|
||||
foreach(self::$_usedBackends as $backend){
|
||||
if($backend->implementsActions(OC_USER_BACKEND_SET_PASSWORD)){
|
||||
if($backend->userExists($uid)){
|
||||
$backend->setPassword($uid,$password);
|
||||
}
|
||||
}
|
||||
}
|
||||
OC_HOOK::emit( "OC_USER", "post_setPassword", array( "uid" => $uid, "password" => $password ));
|
||||
return true;
|
||||
}
|
||||
|
@ -292,12 +296,14 @@ class OC_USER {
|
|||
*/
|
||||
public static function checkPassword( $uid, $password ){
|
||||
foreach(self::$_usedBackends as $backend){
|
||||
if($backend->implementsActions(OC_USER_BACKEND_CHECK_PASSWORD)){
|
||||
$result=$backend->checkPassword( $uid, $password );
|
||||
if($result===true){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get a list of all users
|
||||
|
@ -322,11 +328,13 @@ class OC_USER {
|
|||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue