aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/captcha
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2009-06-12 15:24:30 +0000
committerHenry Sudhof <kellanved@phpbb.com>2009-06-12 15:24:30 +0000
commit8c246032cc03ceceb8fcf24fe3802a1f8165de2f (patch)
treed71da920ca36770a80b172724db3fc4e9d671d6a /phpBB/includes/captcha
parent863d7a7614a09dac545d3c3201e67c3beddb3960 (diff)
downloadforums-8c246032cc03ceceb8fcf24fe3802a1f8165de2f.tar
forums-8c246032cc03ceceb8fcf24fe3802a1f8165de2f.tar.gz
forums-8c246032cc03ceceb8fcf24fe3802a1f8165de2f.tar.bz2
forums-8c246032cc03ceceb8fcf24fe3802a1f8165de2f.tar.xz
forums-8c246032cc03ceceb8fcf24fe3802a1f8165de2f.zip
fix preview in ACP
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9576 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/captcha')
-rw-r--r--phpBB/includes/captcha/plugins/captcha_abstract.php13
-rw-r--r--phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php39
2 files changed, 40 insertions, 12 deletions
diff --git a/phpBB/includes/captcha/plugins/captcha_abstract.php b/phpBB/includes/captcha/plugins/captcha_abstract.php
index 0666a3ca67..9e52762bc2 100644
--- a/phpBB/includes/captcha/plugins/captcha_abstract.php
+++ b/phpBB/includes/captcha/plugins/captcha_abstract.php
@@ -30,6 +30,7 @@ class phpbb_default_captcha
var $seed;
var $type;
var $solved = false;
+ var $captcha_vars = false;
function init($type)
{
@@ -106,10 +107,20 @@ class phpbb_default_captcha
$template->set_filenames(array(
'captcha_demo' => 'captcha_default_acp_demo.html')
);
+
+ $variables = '';
+
+ if (is_array($this->captcha_vars))
+ {
+ foreach ($this->captcha_vars as $captcha_var => $template_var)
+ {
+ $variables .= '&amp;' . rawurlencode($captcha_var) . '=' . request_var($captcha_var, (int) $config[$captcha_var]);
+ }
+ }
// acp_captcha has a delivery function; let's use it
$template->assign_vars(array(
- 'CONFIRM_IMAGE' => append_sid($phpbb_admin_path . 'index.' . $phpEx . '?captcha_demo=1&amp;mode=visual&amp;i=' . $id . '&amp;select_captcha=' . $this->get_class_name()),
+ 'CONFIRM_IMAGE' => append_sid($phpbb_admin_path . 'index.' . $phpEx . '?captcha_demo=1&amp;mode=visual&amp;i=' . $id . '&amp;select_captcha=' . $this->get_class_name()) . $variables,
'CONFIRM_ID' => $this->confirm_id,
));
diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php
index ac78b3d1c4..cd821f959e 100644
--- a/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php
+++ b/phpBB/includes/captcha/plugins/phpbb_captcha_gd_plugin.php
@@ -29,6 +29,18 @@ if (!class_exists('phpbb_default_captcha'))
*/
class phpbb_captcha_gd extends phpbb_default_captcha
{
+
+ var $captcha_vars = array(
+ 'captcha_gd_x_grid' => 'CAPTCHA_GD_X_GRID',
+ 'captcha_gd_y_grid' => 'CAPTCHA_GD_Y_GRID',
+ 'captcha_gd_foreground_noise' => 'CAPTCHA_GD_FOREGROUND_NOISE',
+ 'captcha_gd' => 'CAPTCHA_GD_PREVIEWED',
+ 'captcha_gd_wave' => 'CAPTCHA_GD_WAVE',
+ 'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE',
+ 'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS',
+
+ );
+
function phpbb_captcha_gd()
{
global $phpbb_root_path, $phpEx;
@@ -65,16 +77,7 @@ class phpbb_captcha_gd extends phpbb_default_captcha
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/board');
- $captcha_vars = array(
- 'captcha_gd_x_grid' => 'CAPTCHA_GD_X_GRID',
- 'captcha_gd_y_grid' => 'CAPTCHA_GD_Y_GRID',
- 'captcha_gd_foreground_noise' => 'CAPTCHA_GD_FOREGROUND_NOISE',
- 'captcha_gd' => 'CAPTCHA_GD_PREVIEWED',
- 'captcha_gd_wave' => 'CAPTCHA_GD_WAVE',
- 'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE',
- 'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS',
- );
$config_vars = array(
'enable_confirm' => 'REG_ENABLE',
@@ -92,7 +95,7 @@ class phpbb_captcha_gd extends phpbb_default_captcha
if ($submit && check_form_key($form_key))
{
- $captcha_vars = array_keys($captcha_vars);
+ $captcha_vars = array_keys($this->captcha_vars);
foreach ($captcha_vars as $captcha_var)
{
$value = request_var($captcha_var, 0);
@@ -109,7 +112,7 @@ class phpbb_captcha_gd extends phpbb_default_captcha
}
else
{
- foreach ($captcha_vars as $captcha_var => $template_var)
+ foreach ($this->captcha_vars as $captcha_var => $template_var)
{
$var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
$template->assign_var($template_var, $var);
@@ -121,6 +124,20 @@ class phpbb_captcha_gd extends phpbb_default_captcha
));
}
}
+
+ function execute_demo()
+ {
+ global $config;
+
+ $config_old = $config;
+ foreach ($this->captcha_vars as $captcha_var => $template_var)
+ {
+ $config[$captcha_var] = request_var($captcha_var, (int) $config[$captcha_var]);
+ }
+ parent::execute_demo();
+ $config = $config_old;
+ }
+
}
?> \ No newline at end of file