-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.php
38 lines (34 loc) · 1.14 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require_once INCLUDE_DIR . 'class.plugin.php';
class reCaptchaConfig extends PluginConfig {
function getOptions() {
return array(
'_' => new SectionBreakField(array(
'label' => 'reCaptcha Configuration',
'hint' => 'Requires separate registration for a key set'
)),
'public' => new TextboxField(array(
'required' => true,
'configuration'=>array('length'=>64, 'size'=>40),
'label' => 'Public Key',
)),
'private' => new TextboxField(array(
'widget' => 'PasswordWidget',
'required' => false,
'configuration'=>array('length'=>64, 'size'=>40),
'label' => 'Private Key',
)),
);
}
function pre_save($config, &$errors) {
// Todo: verify key
if (!function_exists('curl_init')) {
Messages::error('CURL extension is required');
return false;
}
global $msg;
if (!$errors)
$msg = 'Successfully updated reCAPTCHA settings';
return true;
}
}