Differential D20670 Diff 49297 src/applications/people/xaction/PhabricatorUserEmpowerTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/xaction/PhabricatorUserEmpowerTransaction.php
| Show All 11 Lines | final class PhabricatorUserEmpowerTransaction | ||||
| public function generateNewValue($object, $value) { | public function generateNewValue($object, $value) { | ||||
| return (bool)$value; | return (bool)$value; | ||||
| } | } | ||||
| public function applyInternalEffects($object, $value) { | public function applyInternalEffects($object, $value) { | ||||
| $object->setIsAdmin((int)$value); | $object->setIsAdmin((int)$value); | ||||
| } | } | ||||
| public function applyExternalEffects($object, $value) { | |||||
| $user = $object; | |||||
| $this->newUserLog(PhabricatorUserLog::ACTION_ADMIN) | |||||
| ->setOldValue($this->getOldValue()) | |||||
| ->setNewValue($value) | |||||
| ->save(); | |||||
| } | |||||
| public function validateTransactions($object, array $xactions) { | public function validateTransactions($object, array $xactions) { | ||||
| $user = $object; | $user = $object; | ||||
| $actor = $this->getActor(); | $actor = $this->getActor(); | ||||
| $errors = array(); | $errors = array(); | ||||
| foreach ($xactions as $xaction) { | foreach ($xactions as $xaction) { | ||||
| $old = $xaction->getOldValue(); | $old = $xaction->getOldValue(); | ||||
| $new = $xaction->getNewValue(); | $new = $xaction->getNewValue(); | ||||
| ▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines | |||||