1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Move Recaptcha config to PHP

Summary: Bring these over. Also sort the group list.

Test Plan: Viewed config.

Reviewers: btrahan, codeblock, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4338
This commit is contained in:
epriestley 2013-01-03 09:17:38 -08:00
parent 0ecfb75101
commit af604464d7
3 changed files with 42 additions and 0 deletions

View file

@ -1062,6 +1062,7 @@ phutil_register_library_map(array(
'PhabricatorPropertyListExample' => 'applications/uiexample/examples/PhabricatorPropertyListExample.php',
'PhabricatorPropertyListView' => 'view/layout/PhabricatorPropertyListView.php',
'PhabricatorQuery' => 'infrastructure/query/PhabricatorQuery.php',
'PhabricatorRecaptchaConfigOptions' => 'applications/config/option/PhabricatorRecaptchaConfigOptions.php',
'PhabricatorRedirectController' => 'applications/base/controller/PhabricatorRedirectController.php',
'PhabricatorRefreshCSRFController' => 'applications/auth/controller/PhabricatorRefreshCSRFController.php',
'PhabricatorRemarkupControl' => 'view/form/control/PhabricatorRemarkupControl.php',
@ -2380,6 +2381,7 @@ phutil_register_library_map(array(
'PhabricatorProjectUpdateController' => 'PhabricatorProjectController',
'PhabricatorPropertyListExample' => 'PhabricatorUIExample',
'PhabricatorPropertyListView' => 'AphrontView',
'PhabricatorRecaptchaConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorRedirectController' => 'PhabricatorController',
'PhabricatorRefreshCSRFController' => 'PhabricatorAuthController',
'PhabricatorRemarkupControl' => 'AphrontFormTextAreaControl',

View file

@ -46,6 +46,7 @@ final class PhabricatorConfigListController
assert_instances_of($groups, 'PhabricatorApplicationConfigOptions');
$list = new PhabricatorObjectItemListView();
$groups = msort($groups, 'getName');
foreach ($groups as $group) {
$item = id(new PhabricatorObjectItemView())
->setHeader($group->getName())

View file

@ -0,0 +1,39 @@
<?php
final class PhabricatorRecaptchaConfigOptions
extends PhabricatorApplicationConfigOptions {
public function getName() {
return pht("Integration with Recaptcha");
}
public function getDescription() {
return pht("Configure Recaptcha captchas.");
}
public function getOptions() {
return array(
$this->newOption('recaptcha.enabled', 'bool', false)
->setOptions(
array(
pht("Disable Recaptcha"),
pht("Enable Recaptcha"),
))
->setSummary(pht('Enable captchas with Recaptcha.'))
->setDescription(
pht(
"Enable recaptcha to require users solve captchas after a few ".
"failed login attempts. This hinders brute-force attacks against ".
"user passwords. For more information, see http://recaptcha.net/")),
$this->newOption('recaptcha.public-key', 'string', null)
->setDescription(
pht('Recaptcha public key, obtained by signing up for Recaptcha.')),
$this->newOption('recaptcha.private-key', 'string', null)
->setMasked(true)
->setDescription(
pht('Recaptcha private key, obtained by signing up for Recaptcha.')),
);
}
}