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]
|
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||||
authentication:
|
authentication:
|
||||||
auto-create:
|
auto-create:
|
||||||
enabled: false
|
|
||||||
templates: { }
|
templates: { }
|
||||||
captcha:
|
captcha:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
@@ -67,8 +67,10 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
}, $authConf['auto-create']['templates']));
|
}, $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) {
|
$app['authentication.providers'] = $app->share(function (Application $app) {
|
||||||
|
@@ -50,15 +50,15 @@ class patch_3817 implements patchInterface
|
|||||||
{
|
{
|
||||||
$auth = $app['phraseanet.configuration']['authentication'];
|
$auth = $app['phraseanet.configuration']['authentication'];
|
||||||
|
|
||||||
if (!isset($auth['captcha'])) {
|
if (isset($auth['captcha']) && isset($auth['captcha']['trials-before-failure'])) {
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($auth['captcha']['trials-before-failure'])) {
|
|
||||||
$auth['captcha']['trials-before-display'] = $auth['captcha']['trials-before-failure'];
|
$auth['captcha']['trials-before-display'] = $auth['captcha']['trials-before-failure'];
|
||||||
unset($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;
|
$app['phraseanet.configuration']['authentication'] = $auth;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -85,7 +85,6 @@ border-manager:
|
|||||||
mediatypes: [Audio, Document, Flash, Image, Video]
|
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||||
authentication:
|
authentication:
|
||||||
auto-create:
|
auto-create:
|
||||||
enabled: false
|
|
||||||
templates: { }
|
templates: { }
|
||||||
captcha:
|
captcha:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
@@ -68,7 +68,6 @@ border-manager:
|
|||||||
mediatypes: [Audio, Document, Flash, Image, Video]
|
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||||
authentication:
|
authentication:
|
||||||
auto-create:
|
auto-create:
|
||||||
enabled: false
|
|
||||||
templates: { }
|
templates: { }
|
||||||
captcha:
|
captcha:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -116,8 +115,6 @@ registration-fields:
|
|||||||
required: true
|
required: true
|
||||||
xsendfile:
|
xsendfile:
|
||||||
enabled: false
|
enabled: false
|
||||||
type: ''
|
type: nginx
|
||||||
mapping:
|
mapping: []
|
||||||
-
|
plugins: []
|
||||||
directory: ''
|
|
||||||
mount-point: ''
|
|
||||||
|
@@ -68,7 +68,6 @@ border-manager:
|
|||||||
mediatypes: [Audio, Document, Flash, Image, Video]
|
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||||
authentication:
|
authentication:
|
||||||
auto-create:
|
auto-create:
|
||||||
enabled: false
|
|
||||||
templates: { }
|
templates: { }
|
||||||
captcha:
|
captcha:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -116,8 +115,6 @@ registration-fields:
|
|||||||
required: true
|
required: true
|
||||||
xsendfile:
|
xsendfile:
|
||||||
enabled: false
|
enabled: false
|
||||||
type: ''
|
type: nginx
|
||||||
mapping:
|
mapping: []
|
||||||
-
|
plugins: []
|
||||||
directory: ''
|
|
||||||
mount-point: ''
|
|
||||||
|
@@ -93,7 +93,6 @@ border-manager:
|
|||||||
- Video
|
- Video
|
||||||
authentication:
|
authentication:
|
||||||
auto-create:
|
auto-create:
|
||||||
enabled: false
|
|
||||||
templates: { }
|
templates: { }
|
||||||
captcha:
|
captcha:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
@@ -93,7 +93,6 @@ border-manager:
|
|||||||
- Video
|
- Video
|
||||||
authentication:
|
authentication:
|
||||||
auto-create:
|
auto-create:
|
||||||
enabled: false
|
|
||||||
templates: { }
|
templates: { }
|
||||||
captcha:
|
captcha:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
@@ -107,12 +107,11 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
|||||||
$app = new PhraseaApplication();
|
$app = new PhraseaApplication();
|
||||||
$app->register(new ConfigurationServiceProvider());
|
$app->register(new ConfigurationServiceProvider());
|
||||||
|
|
||||||
$app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig();
|
$conf = $app['phraseanet.configuration']->getConfig();
|
||||||
$conf['authentication']['auto-create'] = array(
|
$conf['authentication']['auto-create'] = array(
|
||||||
'enabled' => true,
|
|
||||||
'templates' => array(),
|
'templates' => array(),
|
||||||
);
|
);
|
||||||
$app['phraseanet.configuration'] = $conf;
|
$app['phraseanet.configuration']->setConfig($conf);
|
||||||
|
|
||||||
$app['authentication.providers.account-creator'];
|
$app['authentication.providers.account-creator'];
|
||||||
}
|
}
|
||||||
@@ -139,11 +138,11 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
|||||||
}));
|
}));
|
||||||
$app['phraseanet.appbox'] = self::$DI['app']['phraseanet.appbox'];
|
$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(
|
$conf['authentication']['captcha'] = array(
|
||||||
'enabled' => true,
|
'enabled' => true,
|
||||||
);
|
);
|
||||||
$app['phraseanet.configuration'] = $conf;
|
$app['phraseanet.configuration']->setConfig($conf);
|
||||||
|
|
||||||
$app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager')
|
$app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
@@ -177,11 +176,11 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
|||||||
}));
|
}));
|
||||||
$app['phraseanet.appbox'] = self::$DI['app']['phraseanet.appbox'];
|
$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(
|
$conf['authentication']['captcha'] = array(
|
||||||
'enabled' => false,
|
'enabled' => false,
|
||||||
);
|
);
|
||||||
$app['phraseanet.configuration'] = $conf;
|
$app['phraseanet.configuration']->setConfig($conf);
|
||||||
|
|
||||||
$app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager')
|
$app['EM'] = $this->getMockBuilder('Doctrine\Orm\EntityManager')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
@@ -203,15 +202,14 @@ class AuthenticationManagerServiceProvidertest extends ServiceProviderTestCase
|
|||||||
$template2 = \User_Adapter::create(self::$DI['app'], 'template' . $random->generatePassword(), $random->generatePassword(), null, false);
|
$template2 = \User_Adapter::create(self::$DI['app'], 'template' . $random->generatePassword(), $random->generatePassword(), null, false);
|
||||||
$template2->set_template(self::$DI['user']);
|
$template2->set_template(self::$DI['user']);
|
||||||
|
|
||||||
$app['phraseanet.configuration'] = $conf = $app['phraseanet.configuration']->getConfig();
|
$conf = $app['phraseanet.configuration']->getConfig();
|
||||||
$conf['authentication']['auto-create'] = array(
|
$conf['authentication']['auto-create'] = array(
|
||||||
'enabled' => true,
|
|
||||||
'templates' => array(
|
'templates' => array(
|
||||||
$template1->get_id(),
|
$template1->get_id(),
|
||||||
$template2->get_login()
|
$template2->get_login()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$app['phraseanet.configuration'] = $conf;
|
$app['phraseanet.configuration']->setConfig($conf);
|
||||||
|
|
||||||
$this->assertEquals(array($template1, $template2), $app['authentication.providers.account-creator']->getTemplates());
|
$this->assertEquals(array($template1, $template2), $app['authentication.providers.account-creator']->getTemplates());
|
||||||
|
|
||||||
|
@@ -202,7 +202,6 @@ class Migration38Test extends AbstractSetupTester
|
|||||||
),
|
),
|
||||||
'authentication' => array(
|
'authentication' => array(
|
||||||
'auto-create' => array(
|
'auto-create' => array(
|
||||||
'enabled' => false,
|
|
||||||
'templates' => array(
|
'templates' => array(
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user