mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Fix re-adding to Chandler-group (#938)
This commit is contained in:
parent
71c59023cf
commit
dcf3631d89
2 changed files with 9 additions and 2 deletions
|
@ -45,4 +45,9 @@ class ChandlerGroups
|
|||
{
|
||||
foreach($this->perms->where("group", $UUID) as $perm) yield $perm;
|
||||
}
|
||||
|
||||
function isUserAMember(string $GID, string $UID): bool
|
||||
{
|
||||
return ($this->context->query("SELECT * FROM `ChandlerACLRelations` WHERE `group` = ? AND `user` = ?", $GID, $UID)) !== NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,8 +110,10 @@ final class AdminPresenter extends OpenVKPresenter
|
|||
if($user->onlineStatus() != $this->postParam("online")) $user->setOnline(intval($this->postParam("online")));
|
||||
$user->setVerified(empty($this->postParam("verify") ? 0 : 1));
|
||||
if($this->postParam("add-to-group")) {
|
||||
$query = "INSERT INTO `ChandlerACLRelations` (`user`, `group`) VALUES ('" . $user->getChandlerGUID() . "', '" . $this->postParam("add-to-group") . "')";
|
||||
DatabaseConnection::i()->getConnection()->query($query);
|
||||
if (!(new ChandlerGroups)->isUserAMember($user->getChandlerGUID(), $this->postParam("add-to-group"))) {
|
||||
$query = "INSERT INTO `ChandlerACLRelations` (`user`, `group`) VALUES ('" . $user->getChandlerGUID() . "', '" . $this->postParam("add-to-group") . "')";
|
||||
DatabaseConnection::i()->getConnection()->query($query);
|
||||
}
|
||||
}
|
||||
if($this->postParam("password")) {
|
||||
$user->getChandlerUser()->updatePassword($this->postParam("password"));
|
||||
|
|
Loading…
Reference in a new issue