"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "core-bundle/src/DependencyInjection/Security/ContaoLoginFactory.php" between
contao-4.9.11.tar.gz and contao-4.9.12.tar.gz

About: Contao (fka TYPOlight) is a content management system (CMS). Long-term support (LTS).

ContaoLoginFactory.php  (contao-4.9.11):ContaoLoginFactory.php  (contao-4.9.12)
skipping to change at line 17 skipping to change at line 17
* *
* (c) Leo Feyer * (c) Leo Feyer
* *
* @license LGPL-3.0-or-later * @license LGPL-3.0-or-later
*/ */
namespace Contao\CoreBundle\DependencyInjection\Security; namespace Contao\CoreBundle\DependencyInjection\Security;
use Contao\CoreBundle\Security\TwoFactor\BackupCodeManager; use Contao\CoreBundle\Security\TwoFactor\BackupCodeManager;
use Scheb\TwoFactorBundle\DependencyInjection\Factory\Security\TwoFactorFactory; use Scheb\TwoFactorBundle\DependencyInjection\Factory\Security\TwoFactorFactory;
use Scheb\TwoFactorBundle\Security\TwoFactor\TwoFactorFirewallConfig;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractF actory; use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractF actory;
use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Reference;
class ContaoLoginFactory extends AbstractFactory class ContaoLoginFactory extends AbstractFactory
{ {
public function __construct() public function __construct()
{ {
$this->options = ['require_previous_session' => false]; $this->options = ['require_previous_session' => false];
$this->defaultSuccessHandlerOptions = []; $this->defaultSuccessHandlerOptions = [];
$this->defaultFailureHandlerOptions = []; $this->defaultFailureHandlerOptions = [];
} }
skipping to change at line 56 skipping to change at line 54
public function getKey(): string public function getKey(): string
{ {
return 'contao-login'; return 'contao-login';
} }
protected function createAuthProvider(ContainerBuilder $container, $id, $con fig, $userProviderId): string protected function createAuthProvider(ContainerBuilder $container, $id, $con fig, $userProviderId): string
{ {
$twoFactorProviderId = TwoFactorFactory::PROVIDER_ID_PREFIX.$id; $twoFactorProviderId = TwoFactorFactory::PROVIDER_ID_PREFIX.$id;
$twoFactorFirewallConfigId = 'contao.security.two_factor_firewall_config .'.$id; $twoFactorFirewallConfigId = 'contao.security.two_factor_firewall_config .'.$id;
$twoFactorFirewallConfig = new Definition(TwoFactorFirewallConfig::class , [$config, $id, null]);
$container $container
->setDefinition($twoFactorFirewallConfigId, $twoFactorFirewallConfig ->setDefinition($twoFactorFirewallConfigId, new ChildDefinition(TwoF
) actorFactory::FIREWALL_CONFIG_DEFINITION_ID))
->replaceArgument(2, new Reference('security.http_utils')) ->replaceArgument(0, $config)
->replaceArgument(1, $id)
; ;
$container $container
->setDefinition($twoFactorProviderId, new ChildDefinition(TwoFactorF actory::PROVIDER_DEFINITION_ID)) ->setDefinition($twoFactorProviderId, new ChildDefinition(TwoFactorF actory::PROVIDER_DEFINITION_ID))
->replaceArgument(0, new Reference($twoFactorFirewallConfigId)) ->replaceArgument(0, new Reference($twoFactorFirewallConfigId))
->replaceArgument(1, new Reference('scheb_two_factor.provider_regist ry'))
->replaceArgument(2, new Reference(BackupCodeManager::class)) ->replaceArgument(2, new Reference(BackupCodeManager::class))
->replaceArgument(3, new Reference('scheb_two_factor.provider_prepar ation_recorder'))
; ;
$provider = 'contao.security.authentication_provider.'.$id; $provider = 'contao.security.authentication_provider.'.$id;
$container $container
->setDefinition($provider, new ChildDefinition('contao.security.auth entication_provider')) ->setDefinition($provider, new ChildDefinition('contao.security.auth entication_provider'))
->replaceArgument(0, new Reference($userProviderId)) ->replaceArgument(0, new Reference($userProviderId))
->replaceArgument(1, new Reference('security.user_checker.'.$id)) ->replaceArgument(1, new Reference('security.user_checker.'.$id))
->replaceArgument(2, $id) ->replaceArgument(2, $id)
->replaceArgument(5, new Reference($twoFactorProviderId)) ->replaceArgument(5, new Reference($twoFactorProviderId))
skipping to change at line 113 skipping to change at line 109
private function createTwoFactorPreparationListener(ContainerBuilder $contai ner, string $firewallName): void private function createTwoFactorPreparationListener(ContainerBuilder $contai ner, string $firewallName): void
{ {
$firewallConfigId = TwoFactorFactory::PROVIDER_PREPARATION_LISTENER_ID_P REFIX.$firewallName; $firewallConfigId = TwoFactorFactory::PROVIDER_PREPARATION_LISTENER_ID_P REFIX.$firewallName;
$container $container
->setDefinition($firewallConfigId, new ChildDefinition(TwoFactorFact ory::PROVIDER_PREPARATION_LISTENER_DEFINITION_ID)) ->setDefinition($firewallConfigId, new ChildDefinition(TwoFactorFact ory::PROVIDER_PREPARATION_LISTENER_DEFINITION_ID))
->replaceArgument(3, $firewallName) ->replaceArgument(3, $firewallName)
->replaceArgument(4, true) ->replaceArgument(4, true)
->replaceArgument(5, false) ->replaceArgument(5, false)
->addTag('kernel.event_listener', ['event' => 'security.authenticati ->addTag('kernel.event_subscriber')
on.success', 'method' => 'onLogin', 'priority' => PHP_INT_MAX])
->addTag('kernel.event_listener', ['event' => 'scheb_two_factor.auth
entication.form', 'method' => 'onTwoFactorForm'])
->addTag('kernel.event_listener', ['event' => 'kernel.response', 'me
thod' => 'onKernelResponse'])
; ;
} }
} }
 End of changes. 7 change blocks. 
14 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)