Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/editor/PhabricatorUserEditor.php
| Show First 20 Lines • Show All 694 Lines • ▼ Show 20 Lines | $application_email = id(new PhabricatorMetaMTAApplicationEmailQuery()) | ||||
| ->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
| ->withAddresses(array($email->getAddress())) | ->withAddresses(array($email->getAddress())) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| if ($application_email) { | if ($application_email) { | ||||
| throw new Exception($application_email->getInUseMessage()); | throw new Exception($application_email->getInUseMessage()); | ||||
| } | } | ||||
| } | } | ||||
| private function revokePasswordResetLinks(PhabricatorUser $user) { | public function revokePasswordResetLinks(PhabricatorUser $user) { | ||||
| // Revoke any outstanding password reset links. If an attacker compromises | // Revoke any outstanding password reset links. If an attacker compromises | ||||
| // an account, changes the email address, and sends themselves a password | // an account, changes the email address, and sends themselves a password | ||||
| // reset link, it could otherwise remain live for a short period of time | // reset link, it could otherwise remain live for a short period of time | ||||
| // and allow them to compromise the account again later. | // and allow them to compromise the account again later. | ||||
| PhabricatorAuthTemporaryToken::revokeTokens( | PhabricatorAuthTemporaryToken::revokeTokens( | ||||
| $user, | $user, | ||||
| array($user->getPHID()), | array($user->getPHID()), | ||||
| array( | array( | ||||
| PhabricatorAuthSessionEngine::ONETIME_TEMPORARY_TOKEN_TYPE, | PhabricatorAuthOneTimeLoginTemporaryTokenType::TOKENTYPE, | ||||
| PhabricatorAuthSessionEngine::PASSWORD_TEMPORARY_TOKEN_TYPE, | PhabricatorAuthPasswordResetTemporaryTokenType::TOKENTYPE, | ||||
| )); | )); | ||||
| } | } | ||||
| private function didVerifyEmail( | private function didVerifyEmail( | ||||
| PhabricatorUser $user, | PhabricatorUser $user, | ||||
| PhabricatorUserEmail $email) { | PhabricatorUserEmail $email) { | ||||
| $event_type = PhabricatorEventType::TYPE_AUTH_DIDVERIFYEMAIL; | $event_type = PhabricatorEventType::TYPE_AUTH_DIDVERIFYEMAIL; | ||||
| Show All 12 Lines | |||||