aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-08-08 18:02:03 +0200
committerTristan Darricau <github@nicofuma.fr>2014-08-11 01:15:49 +0200
commit160ff7b912243dc14d871b820213ddcd20dd06f4 (patch)
treed6d2f0e7fa38cc5944c7a0fa438c1deea2adc1c6 /phpBB/includes/acp
parente0d377bca70cff7846ba920a03b717aac1d208a4 (diff)
downloadforums-160ff7b912243dc14d871b820213ddcd20dd06f4.tar
forums-160ff7b912243dc14d871b820213ddcd20dd06f4.tar.gz
forums-160ff7b912243dc14d871b820213ddcd20dd06f4.tar.bz2
forums-160ff7b912243dc14d871b820213ddcd20dd06f4.tar.xz
forums-160ff7b912243dc14d871b820213ddcd20dd06f4.zip
[ticket/11854] Move captcha stuff to phpbb/ and use DI for plugins
PHPBB3-11854
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_captcha.php17
1 files changed, 8 insertions, 9 deletions
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php
index a625005bf8..099acf707b 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -26,12 +26,11 @@ class acp_captcha
function main($id, $mode)
{
global $db, $user, $auth, $template;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container;
$user->add_lang('acp/board');
- include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
- $factory = new phpbb_captcha_factory();
+ $factory = $phpbb_container->get('captchas.factory');
$captchas = $factory->get_captcha_types();
$selected = request_var('select_captcha', $config['captcha_plugin']);
@@ -47,7 +46,7 @@ class acp_captcha
// Delegate
if ($configure)
{
- $config_captcha = phpbb_captcha_factory::get_instance($selected);
+ $config_captcha = $factory->get_instance($selected);
$config_captcha->acp_page($id, $this);
}
else
@@ -79,11 +78,11 @@ class acp_captcha
// sanity check
if (isset($captchas['available'][$selected]))
{
- $old_captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
+ $old_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']);
+ $new_captcha = $factory->get_instance($config['captcha_plugin']);
$new_captcha->install();
add_log('admin', 'LOG_CONFIG_VISUAL');
@@ -114,7 +113,7 @@ class acp_captcha
$captcha_select .= '<option value="' . $value . '"' . $current . ' class="disabled-option">' . $user->lang($title) . '</option>';
}
- $demo_captcha = phpbb_captcha_factory::get_instance($selected);
+ $demo_captcha = $factory->get_instance($selected);
foreach ($config_vars as $config_var => $options)
{
@@ -137,9 +136,9 @@ class acp_captcha
*/
function deliver_demo($selected)
{
- global $db, $user, $config;
+ global $db, $user, $config, $phpbb_container;
- $captcha = phpbb_captcha_factory::get_instance($selected);
+ $captcha = $phpbb_container->get('captchas.factory')->get_instance($selected);
$captcha->init(CONFIRM_REG);
$captcha->execute_demo();