diff --git a/config/configuration.sample.yml b/config/configuration.sample.yml index b8ab08146a..c638e5270f 100644 --- a/config/configuration.sample.yml +++ b/config/configuration.sample.yml @@ -86,7 +86,7 @@ authentication: templates: { } captcha: enabled: true - trials-before-failure: 9 + trials-before-display: 9 providers: facebook: enabled: false diff --git a/lib/Alchemy/Phrasea/Core/Provider/AuthenticationManagerServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/AuthenticationManagerServiceProvider.php index 51174ba1c8..6e5a74b454 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/AuthenticationManagerServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/AuthenticationManagerServiceProvider.php @@ -101,7 +101,7 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface $app['auth.native.failure-manager'] = $app->share(function (Application $app) { $authConf = $app['phraseanet.configuration']['authentication']['captcha']; - return new FailureManager($app['EM'], $app['recaptcha'], isset($authConf['trials-before-failure']) ? $authConf['trials-before-failure'] : 9); + return new FailureManager($app['EM'], $app['recaptcha'], isset($authConf['trials-before-display']) ? $authConf['trials-before-display'] : 9); }); $app['auth.password-checker'] = $app->share(function (Application $app) { diff --git a/lib/Alchemy/Phrasea/Core/Version.php b/lib/Alchemy/Phrasea/Core/Version.php index 5a26a347e8..3c0893c844 100644 --- a/lib/Alchemy/Phrasea/Core/Version.php +++ b/lib/Alchemy/Phrasea/Core/Version.php @@ -18,7 +18,7 @@ namespace Alchemy\Phrasea\Core; */ class Version { - protected static $number = '3.8.0.a16'; + protected static $number = '3.8.0.a17'; protected static $name = 'Carnosaurus'; public static function getNumber() diff --git a/lib/classes/patch/3817.php b/lib/classes/patch/3817.php new file mode 100644 index 0000000000..9a6571690f --- /dev/null +++ b/lib/classes/patch/3817.php @@ -0,0 +1,66 @@ +release; + } + + /** + * {@inheritdoc} + */ + public function require_all_upgrades() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function concern() + { + return $this->concern; + } + + /** + * {@inheritdoc} + */ + public function apply(base $appbox, Application $app) + { + $auth = $app['phraseanet.configuration']['authentication']; + + if (!isset($auth['captcha'])) { + return true; + } + + if (isset($auth['captcha']['trials-before-failure'])) { + $auth['captcha']['trials-before-display'] = $auth['captcha']['trials-before-failure']; + unset($auth['captcha']['trials-before-failure']); + } + + $app['phraseanet.configuration']['authentication'] = $auth; + + return true; + } +} diff --git a/lib/conf.d/configuration.yml b/lib/conf.d/configuration.yml index c9f1f0159a..86031392aa 100644 --- a/lib/conf.d/configuration.yml +++ b/lib/conf.d/configuration.yml @@ -89,7 +89,7 @@ authentication: templates: { } captcha: enabled: true - trials-before-failure: 9 + trials-before-display: 9 providers: facebook: enabled: false diff --git a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-setup.yml b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-setup.yml index 55b4553acd..d2aec2af26 100644 --- a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-setup.yml +++ b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-setup.yml @@ -72,7 +72,7 @@ authentication: templates: { } captcha: enabled: true - trials-before-failure: 9 + trials-before-display: 9 providers: facebook: enabled: false diff --git a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml index 55b4553acd..d2aec2af26 100644 --- a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml +++ b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration.yml @@ -72,7 +72,7 @@ authentication: templates: { } captcha: enabled: true - trials-before-failure: 9 + trials-before-display: 9 providers: facebook: enabled: false diff --git a/tests/Alchemy/Tests/Phrasea/Core/Event/Subscriber/Fixtures/configuration-debugger.yml b/tests/Alchemy/Tests/Phrasea/Core/Event/Subscriber/Fixtures/configuration-debugger.yml index 85d4fe3e4a..8e96612e6f 100644 --- a/tests/Alchemy/Tests/Phrasea/Core/Event/Subscriber/Fixtures/configuration-debugger.yml +++ b/tests/Alchemy/Tests/Phrasea/Core/Event/Subscriber/Fixtures/configuration-debugger.yml @@ -97,7 +97,7 @@ authentication: templates: { } captcha: enabled: true - trials-before-failure: 9 + trials-before-display: 9 providers: facebook: enabled: false diff --git a/tests/Alchemy/Tests/Phrasea/Core/Event/Subscriber/Fixtures/configuration-maintenance.yml b/tests/Alchemy/Tests/Phrasea/Core/Event/Subscriber/Fixtures/configuration-maintenance.yml index 42f4b2f2ba..d759922465 100644 --- a/tests/Alchemy/Tests/Phrasea/Core/Event/Subscriber/Fixtures/configuration-maintenance.yml +++ b/tests/Alchemy/Tests/Phrasea/Core/Event/Subscriber/Fixtures/configuration-maintenance.yml @@ -97,7 +97,7 @@ authentication: templates: { } captcha: enabled: true - trials-before-failure: 9 + trials-before-display: 9 providers: facebook: enabled: false diff --git a/tests/Alchemy/Tests/Phrasea/Core/Provider/AuthenticationManagerServiceProviderTest.php b/tests/Alchemy/Tests/Phrasea/Core/Provider/AuthenticationManagerServiceProviderTest.php index fad55d5360..6814d4732a 100644 --- a/tests/Alchemy/Tests/Phrasea/Core/Provider/AuthenticationManagerServiceProviderTest.php +++ b/tests/Alchemy/Tests/Phrasea/Core/Provider/AuthenticationManagerServiceProviderTest.php @@ -88,7 +88,7 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase $app->register(new ConfigurationServiceProvider()); $app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig(); - $conf['authentication']['captcha']['trials-before-failure'] = 42; + $conf['authentication']['captcha']['trials-before-display'] = 42; $app['phraseanet.configuration'] = $conf; $app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager') diff --git a/tests/Alchemy/Tests/Phrasea/Setup/Version/Migration/Migration38Test.php b/tests/Alchemy/Tests/Phrasea/Setup/Version/Migration/Migration38Test.php index 5cd45faf89..3343bff54d 100644 --- a/tests/Alchemy/Tests/Phrasea/Setup/Version/Migration/Migration38Test.php +++ b/tests/Alchemy/Tests/Phrasea/Setup/Version/Migration/Migration38Test.php @@ -208,7 +208,7 @@ class Migration38Test extends AbstractSetupTester ), 'captcha' => array( 'enabled' => true, - 'trials-before-failure' => 9, + 'trials-before-display' => 9, ), 'providers' => array( 'facebook' => array(