Fix #1245 : Rename trials-before-failure configuration to trials-before-display

This commit is contained in:
Romain Neutron
2013-07-10 12:49:21 +02:00
parent bb62b43494
commit 70cb9ee06b
11 changed files with 76 additions and 10 deletions

View File

@@ -86,7 +86,7 @@ authentication:
templates: { }
captcha:
enabled: true
trials-before-failure: 9
trials-before-display: 9
providers:
facebook:
enabled: false

View File

@@ -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) {

View File

@@ -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()

View File

@@ -0,0 +1,66 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2012 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Alchemy\Phrasea\Application;
class patch_3817 implements patchInterface
{
/** @var string */
private $release = '3.8.0.a17';
/** @var array */
private $concern = array(base::APPLICATION_BOX);
/**
* {@inheritdoc}
*/
public function get_release()
{
return $this->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;
}
}

View File

@@ -89,7 +89,7 @@ authentication:
templates: { }
captcha:
enabled: true
trials-before-failure: 9
trials-before-display: 9
providers:
facebook:
enabled: false

View File

@@ -72,7 +72,7 @@ authentication:
templates: { }
captcha:
enabled: true
trials-before-failure: 9
trials-before-display: 9
providers:
facebook:
enabled: false

View File

@@ -72,7 +72,7 @@ authentication:
templates: { }
captcha:
enabled: true
trials-before-failure: 9
trials-before-display: 9
providers:
facebook:
enabled: false

View File

@@ -97,7 +97,7 @@ authentication:
templates: { }
captcha:
enabled: true
trials-before-failure: 9
trials-before-display: 9
providers:
facebook:
enabled: false

View File

@@ -97,7 +97,7 @@ authentication:
templates: { }
captcha:
enabled: true
trials-before-failure: 9
trials-before-display: 9
providers:
facebook:
enabled: false

View File

@@ -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')

View File

@@ -208,7 +208,7 @@ class Migration38Test extends AbstractSetupTester
),
'captcha' => array(
'enabled' => true,
'trials-before-failure' => 9,
'trials-before-display' => 9,
),
'providers' => array(
'facebook' => array(