summaryrefslogtreecommitdiff
path: root/modules/recaptcha/controllers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-01-25 17:34:27 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-01-25 17:34:27 +0000
commit09e7f63d73a70083a4ee62e4db65e458e608aeaa (patch)
tree92c41a658298033839518ff9c60fc02ba21b88bd /modules/recaptcha/controllers
parent4bb2c53c8ff99a879aaffb90338a92d56cf65e28 (diff)
Removed all the complex code to locate the forms. Now the admin
screen just has the public and private keys and if the public key is provided a recaptcha box shows up which is used to validate the public private key pair.
Diffstat (limited to 'modules/recaptcha/controllers')
-rw-r--r--modules/recaptcha/controllers/admin_recaptcha.php14
1 files changed, 5 insertions, 9 deletions
diff --git a/modules/recaptcha/controllers/admin_recaptcha.php b/modules/recaptcha/controllers/admin_recaptcha.php
index 5fad6155..10938187 100644
--- a/modules/recaptcha/controllers/admin_recaptcha.php
+++ b/modules/recaptcha/controllers/admin_recaptcha.php
@@ -37,17 +37,12 @@ class Admin_Recaptcha_Controller extends Admin_Controller {
$new_public_key = $form->configure_recaptcha->public_key->value;
$new_private_key = $form->configure_recaptcha->private_key->value;
- $this->_update_key("public_key", $old_public_key, $new_public_key);
- $this->_update_key("private_key", $old_private_key, $new_private_key);
+ $update = $this->_update_key("public_key", $old_public_key, $new_public_key);
+ $update |= $this->_update_key("private_key", $old_private_key, $new_private_key);
- $add_recaptcha_to = array();
- foreach ($form->configure_recaptcha->activated_forms->value as $name) {
- $add_recaptcha_to[$name] = 1;
+ if ($update) {
+ message::success(t("Recaptcha Configured"));
}
- module::set_var("recaptcha", "form_list", serialize($add_recaptcha_to));
- log::success(t("Recaptcha active forms have changed."));
-
- message::success(t("Recaptcha Configured"));
recaptcha::check_config();
}
} else {
@@ -76,6 +71,7 @@ class Admin_Recaptcha_Controller extends Admin_Controller {
if ($changed) {
module::set_var("recaptcha", $type, $new_key);
}
+ return $changed;
}
public function gethtml($public_key, $error=null) {