Page MenuHomePhabricator

D11877.diff
No OneTemporary

D11877.diff

diff --git a/src/applications/auth/controller/PhabricatorAuthRegisterController.php b/src/applications/auth/controller/PhabricatorAuthRegisterController.php
--- a/src/applications/auth/controller/PhabricatorAuthRegisterController.php
+++ b/src/applications/auth/controller/PhabricatorAuthRegisterController.php
@@ -181,6 +181,13 @@
$e_password = true;
$e_captcha = true;
+ $skip_captcha = false;
+ if ($invite) {
+ // If the user is accepting an invite, assume they're trustworthy enough
+ // that we don't need to CAPTCHA them.
+ $skip_captcha = true;
+ }
+
$min_len = PhabricatorEnv::getEnvConfig('account.minimum-password-length');
$min_len = (int)$min_len;
@@ -193,7 +200,7 @@
if (($request->isFormPost() || !$can_edit_anything) && !$from_invite) {
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
- if ($must_set_password) {
+ if ($must_set_password && !$skip_captcha) {
$e_captcha = pht('Again');
$captcha_ok = AphrontFormRecaptchaControl::processCaptcha($request);
@@ -464,7 +471,7 @@
->setError($e_email));
}
- if ($must_set_password) {
+ if ($must_set_password && !$skip_captcha) {
$form->appendChild(
id(new AphrontFormRecaptchaControl())
->setLabel(pht('Captcha'))

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 12:05 PM (5 d, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7702011
Default Alt Text
D11877.diff (1 KB)

Event Timeline