@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorRecaptchaConfigOptions
4 extends PhabricatorApplicationConfigOptions {
5
6 public function getName() {
7 return pht('Integration with Recaptcha');
8 }
9
10 public function getDescription() {
11 return pht('Configure Recaptcha captchas.');
12 }
13
14 public function getIcon() {
15 return 'fa-recycle';
16 }
17
18 public function getGroup() {
19 return 'core';
20 }
21
22 public function getOptions() {
23
24 return array(
25 $this->newOption('recaptcha.enabled', 'bool', false)
26 ->setLocked(true)
27 ->setBoolOptions(
28 array(
29 pht('Enable Recaptcha'),
30 pht('Disable Recaptcha'),
31 ))
32 ->setSummary(pht('Enable captchas with Recaptcha.'))
33 ->setDescription(
34 pht(
35 'Enable recaptcha to require users solve captchas after a few '.
36 'failed login attempts. This hinders brute-force attacks against '.
37 'user passwords. For more information, see '.
38 'https://www.google.com/recaptcha')),
39 $this->newOption('recaptcha.public-key', 'string', null)
40 ->setLocked(true)
41 ->setDescription(
42 pht('Recaptcha public key, obtained by signing up for Recaptcha.')),
43 $this->newOption('recaptcha.private-key', 'string', null)
44 ->setHidden(true)
45 ->setDescription(
46 pht('Recaptcha private key, obtained by signing up for Recaptcha.')),
47 );
48 }
49
50}