mirror of
https://github.com/getgrav/grav.git
synced 2026-07-04 12:49:06 +02:00
Use sessions for admin even when sessions are disabled
This commit is contained in:
@@ -20,17 +20,23 @@ class Session extends \RocketTheme\Toolbox\Session\Session
|
||||
$uri = $this->grav['uri'];
|
||||
$config = $this->grav['config'];
|
||||
|
||||
if ($config->get('system.session.enabled')) {
|
||||
// Only activate admin if we're inside the admin path.
|
||||
$is_admin = false;
|
||||
$is_admin = false;
|
||||
|
||||
$session_timeout = $config->get('system.session.timeout', 1800);
|
||||
$session_path = $config->get('system.session.path', '/' . ltrim($uri->rootUrl(false), '/'));
|
||||
|
||||
// Activate admin if we're inside the admin path.
|
||||
if ($config->get('plugins.admin.enabled')) {
|
||||
$route = $config->get('plugins.admin.route');
|
||||
$base = '/' . trim($route, '/');
|
||||
if (substr($uri->route(), 0, strlen($base)) == $base) {
|
||||
$session_timeout = $config->get('plugins.admin.session.timeout', 1800);
|
||||
$is_admin = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($config->get('system.session.enabled') || $is_admin) {
|
||||
|
||||
$session_timeout = $config->get('system.session.timeout', 1800);
|
||||
$session_path = $config->get('system.session.path', '/' . ltrim($uri->rootUrl(false), '/'));
|
||||
|
||||
// Define session service.
|
||||
parent::__construct(
|
||||
|
||||
Reference in New Issue
Block a user