Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
#9326 Expire sessions on user disable (stable-3_4_0)
  • Loading branch information
asmecher committed Sep 25, 2023
1 parent 91e1723 commit 32d071e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions controllers/grid/settings/user/form/UserDisableForm.php
Expand Up @@ -19,6 +19,7 @@
use APP\facades\Repo;
use APP\template\TemplateManager;
use PKP\form\Form;
use PKP\db\DAORegistry;

class UserDisableForm extends Form
{
Expand Down Expand Up @@ -99,6 +100,10 @@ public function execute(...$functionArgs)
$user->setDisabled($this->_enable ? false : true);
$user->setDisabledReason($this->getData('disableReason'));
Repo::user()->edit($user);
if ($user->getDisabled()) {
$sessionDao = DAORegistry::getDAO('SessionDAO');
$sessionDao->deleteByUserId($user->getId());
}
}
parent::execute(...$functionArgs);
return $user;
Expand Down

0 comments on commit 32d071e

Please sign in to comment.