1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 01:10:58 +01:00

Slightly improve behavior for unverified + unapproved users

Summary: Ref T4140. Allow unapproved users to verify their email addresses. Currently, unapproved blocks email verification, but should not.

Test Plan: Clicked email verification link as an unapproved user, got email verified.

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T4140

Differential Revision: https://secure.phabricator.com/D7618
This commit is contained in:
epriestley 2013-11-21 12:58:58 -08:00
parent 67b8f9d35d
commit a518626a85
2 changed files with 16 additions and 0 deletions

View file

@ -11,6 +11,10 @@ final class PhabricatorAuthNeedsApprovalController
return false;
}
public function shouldRequireEnabledUser() {
return false;
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();

View file

@ -15,10 +15,22 @@ final class PhabricatorEmailVerificationController
return false;
}
public function shouldRequireEnabledUser() {
// Unapproved users are allowed to verify their email addresses. We'll kick
// disabled users out later.
return false;
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
if ($user->getIsDisabled()) {
// We allowed unapproved and disabled users to hit this controller, but
// want to kick out disabled users now.
return new Aphront400Response();
}
$email = id(new PhabricatorUserEmail())->loadOneWhere(
'userPHID = %s AND verificationCode = %s',
$user->getPHID(),