1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18:
19: class XcaptchaRecaptcha extends Xcaptcha
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: {
34: $xoops = Xoops::getInstance();
35: $default_lang = array_search(ucfirst($xoops->getConfig('language')), $this->getLanguages());
36: $default_lang = (!$default_lang) ? 'en' : $default_lang;
37:
38: $system = System::getInstance();
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:
48: return $config;
49: }
50:
51: function getThemes()
52: {
53: return array(
54: 'red' => 'RED (default theme)',
55: 'white' => 'WHITE',
56: 'blackglass' => 'BLACKGLASS',
57: 'clean' => 'CLEAN',);
58: }
59:
60: function getLanguages()
61: {
62: return array(
63: 'en' => 'English',
64: 'nl' => 'Dutch',
65: 'fr' => 'French',
66: 'de' => 'German',
67: 'it' => 'Italian',
68: 'pt' => 'Portuguese',
69: 'ru' => 'Russian',
70: 'es' => 'Spanish',
71: 'tr' => 'Turkish',);
72: }
73: }
74: