diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2009-06-07 11:34:01 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2009-06-07 11:34:01 +0000 |
commit | a539fca62b10f53a5f5dadf07f9ab07340fdabf9 (patch) | |
tree | 28f4ab59d1564aefd30709748ce245f993be5f7c /phpBB/includes/acp/acp_captcha.php | |
parent | 711f482cb62070ab2340aa27c736a85cc6e8c518 (diff) | |
download | forums-a539fca62b10f53a5f5dadf07f9ab07340fdabf9.tar forums-a539fca62b10f53a5f5dadf07f9ab07340fdabf9.tar.gz forums-a539fca62b10f53a5f5dadf07f9ab07340fdabf9.tar.bz2 forums-a539fca62b10f53a5f5dadf07f9ab07340fdabf9.tar.xz forums-a539fca62b10f53a5f5dadf07f9ab07340fdabf9.zip |
some corrections, only very minor things.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9554 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_captcha.php')
-rw-r--r-- | phpBB/includes/acp/acp_captcha.php | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index ed2ccf6ccc..7c7a5acc9f 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -10,8 +10,6 @@ /** * @ignore */ - - if (!defined('IN_PHPBB')) { exit; @@ -35,13 +33,13 @@ class acp_captcha $selected = request_var('select_captcha', $config['captcha_plugin']); $configure = request_var('configure', false); - + // Oh, they are just here for the view if (isset($_GET['captcha_demo'])) { $this->deliver_demo($selected); } - + // Delegate if ($configure) { @@ -52,6 +50,7 @@ class acp_captcha else { $captchas = phpbb_captcha_factory::get_captcha_types(); + $config_vars = array( 'enable_confirm' => 'REG_ENABLE', 'enable_post_confirm' => 'POST_ENABLE', @@ -68,10 +67,12 @@ class acp_captcha if ($submit && check_form_key($form_key)) { $config_vars = array_keys($config_vars); + foreach ($config_vars as $config_var) { set_config($config_var, request_var($config_var, false)); } + if ($selected !== $config['captcha_plugin']) { // sanity check @@ -79,9 +80,11 @@ class acp_captcha { $old_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']); $old_captcha->uninstall(); + set_config('captcha_plugin', $selected); $new_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']); - $old_captcha->install(); + $new_captcha->install(); + add_log('admin', 'LOG_CONFIG_VISUAL'); } else @@ -103,14 +106,15 @@ class acp_captcha $current = ($selected !== false && $value == $selected) ? ' selected="selected"' : ''; $captcha_select .= '<option value="' . $value . '"' . $current . '>' . $user->lang[$title] . '</option>'; } + foreach ($captchas['unavailable'] as $value => $title) { $current = ($selected !== false && $value == $selected) ? ' selected="selected"' : ''; - $captcha_select .= '<option value="' . $value . '"' . $current . ' class="disabled-option" >' . $user->lang[$title] . '</option>'; + $captcha_select .= '<option value="' . $value . '"' . $current . ' class="disabled-option">' . $user->lang[$title] . '</option>'; } $demo_captcha = phpbb_captcha_factory::get_instance($selected); - + foreach ($config_vars as $config_var => $template_var) { $template->assign_var($template_var, (isset($_REQUEST[$config_var])) ? request_var($config_var, '') : $config[$config_var]) ; @@ -121,28 +125,23 @@ class acp_captcha 'CAPTCHA_SELECT' => $captcha_select, )); } - } } - - + /** * Entry point for delivering image CAPTCHAs in the ACP. */ function deliver_demo($selected) { global $db, $user, $config; - + $captcha = phpbb_captcha_factory::get_instance($selected); $captcha->init(CONFIRM_REG); $captcha->execute_demo(); + garbage_collection(); exit_handler(); } - - - - } ?>
\ No newline at end of file |