Differential D9431 Diff 22523 src/applications/auth/controller/PhabricatorAuthRegisterController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/PhabricatorAuthRegisterController.php
| Show First 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | public function processRequest() { | ||||
| if ($request->isFormPost() || !$can_edit_anything) { | if ($request->isFormPost() || !$can_edit_anything) { | ||||
| $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | ||||
| if ($must_set_password) { | if ($must_set_password) { | ||||
| $e_captcha = pht('Again'); | $e_captcha = pht('Again'); | ||||
| $captcha_ok = AphrontFormRecaptchaControl::processCaptcha($request); | $captcha_ok = AphrontFormRecaptchaControl::processCaptcha($request); | ||||
| if (!$captcha_ok) { | if (!$captcha_ok) { | ||||
| $errors[] = pht("Captcha response is incorrect, try again."); | $errors[] = pht('Captcha response is incorrect, try again.'); | ||||
| $e_captcha = pht('Invalid'); | $e_captcha = pht('Invalid'); | ||||
| } | } | ||||
| } | } | ||||
| if ($can_edit_username) { | if ($can_edit_username) { | ||||
| $value_username = $request->getStr('username'); | $value_username = $request->getStr('username'); | ||||
| if (!strlen($value_username)) { | if (!strlen($value_username)) { | ||||
| $e_username = pht('Required'); | $e_username = pht('Required'); | ||||
| ▲ Show 20 Lines • Show All 299 Lines • ▼ Show 20 Lines | foreach ($providers as $key => $candidate_provider) { | ||||
| if (!$candidate_provider->isDefaultRegistrationProvider()) { | if (!$candidate_provider->isDefaultRegistrationProvider()) { | ||||
| unset($providers[$key]); | unset($providers[$key]); | ||||
| } | } | ||||
| } | } | ||||
| if (!$providers) { | if (!$providers) { | ||||
| $response = $this->renderError( | $response = $this->renderError( | ||||
| pht( | pht( | ||||
| "There are no configured default registration providers.")); | 'There are no configured default registration providers.')); | ||||
| return array($account, $provider, $response); | return array($account, $provider, $response); | ||||
| } else if (count($providers) > 1) { | } else if (count($providers) > 1) { | ||||
| $response = $this->renderError( | $response = $this->renderError( | ||||
| pht( | pht( | ||||
| "There are too many configured default registration providers.")); | 'There are too many configured default registration providers.')); | ||||
| return array($account, $provider, $response); | return array($account, $provider, $response); | ||||
| } | } | ||||
| $provider = head($providers); | $provider = head($providers); | ||||
| $account = $provider->getDefaultExternalAccount(); | $account = $provider->getDefaultExternalAccount(); | ||||
| return array($account, $provider, $response); | return array($account, $provider, $response); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines | |||||