1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-20 15:53:14 +02:00

[ticket/11854] Fix the factory in \phpbb\auth\provider\db

PHPBB3-11854
This commit is contained in:
Tristan Darricau 2014-08-10 14:57:50 +02:00
parent 036a61a904
commit 2cbcf4bcbf
2 changed files with 13 additions and 2 deletions

View File

@ -14,6 +14,7 @@ services:
- @passwords.manager
- @request
- @user
- @service_container
- %core.root_path%
- %core.php_ext%
tags:

View File

@ -26,6 +26,13 @@ class db extends \phpbb\auth\provider\base
*/
protected $passwords_manager;
/**
* DI container
*
* @var \Symfony\Component\DependencyInjection\ContainerInterface
*/
protected $phpbb_container;
/**
* Database Authentication Constructor
*
@ -34,10 +41,11 @@ class db extends \phpbb\auth\provider\base
* @param \phpbb\passwords\manager $passwords_manager
* @param \phpbb\request\request $request
* @param \phpbb\user $user
* @param \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container DI container
* @param string $phpbb_root_path
* @param string $php_ext
*/
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request $request, \phpbb\user $user, $phpbb_root_path, $php_ext)
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\passwords\manager $passwords_manager, \phpbb\request\request $request, \phpbb\user $user, \Symfony\Component\DependencyInjection\ContainerInterface $phpbb_container, $phpbb_root_path, $php_ext)
{
$this->db = $db;
$this->config = $config;
@ -46,6 +54,7 @@ class db extends \phpbb\auth\provider\base
$this->user = $user;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->phpbb_container = $phpbb_container;
}
/**
@ -146,7 +155,8 @@ class db extends \phpbb\auth\provider\base
// Every auth module is able to define what to do by itself...
if ($show_captcha)
{
$captcha = $this->captchas_manager->get_instance($this->config['captcha_plugin']);
$captcha_factory = $this->phpbb_container->get('captcha.factory');
$captcha = $captcha_factory->get_instance($this->config['captcha_plugin']);
$captcha->init(CONFIRM_LOGIN);
$vc_response = $captcha->validate($row);
if ($vc_response)