diff --git a/src/applications/people/editor/PhabricatorUserEditor.php b/src/applications/people/editor/PhabricatorUserEditor.php index c8068858da..9ab2c9d60b 100644 --- a/src/applications/people/editor/PhabricatorUserEditor.php +++ b/src/applications/people/editor/PhabricatorUserEditor.php @@ -74,13 +74,6 @@ final class PhabricatorUserEditor extends PhabricatorEditor { throw $ex; } - $log = PhabricatorUserLog::initializeNewLog( - $this->requireActor(), - $user->getPHID(), - PhabricatorUserLog::ACTION_CREATE); - $log->setNewValue($email->getAddress()); - $log->save(); - if ($is_reassign) { $log = PhabricatorUserLog::initializeNewLog( $this->requireActor(), @@ -100,35 +93,6 @@ final class PhabricatorUserEditor extends PhabricatorEditor { } - /** - * @task edit - */ - public function updateUser( - PhabricatorUser $user, - PhabricatorUserEmail $email = null) { - - if (!$user->getID()) { - throw new Exception(pht('User has not been created yet!')); - } - - $user->openTransaction(); - $user->save(); - if ($email) { - $email->save(); - } - - $log = PhabricatorUserLog::initializeNewLog( - $this->requireActor(), - $user->getPHID(), - PhabricatorUserLog::ACTION_EDIT); - $log->save(); - - $user->saveTransaction(); - - return $this; - } - - /* -( Editing Roles )------------------------------------------------------ */ /** @@ -151,18 +115,9 @@ final class PhabricatorUserEditor extends PhabricatorEditor { return $this; } - $log = PhabricatorUserLog::initializeNewLog( - $actor, - $user->getPHID(), - PhabricatorUserLog::ACTION_SYSTEM_AGENT); - $log->setOldValue($user->getIsSystemAgent()); - $log->setNewValue($system_agent); - $user->setIsSystemAgent((int)$system_agent); $user->save(); - $log->save(); - $user->endWriteLocking(); $user->saveTransaction(); @@ -189,18 +144,9 @@ final class PhabricatorUserEditor extends PhabricatorEditor { return $this; } - $log = PhabricatorUserLog::initializeNewLog( - $actor, - $user->getPHID(), - PhabricatorUserLog::ACTION_MAILING_LIST); - $log->setOldValue($user->getIsMailingList()); - $log->setNewValue($mailing_list); - $user->setIsMailingList((int)$mailing_list); $user->save(); - $log->save(); - $user->endWriteLocking(); $user->saveTransaction(); diff --git a/src/applications/people/storage/PhabricatorUserLog.php b/src/applications/people/storage/PhabricatorUserLog.php index 12cb4cb626..c7550ba8e5 100644 --- a/src/applications/people/storage/PhabricatorUserLog.php +++ b/src/applications/people/storage/PhabricatorUserLog.php @@ -11,16 +11,6 @@ final class PhabricatorUserLog extends PhabricatorUserDAO const ACTION_LOGIN_LEGALPAD = 'login-legalpad'; const ACTION_RESET_PASSWORD = 'reset-pass'; - const ACTION_CREATE = 'create'; - const ACTION_EDIT = 'edit'; - - const ACTION_ADMIN = 'admin'; - const ACTION_SYSTEM_AGENT = 'system-agent'; - const ACTION_MAILING_LIST = 'mailing-list'; - const ACTION_DISABLE = 'disable'; - const ACTION_APPROVE = 'approve'; - const ACTION_DELETE = 'delete'; - const ACTION_CONDUIT_CERTIFICATE = 'conduit-cert'; const ACTION_CONDUIT_CERTIFICATE_FAILURE = 'conduit-cert-fail'; @@ -31,7 +21,6 @@ final class PhabricatorUserLog extends PhabricatorUserDAO const ACTION_EMAIL_REASSIGN = 'email-reassign'; const ACTION_CHANGE_PASSWORD = 'change-password'; - const ACTION_CHANGE_USERNAME = 'change-username'; const ACTION_ENTER_HISEC = 'hisec-enter'; const ACTION_EXIT_HISEC = 'hisec-exit'; @@ -59,14 +48,6 @@ final class PhabricatorUserLog extends PhabricatorUserDAO pht('Login: Signed Required Legalpad Documents'), self::ACTION_LOGOUT => pht('Logout'), self::ACTION_RESET_PASSWORD => pht('Reset Password'), - self::ACTION_CREATE => pht('Create Account'), - self::ACTION_EDIT => pht('Edit Account'), - self::ACTION_ADMIN => pht('Add/Remove Administrator'), - self::ACTION_SYSTEM_AGENT => pht('Add/Remove System Agent'), - self::ACTION_MAILING_LIST => pht('Add/Remove Mailing List'), - self::ACTION_DISABLE => pht('Enable/Disable'), - self::ACTION_APPROVE => pht('Approve Registration'), - self::ACTION_DELETE => pht('Delete User'), self::ACTION_CONDUIT_CERTIFICATE => pht('Conduit: Read Certificate'), self::ACTION_CONDUIT_CERTIFICATE_FAILURE @@ -77,7 +58,6 @@ final class PhabricatorUserLog extends PhabricatorUserDAO self::ACTION_EMAIL_VERIFY => pht('Email: Verify'), self::ACTION_EMAIL_REASSIGN => pht('Email: Reassign'), self::ACTION_CHANGE_PASSWORD => pht('Change Password'), - self::ACTION_CHANGE_USERNAME => pht('Change Username'), self::ACTION_ENTER_HISEC => pht('Hisec: Enter'), self::ACTION_EXIT_HISEC => pht('Hisec: Exit'), self::ACTION_FAIL_HISEC => pht('Hisec: Failed Attempt'), diff --git a/src/applications/people/xaction/PhabricatorUserApproveTransaction.php b/src/applications/people/xaction/PhabricatorUserApproveTransaction.php index e458c5822c..77d58bebdf 100644 --- a/src/applications/people/xaction/PhabricatorUserApproveTransaction.php +++ b/src/applications/people/xaction/PhabricatorUserApproveTransaction.php @@ -19,10 +19,6 @@ final class PhabricatorUserApproveTransaction public function applyExternalEffects($object, $value) { $user = $object; - $this->newUserLog(PhabricatorUserLog::ACTION_APPROVE) - ->setOldValue((bool)$user->getIsApproved()) - ->setNewValue((bool)$value) - ->save(); $actor = $this->getActor(); $title = pht( diff --git a/src/applications/people/xaction/PhabricatorUserDisableTransaction.php b/src/applications/people/xaction/PhabricatorUserDisableTransaction.php index 7a8a1c7966..f259e78ee4 100644 --- a/src/applications/people/xaction/PhabricatorUserDisableTransaction.php +++ b/src/applications/people/xaction/PhabricatorUserDisableTransaction.php @@ -17,13 +17,6 @@ final class PhabricatorUserDisableTransaction $object->setIsDisabled((int)$value); } - public function applyExternalEffects($object, $value) { - $this->newUserLog(PhabricatorUserLog::ACTION_DISABLE) - ->setOldValue((bool)$object->getIsDisabled()) - ->setNewValue((bool)$value) - ->save(); - } - public function getTitle() { $new = $this->getNewValue(); if ($new) { diff --git a/src/applications/people/xaction/PhabricatorUserEmpowerTransaction.php b/src/applications/people/xaction/PhabricatorUserEmpowerTransaction.php index 1b561d3236..5499f5d8cb 100644 --- a/src/applications/people/xaction/PhabricatorUserEmpowerTransaction.php +++ b/src/applications/people/xaction/PhabricatorUserEmpowerTransaction.php @@ -17,15 +17,6 @@ final class PhabricatorUserEmpowerTransaction $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) { $user = $object; $actor = $this->getActor(); diff --git a/src/applications/people/xaction/PhabricatorUserTransactionType.php b/src/applications/people/xaction/PhabricatorUserTransactionType.php index dcd45d480e..89392fd039 100644 --- a/src/applications/people/xaction/PhabricatorUserTransactionType.php +++ b/src/applications/people/xaction/PhabricatorUserTransactionType.php @@ -1,13 +1,4 @@ getActor(), - $this->getObject()->getPHID(), - $action); - } - -} + extends PhabricatorModularTransactionType {} diff --git a/src/applications/people/xaction/PhabricatorUserUsernameTransaction.php b/src/applications/people/xaction/PhabricatorUserUsernameTransaction.php index b436b76716..338b296335 100644 --- a/src/applications/people/xaction/PhabricatorUserUsernameTransaction.php +++ b/src/applications/people/xaction/PhabricatorUserUsernameTransaction.php @@ -24,11 +24,6 @@ final class PhabricatorUserUsernameTransaction $old_username = $this->getOldValue(); $new_username = $this->getNewValue(); - $this->newUserLog(PhabricatorUserLog::ACTION_CHANGE_USERNAME) - ->setOldValue($old_username) - ->setNewValue($new_username) - ->save(); - // The SSH key cache currently includes usernames, so dirty it. See T12554 // for discussion. PhabricatorAuthSSHKeyQuery::deleteSSHKeyCache();