Added config setting to disable password-reset and user-registration (#261)
This commit is contained in:
@@ -71,12 +71,42 @@ class Kernel extends BaseKernel
|
||||
protected function configureRoutes(RouteCollectionBuilder $routes)
|
||||
{
|
||||
$confDir = $this->getProjectDir() . '/config';
|
||||
|
||||
// some routes are based on app configs and will be imported manually
|
||||
$this->configureFosUserRoutes($routes);
|
||||
|
||||
// load bundle specific route files
|
||||
if (is_dir($confDir . '/routes/')) {
|
||||
$routes->import($confDir . '/routes/*' . self::CONFIG_EXTS, '/', 'glob');
|
||||
}
|
||||
|
||||
// load environment specific route files
|
||||
if (is_dir($confDir . '/routes/' . $this->environment)) {
|
||||
$routes->import($confDir . '/routes/' . $this->environment . '/**/*' . self::CONFIG_EXTS, '/', 'glob');
|
||||
}
|
||||
|
||||
// load application routes
|
||||
$routes->import($confDir . '/routes' . self::CONFIG_EXTS, '/', 'glob');
|
||||
}
|
||||
|
||||
protected function configureFosUserRoutes(RouteCollectionBuilder $routes)
|
||||
{
|
||||
$features = $this->getContainer()->getParameter('kimai.fosuser');
|
||||
|
||||
// Expose the user registration feature
|
||||
if ($features['registration']) {
|
||||
$routes->import(
|
||||
'@FOSUserBundle/Resources/config/routing/registration.xml',
|
||||
'/{_locale}/register'
|
||||
);
|
||||
}
|
||||
|
||||
// Expose the users password-reset feature
|
||||
if ($features['password_reset']) {
|
||||
$routes->import(
|
||||
'@FOSUserBundle/Resources/config/routing/resetting.xml',
|
||||
'/{_locale}/resetting'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user