diff --git a/CHANGES.md b/CHANGES.md index 3ba18d9..e84f94f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,16 @@ # Changelog +## Version 4.4.06 de Deltacms +- Modifications : + - Thème / Footer : nouvelle option 'Qui est en ligne ?', affiche le nombre de visiteurs ou d'utilisateurs connectés, + - Réécriture du layout, l'affichage des pages est plus rapide, + - Module Form : un brouillon trop ancien est effacé pour détruire les traces de robots malveillants, + - Configuration / configuration : message de confirmation avant une mise à jour de DeltaCMS. +- Corrections : + - Module Form : messages liés au captcha, + - Thème / menu : l'aperçu en direct pendant sa configuration est amélioré, + - Configuration / configuration : lien du bouton Réinstaller neutralisé si le bouton est désactivé. + ## Version 4.4.05 de Deltacms - Modifications : - Chargement ordonné des scripts javascript et des styles, l'affichage des pages est plus rapide, diff --git a/README.md b/README.md index d86ee5c..6584622 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# DeltaCMS 4.4.05 +# DeltaCMS 4.4.06 DeltaCMS est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation. -L'administration du site est bilingue anglais ou français, le site peut être rédigé dans une des principales langues européennes. +L'administration du site est bilingue anglais ou français, le site peut être rédigé dans une langue quelconque. 2 modes de traduction sont proposés : traduction rédigée, assistée (conseillée) ou à défaut traduction automatique par script. DeltaCMS is a database-less (flat-file) CMS that allows you to easily create and manage a website without any programming knowledge. -The administration of the site is bilingual English or French, the site can be written in one of the main European languages. +The administration of the site is bilingual English or French, the site can be written in any language. 2 translation modes are available: written and assisted translation (recommended) or automatic translation by script. [Site](http://deltacms.fr/) diff --git a/core/core.js.php b/core/core.js.php index 8e6df8e..39cc17e 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -3,7 +3,7 @@ * For full copyright and license information, please see the LICENSE * file that was distributed with this source code. * @author Sylvain Lelièvre - * @copyright Copyright (C) 2021-2022, Sylvain Lelièvre + * @copyright Copyright (C) 2021, Sylvain Lelièvre * @license GNU General Public License, version 3 * @link https://deltacms.fr/ * diff --git a/core/core.php b/core/core.php index 3397d09..afe92f9 100644 --- a/core/core.php +++ b/core/core.php @@ -5,7 +5,7 @@ * For full copyright and license information, please see the LICENSE * file that was distributed with this source code. * @author Sylvain Lelièvre - * @copyright Copyright (C) 2021-2022, Sylvain Lelièvre + * @copyright Copyright (C) 2021, Sylvain Lelièvre * @license GNU General Public License, version 3 * @link https://deltacms.fr/ * @@ -49,7 +49,7 @@ class common { // Numéro de version const DELTA_UPDATE_URL = 'https://update.deltacms.fr/master/'; - const DELTA_VERSION = '4.4.05'; + const DELTA_VERSION = '4.4.06'; const DELTA_UPDATE_CHANNEL = "v4"; public static $actions = []; @@ -221,7 +221,8 @@ class common { 'admin' => '', 'blacklist' => '', 'locale' => '', - 'fonts' => '' + 'fonts' => '', + 'session' =>'' ]; /** @@ -1509,6 +1510,40 @@ class common { $label = empty($this->getData(['locale', 'cookies', 'cookiesFooterText'])) ? 'Cookies' : $this->getData(['locale', 'cookies', 'cookiesFooterText']) ; $items .= ' | '. $label .''; $items .= ''; + // Enregistrement et affichage des personnes en ligne + if( $this->getData(['theme', 'footer', 'displayWhois']) === true ){ + // ajouter 'session' à la liste des descripteurs d'E/S ligne 225 + if( ! file_exists(self::DATA_DIR . 'session.json')) file_put_contents(self::DATA_DIR . 'session.json', '{}'); + $user_type = $this->getUser('id') ? $this->getData(['user', $this->getUser('id'), 'group']) : 0 ; + $this->setData(['session', session_id(), 'user_type', $user_type ]); + $this->setData(['session', session_id(), 'time', time() ]); + // Lexique + include('./core/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_core.php'); + $file = file_get_contents('site/data/session.json'); + $session_tab = json_decode( $file, true); + $whoIs = [0 => 0,1 => 0,2 => 0, 3 => 0,4=> 0]; + foreach( $session_tab as $key1=>$session_id){ + foreach($session_id as $key2=>$value){ + // Temps d'inactivité réglé ici à 300 secondes + if( time() > $value["time"] + 300){ + $session_tab[$key1]=[]; + } else { + $whoIs[$value['user_type']]++; + } + } + } + $file = json_encode( $session_tab); + file_put_contents('site/data/session.json', $file); + // Affichage + $textWhoIs =''; + foreach( $whoIs as $key=>$value ){ + if( $value !== 0){ + $textWhoIs .= ' '. $value.' '. $groupWhoIs[$key]; + $textWhoIs .= $value > 1 ? 's ':' '; + } + } + $items .= ' | '.$textWhoIs; + } // Affichage du lien de connexion if( ( @@ -1619,27 +1654,71 @@ class common { /** * Affiche le menu */ - public function showMenu() { + public function showMenu( $position ='') { // Lexique include('./core/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_core.php'); + + switch ($position) { + case 'top': + // Détermine si le menu est fixe en haut de page lorsque l'utilisateur n'est pas connecté + if ( $this->getData(['theme', 'menu', 'position']) === 'top' AND $this->getData(['theme', 'menu', 'fixed']) === true ){ + if( $this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD') AND $this->getUser('group') > self::GROUP_MEMBER) { + echo '