Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/editor/PhabricatorUserEditor.php
| Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | $user->openTransaction(); | ||||
| $user->killTransaction(); | $user->killTransaction(); | ||||
| throw $ex; | throw $ex; | ||||
| } | } | ||||
| if ($is_reassign) { | if ($is_reassign) { | ||||
| $log = PhabricatorUserLog::initializeNewLog( | $log = PhabricatorUserLog::initializeNewLog( | ||||
| $this->requireActor(), | $this->requireActor(), | ||||
| $user->getPHID(), | $user->getPHID(), | ||||
| PhabricatorUserLog::ACTION_EMAIL_REASSIGN); | PhabricatorReassignEmailUserLogType::LOGTYPE); | ||||
| $log->setNewValue($email->getAddress()); | $log->setNewValue($email->getAddress()); | ||||
| $log->save(); | $log->save(); | ||||
| } | } | ||||
| $user->saveTransaction(); | $user->saveTransaction(); | ||||
| if ($email->getIsVerified()) { | if ($email->getIsVerified()) { | ||||
| $this->didVerifyEmail($user, $email); | $this->didVerifyEmail($user, $email); | ||||
| ▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | $user->openTransaction(); | ||||
| $user->killTransaction(); | $user->killTransaction(); | ||||
| throw $ex; | throw $ex; | ||||
| } | } | ||||
| $log = PhabricatorUserLog::initializeNewLog( | $log = PhabricatorUserLog::initializeNewLog( | ||||
| $actor, | $actor, | ||||
| $user->getPHID(), | $user->getPHID(), | ||||
| PhabricatorUserLog::ACTION_EMAIL_ADD); | PhabricatorAddEmailUserLogType::LOGTYPE); | ||||
| $log->setNewValue($email->getAddress()); | $log->setNewValue($email->getAddress()); | ||||
| $log->save(); | $log->save(); | ||||
| $user->endWriteLocking(); | $user->endWriteLocking(); | ||||
| $user->saveTransaction(); | $user->saveTransaction(); | ||||
| // Try and match this new address against unclaimed `RepositoryIdentity`s | // Try and match this new address against unclaimed `RepositoryIdentity`s | ||||
| PhabricatorWorker::scheduleTask( | PhabricatorWorker::scheduleTask( | ||||
| Show All 34 Lines | $user->openTransaction(); | ||||
| throw new Exception(pht('Email not owned by user!')); | throw new Exception(pht('Email not owned by user!')); | ||||
| } | } | ||||
| $email->delete(); | $email->delete(); | ||||
| $log = PhabricatorUserLog::initializeNewLog( | $log = PhabricatorUserLog::initializeNewLog( | ||||
| $actor, | $actor, | ||||
| $user->getPHID(), | $user->getPHID(), | ||||
| PhabricatorUserLog::ACTION_EMAIL_REMOVE); | PhabricatorRemoveEmailUserLogType::LOGTYPE); | ||||
| $log->setOldValue($email->getAddress()); | $log->setOldValue($email->getAddress()); | ||||
| $log->save(); | $log->save(); | ||||
| $user->endWriteLocking(); | $user->endWriteLocking(); | ||||
| $user->saveTransaction(); | $user->saveTransaction(); | ||||
| $this->revokePasswordResetLinks($user); | $this->revokePasswordResetLinks($user); | ||||
| ▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | $user->openTransaction(); | ||||
| if (!$user->getIsEmailVerified()) { | if (!$user->getIsEmailVerified()) { | ||||
| $user->setIsEmailVerified(1); | $user->setIsEmailVerified(1); | ||||
| $user->save(); | $user->save(); | ||||
| } | } | ||||
| $log = PhabricatorUserLog::initializeNewLog( | $log = PhabricatorUserLog::initializeNewLog( | ||||
| $actor, | $actor, | ||||
| $user->getPHID(), | $user->getPHID(), | ||||
| PhabricatorUserLog::ACTION_EMAIL_PRIMARY); | PhabricatorPrimaryEmailUserLogType::LOGTYPE); | ||||
| $log->setOldValue($old_primary ? $old_primary->getAddress() : null); | $log->setOldValue($old_primary ? $old_primary->getAddress() : null); | ||||
| $log->setNewValue($email->getAddress()); | $log->setNewValue($email->getAddress()); | ||||
| $log->save(); | $log->save(); | ||||
| $user->endWriteLocking(); | $user->endWriteLocking(); | ||||
| $user->saveTransaction(); | $user->saveTransaction(); | ||||
| ▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | $user->openTransaction(); | ||||
| if (!$email->getIsVerified()) { | if (!$email->getIsVerified()) { | ||||
| $email->setIsVerified(1); | $email->setIsVerified(1); | ||||
| $email->save(); | $email->save(); | ||||
| $log = PhabricatorUserLog::initializeNewLog( | $log = PhabricatorUserLog::initializeNewLog( | ||||
| $actor, | $actor, | ||||
| $user->getPHID(), | $user->getPHID(), | ||||
| PhabricatorUserLog::ACTION_EMAIL_VERIFY); | PhabricatorVerifyEmailUserLogType::LOGTYPE); | ||||
| $log->setNewValue($email->getAddress()); | $log->setNewValue($email->getAddress()); | ||||
| $log->save(); | $log->save(); | ||||
| } | } | ||||
| if (!$user->getIsEmailVerified()) { | if (!$user->getIsEmailVerified()) { | ||||
| // If the user just verified their primary email address, mark their | // If the user just verified their primary email address, mark their | ||||
| // account as email verified. | // account as email verified. | ||||
| $user_primary = $user->loadPrimaryEmail(); | $user_primary = $user->loadPrimaryEmail(); | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | $user->openTransaction(); | ||||
| } | } | ||||
| $email->setUserPHID($user->getPHID()); | $email->setUserPHID($user->getPHID()); | ||||
| $email->save(); | $email->save(); | ||||
| $log = PhabricatorUserLog::initializeNewLog( | $log = PhabricatorUserLog::initializeNewLog( | ||||
| $actor, | $actor, | ||||
| $user->getPHID(), | $user->getPHID(), | ||||
| PhabricatorUserLog::ACTION_EMAIL_REASSIGN); | PhabricatorReassignEmailUserLogType::LOGTYPE); | ||||
| $log->setNewValue($email->getAddress()); | $log->setNewValue($email->getAddress()); | ||||
| $log->save(); | $log->save(); | ||||
| } | } | ||||
| $user->endWriteLocking(); | $user->endWriteLocking(); | ||||
| $user->saveTransaction(); | $user->saveTransaction(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||