summaryrefslogtreecommitdiff
path: root/modules/recaptcha/controllers/admin_recaptcha.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-01-25 16:35:25 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-01-25 16:35:25 +0000
commit4bb2c53c8ff99a879aaffb90338a92d56cf65e28 (patch)
treee2dac1bee54b8ede2a8696503fd1114fe30e5b35 /modules/recaptcha/controllers/admin_recaptcha.php
parent1633001d7fddbb5fd5baa0a774041e001d8e7723 (diff)
Added the ability to identify and present the defined forms to the
adminstrator. The forms are presented as a checklist, I would have preferred a selection list, but Forge doesn't have one. The generated html to contain the recaptcha challenge is defined as <ul> as that was the only way to force itto line up.
Diffstat (limited to 'modules/recaptcha/controllers/admin_recaptcha.php')
-rw-r--r--modules/recaptcha/controllers/admin_recaptcha.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/modules/recaptcha/controllers/admin_recaptcha.php b/modules/recaptcha/controllers/admin_recaptcha.php
index 0f05a82b..5fad6155 100644
--- a/modules/recaptcha/controllers/admin_recaptcha.php
+++ b/modules/recaptcha/controllers/admin_recaptcha.php
@@ -37,11 +37,17 @@ 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;
- $updated = false;
- if ($this->_update_key("public_key", $old_public_key, $new_public_key) ||
- $this->_update_key("private_key", $old_private_key, $new_private_key)) {
- message::success(t("Recaptcha Configured"));
+ $this->_update_key("public_key", $old_public_key, $new_public_key);
+ $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;
}
+ 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 {
@@ -68,9 +74,8 @@ class Admin_Recaptcha_Controller extends Admin_Controller {
$changed = false;
}
if ($changed) {
- module::set_var("recaptcha", $key, $new_key);
+ module::set_var("recaptcha", $type, $new_key);
}
-
}
public function gethtml($public_key, $error=null) {