Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/PhabricatorAuthController.php
Show First 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | protected function loadAccountForRegistrationOrLinking($account_key) { | ||||
if (!phutil_hashes_are_identical($actual, $expect)) { | if (!phutil_hashes_are_identical($actual, $expect)) { | ||||
$response = $this->renderError( | $response = $this->renderError( | ||||
pht( | pht( | ||||
'Your browser submitted a different registration key than the one '. | 'Your browser submitted a different registration key than the one '. | ||||
'associated with this account. You may need to clear your cookies.')); | 'associated with this account. You may need to clear your cookies.')); | ||||
return array($account, $provider, $response); | return array($account, $provider, $response); | ||||
} | } | ||||
$other_account = id(new PhabricatorExternalAccount())->loadAllWhere( | |||||
'accountType = %s AND accountDomain = %s AND accountID = %s | |||||
AND id != %d', | |||||
$account->getAccountType(), | |||||
$account->getAccountDomain(), | |||||
$account->getAccountID(), | |||||
$account->getID()); | |||||
if ($other_account) { | |||||
$response = $this->renderError( | |||||
pht( | |||||
'The account you are attempting to register with already belongs '. | |||||
'to another user.')); | |||||
return array($account, $provider, $response); | |||||
} | |||||
$config = $account->getProviderConfig(); | $config = $account->getProviderConfig(); | ||||
if (!$config->getIsEnabled()) { | if (!$config->getIsEnabled()) { | ||||
$response = $this->renderError( | $response = $this->renderError( | ||||
pht( | pht( | ||||
'The account you are attempting to register with uses a disabled '. | 'The account you are attempting to register with uses a disabled '. | ||||
'authentication provider ("%s"). An administrator may have '. | 'authentication provider ("%s"). An administrator may have '. | ||||
'recently disabled this provider.', | 'recently disabled this provider.', | ||||
$config->getDisplayName())); | $config->getDisplayName())); | ||||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |