mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-08 00:25:19 +02:00
Oh right. PHP4
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9581 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
cf3aad78cf
commit
11dc410633
@ -43,7 +43,7 @@ class acp_captcha
|
|||||||
// Delegate
|
// Delegate
|
||||||
if ($configure)
|
if ($configure)
|
||||||
{
|
{
|
||||||
$config_captcha = phpbb_captcha_factory::get_instance($selected);
|
$config_captcha =& phpbb_captcha_factory::get_instance($selected);
|
||||||
$config_captcha->acp_page($id, $this);
|
$config_captcha->acp_page($id, $this);
|
||||||
add_log('admin', 'LOG_CONFIG_VISUAL');
|
add_log('admin', 'LOG_CONFIG_VISUAL');
|
||||||
}
|
}
|
||||||
@ -78,11 +78,11 @@ class acp_captcha
|
|||||||
// sanity check
|
// sanity check
|
||||||
if (isset($captchas['available'][$selected]))
|
if (isset($captchas['available'][$selected]))
|
||||||
{
|
{
|
||||||
$old_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
$old_captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
||||||
$old_captcha->uninstall();
|
$old_captcha->uninstall();
|
||||||
|
|
||||||
set_config('captcha_plugin', $selected);
|
set_config('captcha_plugin', $selected);
|
||||||
$new_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
$new_captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
||||||
$new_captcha->install();
|
$new_captcha->install();
|
||||||
|
|
||||||
add_log('admin', 'LOG_CONFIG_VISUAL');
|
add_log('admin', 'LOG_CONFIG_VISUAL');
|
||||||
@ -113,7 +113,7 @@ class acp_captcha
|
|||||||
$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);
|
$demo_captcha =& phpbb_captcha_factory::get_instance($selected);
|
||||||
|
|
||||||
foreach ($config_vars as $config_var => $template_var)
|
foreach ($config_vars as $config_var => $template_var)
|
||||||
{
|
{
|
||||||
@ -135,7 +135,7 @@ class acp_captcha
|
|||||||
{
|
{
|
||||||
global $db, $user, $config;
|
global $db, $user, $config;
|
||||||
|
|
||||||
$captcha = phpbb_captcha_factory::get_instance($selected);
|
$captcha =& phpbb_captcha_factory::get_instance($selected);
|
||||||
$captcha->init(CONFIRM_REG);
|
$captcha->init(CONFIRM_REG);
|
||||||
$captcha->execute_demo();
|
$captcha->execute_demo();
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ function login_db(&$username, &$password)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
||||||
$captcha->init(CONFIRM_LOGIN);
|
$captcha->init(CONFIRM_LOGIN);
|
||||||
$vc_response = $captcha->validate();
|
$vc_response = $captcha->validate();
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ class phpbb_captcha_factory
|
|||||||
/**
|
/**
|
||||||
* return an instance of class $name in file $name_plugin.php
|
* return an instance of class $name in file $name_plugin.php
|
||||||
*/
|
*/
|
||||||
function get_instance($name)
|
function &get_instance($name)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpEx;
|
global $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
@ -35,7 +35,8 @@ class phpbb_captcha_factory
|
|||||||
{
|
{
|
||||||
include($phpbb_root_path . "includes/captcha/plugins/{$name}_plugin." . $phpEx);
|
include($phpbb_root_path . "includes/captcha/plugins/{$name}_plugin." . $phpEx);
|
||||||
}
|
}
|
||||||
return call_user_func(array($name, 'get_instance'));
|
$instance =& call_user_func(array($name, 'get_instance'));
|
||||||
|
return $instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,6 +34,7 @@ class captcha
|
|||||||
function execute($code, $seed)
|
function execute($code, $seed)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
srand($seed);
|
srand($seed);
|
||||||
//mt_srand($seed);
|
//mt_srand($seed);
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ class phpbb_default_captcha
|
|||||||
{
|
{
|
||||||
$hidden_fields = array();
|
$hidden_fields = array();
|
||||||
|
|
||||||
// this is required for postig.php - otherwise we would forget about the captcha being already solved
|
// this is required for posting.php - otherwise we would forget about the captcha being already solved
|
||||||
if ($this->solved)
|
if ($this->solved)
|
||||||
{
|
{
|
||||||
$hidden_fields['confirm_code'] = $this->confirm_code;
|
$hidden_fields['confirm_code'] = $this->confirm_code;
|
||||||
|
@ -51,9 +51,10 @@ class phpbb_captcha_gd extends phpbb_default_captcha
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_instance()
|
function &get_instance()
|
||||||
{
|
{
|
||||||
return new phpbb_captcha_gd();
|
$instance =& new phpbb_captcha_gd();
|
||||||
|
return $instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_available()
|
function is_available()
|
||||||
|
@ -40,9 +40,10 @@ class phpbb_captcha_nogd extends phpbb_default_captcha
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_instance()
|
function &get_instance()
|
||||||
{
|
{
|
||||||
return new phpbb_captcha_nogd();
|
$instance =& new phpbb_captcha_nogd();
|
||||||
|
return $instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_available()
|
function is_available()
|
||||||
|
@ -42,9 +42,10 @@ class phpbb_recaptcha extends phpbb_default_captcha
|
|||||||
$this->response = request_var('recaptcha_response_field', '');
|
$this->response = request_var('recaptcha_response_field', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_instance()
|
function &get_instance()
|
||||||
{
|
{
|
||||||
return new phpbb_recaptcha();
|
$instance =& new phpbb_recaptcha();
|
||||||
|
return $instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_available()
|
function is_available()
|
||||||
|
@ -56,7 +56,7 @@ class ucp_register
|
|||||||
if ($config['enable_confirm'])
|
if ($config['enable_confirm'])
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
|
include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
|
||||||
$captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
||||||
$captcha->init(CONFIRM_REG);
|
$captcha->init(CONFIRM_REG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ $current_time = time();
|
|||||||
if ($config['enable_post_confirm'] && !$user->data['is_registered'])
|
if ($config['enable_post_confirm'] && !$user->data['is_registered'])
|
||||||
{
|
{
|
||||||
include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
|
include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
|
||||||
$captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
||||||
$captcha->init(CONFIRM_POST);
|
$captcha->init(CONFIRM_POST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user