XOOPS  2.6.0
recaptcha.php
Go to the documentation of this file.
1 <?php
20 {
21  public $config = array();
22 
23  public $plugin;
24 
25  function __construct()
26  {
27  $this->xcaptcha_handler = Xcaptcha::getInstance();
28  $this->config = $this->xcaptcha_handler->loadConfig('recaptcha');
29  $this->plugin = 'recaptcha';
30  }
31 
32  function VerifyData()
33  {
35  $default_lang = array_search(ucfirst($xoops->getConfig('language')), $this->getLanguages());
36  $default_lang = (!$default_lang) ? 'en' : $default_lang;
37 
39  $config = array();
40  $_POST['private_key'] = $system->CleanVars($_POST, 'private_key', 'Your private key', 'string');
41  $_POST['public_key'] = $system->CleanVars($_POST, 'public_key', 'Your public key', 'string');
42  $_POST['theme'] = $system->CleanVars($_POST, 'theme', 'red', 'string');
43  $_POST['lang'] = $system->CleanVars($_POST, 'lang', $default_lang, 'string');
44  foreach (array_keys($this->config) as $key) {
45  $config[$key] = $_POST[$key];
46  }
47  return $config;
48  }
49 
50  function getThemes()
51  {
52  return array(
53  'red' => 'RED (default theme)', 'white' => 'WHITE', 'blackglass' => 'BLACKGLASS', 'clean' => 'CLEAN',
54  );
55  }
56 
57  function getLanguages()
58  {
59  return array(
60  'en' => 'English', 'nl' => 'Dutch', 'fr' => 'French', 'de' => 'German', 'it' => 'Italian', 'pt' => 'Portuguese',
61  'ru' => 'Russian', 'es' => 'Spanish', 'tr' => 'Turkish',
62  );
63  }
64 }
static getInstance()
Definition: system.php:46
static getInstance()
Definition: Xoops.php:160
$xoops
Definition: admin.php:25
static getInstance()
Definition: xcaptcha.php:40