diff options
Diffstat (limited to 'modules/recaptcha/helpers/recaptcha.php')
-rw-r--r-- | modules/recaptcha/helpers/recaptcha.php | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/modules/recaptcha/helpers/recaptcha.php b/modules/recaptcha/helpers/recaptcha.php index 371b4746..1d40eb09 100644 --- a/modules/recaptcha/helpers/recaptcha.php +++ b/modules/recaptcha/helpers/recaptcha.php @@ -47,10 +47,6 @@ class recaptcha_Core { ->rules("required|length[40]"); $group->private_key->error_messages("invalid", t("The private key you provided is invalid.")); - $forms_list = self::_get_form_list(); - $group->checklist("activated_forms") - ->label(t("Recaptcha Activated on:")) - ->options($forms_list); $group->submit("")->value(t("Save")); $site_domain = urlencode(stripslashes($_SERVER["HTTP_HOST"])); $form->recaptcha_site = self::API_SERVER; @@ -97,7 +93,7 @@ class recaptcha_Core { return (count(self::$options) > 0 ? "<script type=\"text/javascript\">" . "var RecaptchaOptions = {lang:'$lang'};</script>" : "") . "<script type=\"text/javascript\" src=\"$server/challenge?k=" . - "{$pubkey}$errorpart \"></script>" . $noscript; + "{$pubkey}$errorpart \"></script>"; } /** @@ -178,32 +174,4 @@ class recaptcha_Core { $response = explode("\r\n\r\n", $response, 2); return $response; } - - function _get_form_list() { - $forms = unserialize(module::get_var("recaptcha", "form_list", "a:0:{}")); - Kohana::log("debug", print_r($forms, 1)); - $form_list = array(); - - // @todo Ignore administrative forms - foreach (array_merge(glob(APPPATH . "helpers/*"), glob(MODPATH . "*/helpers/*")) as $path) { - if (preg_match("#.*/(.*)/helpers/(.*).*\.php$#", $path, $matches)) { - Kohana::log("debug", "$path => $matches[1]"); - if ("recaptcha" == $matches[1]) { - continue; - } - $content = file_get_contents($path); - - $preg_match_all = preg_match_all("#.*\"(g([A-Za-z]*)Form)\"#m", - $content, $matches, PREG_SET_ORDER); - if ($preg_match_all !== false) { - foreach ($matches as $match) { - $label = trim(preg_replace("/([A-Z])/", " $1", $match[2])); - $form_id = $match[1]; - $form_list[$form_id] = array($label, !empty($forms[$form_id])); - } - } - } - } - return $form_list; - } } |