mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 05:23:21 +00:00
Remove register_enable function from login class
This commit is contained in:
@@ -25,9 +25,19 @@ class RegistrationServiceProvider implements ServiceProviderInterface
|
|||||||
});
|
});
|
||||||
|
|
||||||
$app['registration.enabled'] = $app->share(function (Application $app){
|
$app['registration.enabled'] = $app->share(function (Application $app){
|
||||||
$login = new \login();
|
require_once __DIR__ . '/../../../../classes/deprecated/inscript.api.php';
|
||||||
|
|
||||||
return $login->register_enabled($app);
|
$bases = giveMeBases($app);
|
||||||
|
|
||||||
|
if ($bases) {
|
||||||
|
foreach ($bases as $base) {
|
||||||
|
if ($base['inscript']) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$app['registration.optional-fields'] = $app->share(function (Application $app) {
|
$app['registration.optional-fields'] = $app->share(function (Application $app) {
|
||||||
|
@@ -220,9 +220,8 @@ class eventsmanager_notify_autoregister extends eventsmanager_notifyAbstract
|
|||||||
public function is_available()
|
public function is_available()
|
||||||
{
|
{
|
||||||
$bool = false;
|
$bool = false;
|
||||||
$login = new \login();
|
|
||||||
|
|
||||||
if ( ! $this->app['authentication']->isAuthenticated() || ! $login->register_enabled($this->app)) {
|
if ( ! $this->app['authentication']->isAuthenticated() || ! $this->app['registration.enabled']) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -199,9 +199,8 @@ class eventsmanager_notify_register extends eventsmanager_notifyAbstract
|
|||||||
public function is_available()
|
public function is_available()
|
||||||
{
|
{
|
||||||
$bool = false;
|
$bool = false;
|
||||||
$login = new \login();
|
|
||||||
|
|
||||||
if ( !$this->app['authentication']->isAuthenticated() || ! $login->register_enabled($this->app)) {
|
if ( !$this->app['authentication']->isAuthenticated() || ! $this->app['registration.enabled']) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -9,21 +9,4 @@ class login
|
|||||||
{
|
{
|
||||||
return databox_cgu::getHome($app);
|
return databox_cgu::getHome($app);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function register_enabled(Application $app)
|
|
||||||
{
|
|
||||||
require_once __DIR__ . '/deprecated/inscript.api.php';
|
|
||||||
|
|
||||||
$bases = giveMeBases($app);
|
|
||||||
|
|
||||||
if ($bases) {
|
|
||||||
foreach ($bases as $base) {
|
|
||||||
if ($base['inscript']) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user