Always use the admin when putting poeple in a group

This commit is contained in:
Joas Schilling 2016-03-15 14:24:21 +01:00
parent 8eb9638490
commit 4e9c3b3d64
1 changed files with 8 additions and 7 deletions

View File

@ -175,14 +175,15 @@ trait Provisioning {
* @param string $group * @param string $group
*/ */
public function assureUserBelongsToGroup($user, $group){ public function assureUserBelongsToGroup($user, $group){
if (!$this->userBelongsToGroup($user, $group)){ $previous_user = $this->currentUser;
$previous_user = $this->currentUser; $this->currentUser = "admin";
$this->currentUser = "admin";
$this->addingUserToGroup($user, $group);
$this->currentUser = $previous_user;
}
$this->checkThatUserBelongsToGroup($user, $group);
if (!$this->userBelongsToGroup($user, $group)){
$this->addingUserToGroup($user, $group);
}
$this->checkThatUserBelongsToGroup($user, $group);
$this->currentUser = $previous_user;
} }
/** /**