mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
Replace "Disable User" web UI flow with transactions
Summary: Ref T13189. See PHI642. Upgrades the "Disable" action in the web UI to be transaction-based. This technically breaks things a little (you can't disable non-bot users, since they now require CAN_EDIT and you won't have it) but an upcoming change will fix the permissions issue. Test Plan: Disabled and enabled a (bot) user from the web UI. Reviewers: amckinley Maniphest Tasks: T13189 Differential Revision: https://secure.phabricator.com/D19604
This commit is contained in:
parent
4d89afcc61
commit
2f7b10c023
1 changed files with 11 additions and 2 deletions
|
@ -39,9 +39,18 @@ final class PhabricatorPeopleDisableController
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->isFormPost()) {
|
if ($request->isFormPost()) {
|
||||||
id(new PhabricatorUserEditor())
|
$xactions = array();
|
||||||
|
|
||||||
|
$xactions[] = id(new PhabricatorUserTransaction())
|
||||||
|
->setTransactionType(PhabricatorUserDisableTransaction::TRANSACTIONTYPE)
|
||||||
|
->setNewValue($should_disable);
|
||||||
|
|
||||||
|
id(new PhabricatorUserTransactionEditor())
|
||||||
->setActor($viewer)
|
->setActor($viewer)
|
||||||
->disableUser($user, $should_disable);
|
->setContentSourceFromRequest($request)
|
||||||
|
->setContinueOnMissingFields(true)
|
||||||
|
->setContinueOnNoEffect(true)
|
||||||
|
->applyTransactions($user, $xactions);
|
||||||
|
|
||||||
return id(new AphrontRedirectResponse())->setURI($done_uri);
|
return id(new AphrontRedirectResponse())->setURI($done_uri);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue