Skip to content

Commit

Permalink
fix(Admin/EmailAccount): fix removeAdminAccess for master user
Browse files Browse the repository at this point in the history
  • Loading branch information
pschuele committed Jan 14, 2025
1 parent 22be455 commit 77bdb67
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tine20/Admin/Controller/EmailAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,15 @@ public function update(Tinebase_Record_Interface $_record, $_additionalArguments
$raii = Tinebase_EmailUser::prepareAccountForSieveAdminAccess($_record->getId());
}

$this->_inspectBeforeUpdate($_record, $currentAccount);
$account = $this->_backend->update($_record);
$this->_inspectAfterUpdate($account, $_record, $currentAccount);

if ($raii && Tinebase_EmailUser::backendSupportsMasterPassword($_record)) {
Tinebase_EmailUser::removeAdminAccess();
unset($raii);
try {
$this->_inspectBeforeUpdate($_record, $currentAccount);
$account = $this->_backend->update($_record);
$this->_inspectAfterUpdate($account, $_record, $currentAccount);
} finally {
if ($raii && Tinebase_EmailUser::backendSupportsMasterPassword($_record)) {
Tinebase_EmailUser::removeAdminAccess();
unset($raii);
}
}

return $account;
Expand Down

0 comments on commit 77bdb67

Please sign in to comment.