mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Fix #1240 : Remove authentication>auto-create>enabled parameter
This commit is contained in:
@@ -82,7 +82,6 @@ border-manager:
|
||||
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||
authentication:
|
||||
auto-create:
|
||||
enabled: false
|
||||
templates: { }
|
||||
captcha:
|
||||
enabled: true
|
||||
|
@@ -67,8 +67,10 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface
|
||||
|
||||
}
|
||||
}, $authConf['auto-create']['templates']));
|
||||
|
||||
$enabled = $app['phraseanet.registry']->get('GV_autoregister') && $app['registration.enabled'];
|
||||
|
||||
return new AccountCreator($app['tokens'], $app['phraseanet.appbox'], $authConf['auto-create']['enabled'], $templates);
|
||||
return new AccountCreator($app['tokens'], $app['phraseanet.appbox'], $enabled, $templates);
|
||||
});
|
||||
|
||||
$app['authentication.providers'] = $app->share(function (Application $app) {
|
||||
|
@@ -50,15 +50,15 @@ class patch_3817 implements patchInterface
|
||||
{
|
||||
$auth = $app['phraseanet.configuration']['authentication'];
|
||||
|
||||
if (!isset($auth['captcha'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isset($auth['captcha']['trials-before-failure'])) {
|
||||
if (isset($auth['captcha']) && isset($auth['captcha']['trials-before-failure'])) {
|
||||
$auth['captcha']['trials-before-display'] = $auth['captcha']['trials-before-failure'];
|
||||
unset($auth['captcha']['trials-before-failure']);
|
||||
}
|
||||
|
||||
if (isset($auth['auto-create']) && isset($auth['auto-create']['enabled'])) {
|
||||
unset($auth['auto-create']['enabled']);
|
||||
}
|
||||
|
||||
$app['phraseanet.configuration']['authentication'] = $auth;
|
||||
|
||||
return true;
|
||||
|
@@ -85,7 +85,6 @@ border-manager:
|
||||
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||
authentication:
|
||||
auto-create:
|
||||
enabled: false
|
||||
templates: { }
|
||||
captcha:
|
||||
enabled: true
|
||||
|
@@ -68,7 +68,6 @@ border-manager:
|
||||
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||
authentication:
|
||||
auto-create:
|
||||
enabled: false
|
||||
templates: { }
|
||||
captcha:
|
||||
enabled: true
|
||||
@@ -116,8 +115,6 @@ registration-fields:
|
||||
required: true
|
||||
xsendfile:
|
||||
enabled: false
|
||||
type: ''
|
||||
mapping:
|
||||
-
|
||||
directory: ''
|
||||
mount-point: ''
|
||||
type: nginx
|
||||
mapping: []
|
||||
plugins: []
|
||||
|
@@ -68,7 +68,6 @@ border-manager:
|
||||
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||
authentication:
|
||||
auto-create:
|
||||
enabled: false
|
||||
templates: { }
|
||||
captcha:
|
||||
enabled: true
|
||||
@@ -116,8 +115,6 @@ registration-fields:
|
||||
required: true
|
||||
xsendfile:
|
||||
enabled: false
|
||||
type: ''
|
||||
mapping:
|
||||
-
|
||||
directory: ''
|
||||
mount-point: ''
|
||||
type: nginx
|
||||
mapping: []
|
||||
plugins: []
|
||||
|
@@ -93,7 +93,6 @@ border-manager:
|
||||
- Video
|
||||
authentication:
|
||||
auto-create:
|
||||
enabled: false
|
||||
templates: { }
|
||||
captcha:
|
||||
enabled: true
|
||||
|
@@ -93,7 +93,6 @@ border-manager:
|
||||
- Video
|
||||
authentication:
|
||||
auto-create:
|
||||
enabled: false
|
||||
templates: { }
|
||||
captcha:
|
||||
enabled: true
|
||||
|
@@ -107,12 +107,11 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
||||
$app = new PhraseaApplication();
|
||||
$app->register(new ConfigurationServiceProvider());
|
||||
|
||||
$app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig();
|
||||
$conf = $app['phraseanet.configuration']->getConfig();
|
||||
$conf['authentication']['auto-create'] = array(
|
||||
'enabled' => true,
|
||||
'templates' => array(),
|
||||
);
|
||||
$app['phraseanet.configuration'] = $conf;
|
||||
$app['phraseanet.configuration']->setConfig($conf);
|
||||
|
||||
$app['authentication.providers.account-creator'];
|
||||
}
|
||||
@@ -139,11 +138,11 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
||||
}));
|
||||
$app['phraseanet.appbox'] = self::$DI['app']['phraseanet.appbox'];
|
||||
|
||||
$app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig();
|
||||
$conf = $app['phraseanet.configuration']->getConfig();
|
||||
$conf['authentication']['captcha'] = array(
|
||||
'enabled' => true,
|
||||
);
|
||||
$app['phraseanet.configuration'] = $conf;
|
||||
$app['phraseanet.configuration']->setConfig($conf);
|
||||
|
||||
$app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager')
|
||||
->disableOriginalConstructor()
|
||||
@@ -177,11 +176,11 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
||||
}));
|
||||
$app['phraseanet.appbox'] = self::$DI['app']['phraseanet.appbox'];
|
||||
|
||||
$app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig();
|
||||
$conf = $app['phraseanet.configuration']->getConfig();
|
||||
$conf['authentication']['captcha'] = array(
|
||||
'enabled' => false,
|
||||
);
|
||||
$app['phraseanet.configuration'] = $conf;
|
||||
$app['phraseanet.configuration']->setConfig($conf);
|
||||
|
||||
$app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager')
|
||||
->disableOriginalConstructor()
|
||||
@@ -203,15 +202,14 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
||||
$template2 = \User_Adapter::create(self::$DI['app'], 'template' . $random->generatePassword(), $random->generatePassword(), null, false);
|
||||
$template2->set_template(self::$DI['user']);
|
||||
|
||||
$app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig();
|
||||
$conf = $app['phraseanet.configuration']->getConfig();
|
||||
$conf['authentication']['auto-create'] = array(
|
||||
'enabled' => true,
|
||||
'templates' => array(
|
||||
$template1->get_id(),
|
||||
$template2->get_login()
|
||||
)
|
||||
);
|
||||
$app['phraseanet.configuration'] = $conf;
|
||||
$app['phraseanet.configuration']->setConfig($conf);
|
||||
|
||||
$this->assertEquals(array($template1, $template2), $app['authentication.providers.account-creator']->getTemplates());
|
||||
|
||||
|
@@ -202,7 +202,6 @@ class Migration38Test extends AbstractSetupTester
|
||||
),
|
||||
'authentication' => array(
|
||||
'auto-create' => array(
|
||||
'enabled' => false,
|
||||
'templates' => array(
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user