mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 05:50:55 +01:00
Allow add_user.php without password auth
Summary: Fixes T1527. Test Plan: Generated e-mail login URL. Enabled password auth, visited the URL, saw Change Password. Disabled password auth, enabled Facebook auth, visited the URL, saw Link Facebook account. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T1527 Differential Revision: https://secure.phabricator.com/D6006
This commit is contained in:
parent
50bc33fc1c
commit
28858df713
1 changed files with 10 additions and 7 deletions
|
@ -16,10 +16,6 @@ final class PhabricatorEmailTokenController
|
|||
public function processRequest() {
|
||||
$request = $this->getRequest();
|
||||
|
||||
if (!PhabricatorEnv::getEnvConfig('auth.password-auth-enabled')) {
|
||||
return new Aphront400Response();
|
||||
}
|
||||
|
||||
$token = $this->token;
|
||||
$email = $request->getStr('email');
|
||||
|
||||
|
@ -81,15 +77,22 @@ final class PhabricatorEmailTokenController
|
|||
$request->setCookie('phusr', $target_user->getUsername());
|
||||
$request->setCookie('phsid', $session_key);
|
||||
|
||||
if (PhabricatorEnv::getEnvConfig('account.editable')) {
|
||||
$next = '/';
|
||||
if (!PhabricatorEnv::getEnvConfig('auth.password-auth-enabled')) {
|
||||
$panels = id(new PhabricatorSettingsPanelOAuth())->buildPanels();
|
||||
foreach ($panels as $panel) {
|
||||
if ($panel->isEnabled()) {
|
||||
$next = $panel->getPanelURI();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (PhabricatorEnv::getEnvConfig('account.editable')) {
|
||||
$next = (string)id(new PhutilURI('/settings/panel/password/'))
|
||||
->setQueryParams(
|
||||
array(
|
||||
'token' => $token,
|
||||
'email' => $email,
|
||||
));
|
||||
} else {
|
||||
$next = '/';
|
||||
}
|
||||
|
||||
$uri = new PhutilURI('/login/validate/');
|
||||
|
|
Loading…
Reference in a new issue