diff --git a/core/core.php b/core/core.php index b4197b7f..e2ac309a 100755 --- a/core/core.php +++ b/core/core.php @@ -1595,6 +1595,10 @@ class common { // Version 11.0.00 if ($this->getData(['core', 'dataVersion']) < 11000) { + + // Option de déconnexion auto activée + $this->setData(['config','autoDisconnect',true]); + // Mettre à jour les données de langue $this->setData(['config','translate','scriptGoogle', false ]); $this->setData(['config','translate','showCredits', false ]); @@ -1910,7 +1914,9 @@ class core extends common { if ( $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') AND ( $this->getUser('group') === self::GROUP_BANNED - OR $_SESSION['csrf'] !== $this->getData(['user',$this->getUser('id'),'accessCsrf']) ) + OR ( $_SESSION['csrf'] !== $this->getData(['user',$this->getUser('id'),'accessCsrf']) + AND $this->getData(['config','autoDisconnect']) === true) + ) ) { $user = new user; $user->logout(); diff --git a/core/module/config/config.php b/core/module/config/config.php index 85f34738..cb5619ba 100755 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -479,6 +479,11 @@ class config extends common { $this->getInput('configAdvancedAutoUpdate', helper::FILTER_BOOLEAN) === true) { $this->setData(['core','lastAutoUpdate',0]); } + // Eviter déconnexion automatique après son activation + if ( $this->getData(['config','autoDisconnect']) === false + AND $this->getInput('configAdvancedAutoDisconnect',helper::FILTER_BOOLEAN) === true ) { + $this->setData(['user',$this->getuser('id'),'accessCsrf',$_SESSION['csrf']]); + } // Sauvegarder $this->setData([ 'config', @@ -507,6 +512,7 @@ class config extends common { 'proxyUrl' => $this->getInput('configAdvancedProxyUrl'), 'proxyPort' => $this->getInput('configAdvancedProxyPort',helper::FILTER_INT), 'captchaStrong' => $this->getInput('configAdvancedCaptchaStrong',helper::FILTER_BOOLEAN), + 'autoDisconnect' => $this->getInput('configAdvancedAutoDisconnect',helper::FILTER_BOOLEAN), 'smtp' => [ 'enable' => $this->getInput('configAdvancedSmtpEnable',helper::FILTER_BOOLEAN), 'host' => $this->getInput('configAdvancedSmtpHost',helper::FILTER_STRING_SHORT), diff --git a/core/module/config/view/advanced/advanced.php b/core/module/config/view/advanced/advanced.php index 06718e43..d2801af6 100644 --- a/core/module/config/view/advanced/advanced.php +++ b/core/module/config/view/advanced/advanced.php @@ -44,7 +44,7 @@
Une archive contenant le dossier /site/data est copiée dans le dossier \'site/backup\'. La sauvegarde est conservée pendant 30 jours.
Les fichiers du site ne sont pas sauvegardés automatiquement.
' + 'help' => 'Une archive contenant le dossier /site/data est copiée dans le dossier \'site/backup\'. La sauvegarde est conservée pendant 30 jours.Les fichiers du site ne sont pas sauvegardés automatiquement. Activation recommandée.' ]); ?>
Un fichier .backup.json est généré à chaque édition ou effacement d\'une donnée. La désactivation entraîne la suppression de ces fichiers.
' + 'help' => 'Un fichier .backup.json est généré à chaque édition ou effacement d\'une donnée. La désactivation entraîne la suppression de ces fichiers. Activation recommandée.' + ]); ?> +