set(Setting::CaptchaProvider, 'none'); // Keys are left where they are: this is a way back in, not a way // to lose a credential somebody will want again in ten minutes. Captcha::forgetDisplayCache(); CaptchaVerifier::forgetOutage(); // Managed keys are not this setting. Captcha::resolve() reaches // them from config and returns before it ever looks at // Setting::CaptchaProvider, so on an installation using them the // write above changed a value nothing reads. Saying "CAPTCHA is // off" there would be false, and false in the worst direction: an // operator who is still being challenged would stop looking, // having just been told the thing challenging them is gone. // // Read after the write rather than before it, because the write is // what makes the answer meaningful — if this still resolves to // something, the something is not ours to switch off. if ($captcha->managedKeysSelected()) { $this->warn('Nothing changed. This installation uses CAPTCHA keys supplied by the platform, and those do not come from the setting this command writes.'); $this->line('Set PROJECTSEND_CAPTCHA_DISABLED=true in the environment and restart to switch it off.'); return self::SUCCESS; } $this->info('CAPTCHA is off. Your keys are still stored — switch it back on at /system/settings/captcha.'); return self::SUCCESS; } }