diff --git a/CHANGES.md b/CHANGES.md index 8a880738..5b4873e3 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ## version 10.4.00 - Modifications : + - Filtrage des URL générées par facebook (FBCLID) occasionnant une erreur 404 - Captcha arithmétique, activation recommandée dans la configuration. - Module User - Pour les articles de blog et de news, choix de la signature, nom+prenom ; nom+prenom ; id ; pseudo @@ -15,19 +16,20 @@ - Approbation des commentaires - Gestion des thèmes : - Bouton de réinitialisation avec confirmation - - Traduction automatique dans la langue du navigateur. - Amélioration de la structure du flux RSS. + ## Version 10.3.13 Modifications : - Système de données (JsonDB) : - Verrouillage des fichiers de données ouverts en écriture. - Message d'erreur littéral. - Sauvegarde des fichiers de données après un effacement et une écriture. + - Identifiant des noms de ressources (id de page , d'utilisateur, etc..) composés de nombres , remplacement du caractère de préfixe "i" par "_". - Google Analytics, option d'anonymisation. - - Procédure de connexion : les erreurs de captcha sont comptabilisées comme des échecs, allégement des messages d'information. + - Procédure de connexion : les erreurs de captcha sont comptabilisées comme des échecs, allégement des messages d'information. Echecs de connexion, informations plus précises dans le journal de connexion. - TinyMCE : ajout des scripts possibles. -Correction : +Corrections : - Notification de commentaire, remplacement du nom de la page par le titre de l'article. - Thème : couleur du texte au survol d'un bouton standard. diff --git a/README.md b/README.md index fa82bbbf..71521879 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -![](https://img.shields.io/github/last-commit/fredtempez/ZwiiCMS/master) ![](https://img.shields.io/github/release-date/fredtempez/ZwiiCMS) # ZwiiCMS 10.4.00 @@ -75,9 +74,9 @@ Pour revenir à la version 8, renommez ce fichier "data.json". [R] fr Dossier localisé [F] page.json Données des pages [F] module.json Données des modules de pages - [F] admin.css Thème de la partie administration - [F] admin.json Données de la partie administration - [F] blacklist.json Données de connexion des comptes inconnus + [F] admin.css Thème des pages d'administration + [F] admin.json Données de thème des pages d'administration + [F] blacklist.json Journalisation des tentatives de connexion avec des comptes inconnus [F] config.json Configuration du site [F] core.json Configuration du noyau [F] custom.css Feuille de style de la personnalisation avancée @@ -85,6 +84,7 @@ Pour revenir à la version 8, renommez ce fichier "data.json". [F] theme.css Thème du site [F] theme.json Données du site [F] user.json Données des utilisateurs + [F] .backup Marqueur de la sauvegarde des fichiers si présent [R] file Répertoire d'upload du gestionnaire de fichiers [R] source Ressources diverses [R] thumb Miniatures des images diff --git a/core/class/helper.class.php b/core/class/helper.class.php index 58613dc0..396208ec 100755 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -273,7 +273,7 @@ class helper { } // Un ID ne peut pas être un entier, pour éviter les conflits avec le système de pagination if(intval($text) !== 0) { - $text = 'i' . $text; + $text = '_' . $text; } break; case self::FILTER_INT: diff --git a/core/class/jsondb/JsonDb.class.php b/core/class/jsondb/JsonDb.class.php index 23b8e5ac..978a813a 100755 --- a/core/class/jsondb/JsonDb.class.php +++ b/core/class/jsondb/JsonDb.class.php @@ -132,8 +132,8 @@ class JsonDb extends \Prowebcraft\Dot touch($this->db); } // Backup file - if ($this->config['backup']) { - copy ($this->db, $this->db . '.back'); + if ($this->config['backup'] === true) { + copy ($this->db, str_replace('json' , 'backup.json', $this->db)); } if ( is_writable($this->db) ) { // 3 essais diff --git a/core/core.js.php b/core/core.js.php index 12d5f08b..9667595b 100755 --- a/core/core.js.php +++ b/core/core.js.php @@ -480,4 +480,10 @@ $(document).ready(function(){ $(".helpDisplayContent").slideToggle(); }); + /** + * Remove ID Facebook from URL + */ + if(/^\?fbclid=/.test(location.search)) + location.replace(location.href.replace(/\?fbclid.+/, "")); + }); diff --git a/core/core.php b/core/core.php index 6075821e..7e95d295 100755 --- a/core/core.php +++ b/core/core.php @@ -154,6 +154,7 @@ class common { ]; // Langue courante public static $i18nSite; + public static $i18nCurrent; public static $timezone; private $url = ''; // Données de site @@ -168,10 +169,10 @@ class common { // Descripteur de données Entrées / Sorties // Liste ici tous les fichiers de données private $dataFiles = [ + 'config' => '', 'page' => '', 'module' => '', 'core' => '', - 'config' => '', 'page' => '', 'user' => '', 'theme' => '', @@ -202,13 +203,13 @@ class common { } // Instanciation de la classe des entrées / sorties - // Récupére les descripteurs + // Récupère les descripteurs foreach ($this->dataFiles as $keys => $value) { // Constructeur JsonDB $this->dataFiles[$keys] = new \Prowebcraft\JsonDb([ 'name' => $keys . '.json', 'dir' => $this->dataPath ($keys,self::$i18nCurrent), - 'backup' => true + 'backup' => file_exists('site/data/.backup') ]);; } @@ -553,7 +554,16 @@ class common { // Une partie de l'url else { $url = explode('/', $this->url); - return array_key_exists($key, $url) ? $url[$key] : null; + if (array_key_exists($key, $url) ) { + if (strpos($url[$key],'fbclid=') === false) { + $result = $url[$key]; + } else { + $result = $key === 0 ? $this->getData(['config','homePageId']) : ''; + } + } else { + $result = null; + } + return $result; } } @@ -1569,6 +1579,18 @@ class common { $this->setData(['config','translate','it',false]); $this->setData(['config','translate','nl',false]); $this->setData(['config','translate','pt',false]); + + // Renommer les fichier de backup + if ($this->getInput('configAdvancedFileBackup', helper::FILTER_BOOLEAN) === false) { + $path = realpath('site/data'); + foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $filename) + { + echo "$filename
"; + if (strpos($filename,'back.json')) { + rename($filename, str_replace('back.json','backup.json',$filename)); + } + } + } $this->setData(['core', 'dataVersion', 10400]); @@ -1921,7 +1943,7 @@ class core extends common { $access = false; } } - // Empêcher l'accès aux page désactivée par URL directe + // Empêcher l'accès aux pages désactivées par URL directe if ( ( $this->getData(['page', $this->getUrl(0),'disable']) === true AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) OR ( diff --git a/core/module/config/config.php b/core/module/config/config.php index 6b1c80b4..9da3c94f 100755 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -525,7 +525,20 @@ class config extends common { ] ] ]); - + // Efface les fichiers de backup lorsque l'option est désactivée + if ($this->getInput('configAdvancedFileBackup', helper::FILTER_BOOLEAN) === false) { + $path = realpath('site/data'); + foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $filename) + { + if (strpos($filename,'backup.json')) { + unlink($filename); + } + } + if (file_exists('site/data/.backup')) unlink('site/data/.backup'); + } else { + touch('site/data/.backup'); + } + // Notice if(self::$inputNotices === []) { // Active la réécriture d'URL $rewrite = $this->getInput('rewrite', helper::FILTER_BOOLEAN); @@ -539,6 +552,8 @@ class config extends common { PHP_EOL . '' . PHP_EOL . "\tRewriteEngine on" . PHP_EOL . + "\tRewriteCond %{QUERY_STRING} ^(.*)&?fbclid=[^&]+&?(.*)$ [NC]". PHP_EOL . + "\tRewriteRule ^/?(.*)$ /$1?%1%2 [R=301,L]". PHP_EOL . "\tRewriteBase " . helper::baseUrl(false, false) . PHP_EOL . "\tRewriteCond %{REQUEST_FILENAME} !-f" . PHP_EOL . "\tRewriteCond %{REQUEST_FILENAME} !-d" . PHP_EOL . @@ -572,12 +587,6 @@ class config extends common { 'state' => $success ]); } - // Initialisation du screen - APPEL AUTO DESACTIVE POUR EVITER UN RALENTISSEMENT - /* - if (!file_exists(self::FILE_DIR.'source/screenshot.jpg')) { - $this->configMetaImage(); - } - */ // Valeurs en sortie $this->addOutput([ 'title' => 'Configuration avancée', diff --git a/core/module/config/view/advanced/advanced.php b/core/module/config/view/advanced/advanced.php index c6843756..06718e43 100644 --- a/core/module/config/view/advanced/advanced.php +++ b/core/module/config/view/advanced/advanced.php @@ -101,6 +101,12 @@ '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.

' ]); ?> +
+ file_exists('site/data/.backup'), + '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.

' + ]); ?> +
diff --git a/core/module/user/user.php b/core/module/user/user.php index 8f01c904..69c3580e 100755 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -365,6 +365,7 @@ class user extends common { */ public function login() { // Soumission du formulaire + $logStatus = ''; if($this->isPost()) { // Lire Id du compte $userId = $this->getInput('userLoginId', helper::FILTER_ID, true); @@ -373,137 +374,128 @@ class user extends common { $this->getData(['config','connect','captcha']) AND password_verify($this->getInput('userLoginCaptcha', helper::FILTER_INT), $this->getInput('userLoginCaptchaResult') ) === false ) { - //self::$inputNotices['userLoginCaptcha'] = 'Incorrect'; - $notification = 'Captcha incorrect !'; - // Cas 1 le nombre de connexions est inférieur aux tentatives autorisées : incrément compteur d'échec - if ($this->getData(['user',$userId,'connectFail']) < $this->getData(['config', 'connect', 'attempt'])) { - $this->setData(['user',$userId,'connectFail',$this->getdata(['user',$userId,'connectFail']) + 1 ]); - } - // Cas 2 la limite du nombre de connexion est atteinte : placer le timer - if ( $this->getdata(['user',$userId,'connectFail']) == $this->getData(['config', 'connect', 'attempt']) ) { - $this->setData(['user',$userId,'connectTimeout', time()]); - } - // Cas 3 le délai de bloquage court - if ($this->getData(['user',$userId,'connectTimeout']) + $this->getData(['config', 'connect', 'timeout']) > time() ) { - $notification = 'Accès bloqué ' . ($this->getData(['config', 'connect', 'timeout']) / 60) . ' minutes.'; - } - // Valeurs en sortie - $this->addOutput([ - 'notification' => $notification - ]); + $captcha = false; } else { - /** - * Aucun compte existant - */ - if ( !$this->getData(['user', $userId])) { - //Stockage de l'IP - $this->setData([ - 'blacklist', - $userId, - [ - 'connectFail' => $this->getData(['blacklist',$userId,'connectFail']) + 1, - 'lastFail' => time(), - 'ip' => helper::getIp() - ] + $captcha = true; + } + /** + * Aucun compte existant + */ + if ( !$this->getData(['user', $userId])) { + $logStatus = 'Compte inconnu'; + //Stockage de l'IP + $this->setData([ + 'blacklist', + $userId, + [ + 'connectFail' => $this->getData(['blacklist',$userId,'connectFail']) + 1, + 'lastFail' => time(), + 'ip' => helper::getIp() + ] + ]); + // Verrouillage des IP + $ipBlackList = helper::arrayCollumn($this->getData(['blacklist']), 'ip'); + if ( $this->getData(['blacklist',$userId,'connectFail']) >= $this->getData(['config', 'connect', 'attempt']) + AND in_array($this->getData(['blacklist',$userId,'ip']),$ipBlackList) ) { + $logStatus = 'Compte inconnu verrouillé'; + // Valeurs en sortie + $this->addOutput([ + 'notification' => 'Compte verrouillé', + 'redirect' => helper::baseUrl(), + 'state' => false ]); - // Verrouillage des IP - $ipBlackList = helper::arrayCollumn($this->getData(['blacklist']), 'ip'); - if ( $this->getData(['blacklist',$userId,'connectFail']) >= $this->getData(['config', 'connect', 'attempt']) - AND in_array($this->getData(['blacklist',$userId,'ip']),$ipBlackList) ) { - // Valeurs en sortie + } else { + // Valeurs en sortie + $this->addOutput([ + 'notification' => 'Captcha, identifiant ou mot de passe incorrects' + ]); + } + /** + * Le compte existe + */ + } else { + // Cas 4 : le délai de blocage est dépassé et le compte est au max - Réinitialiser + if ($this->getData(['user',$userId,'connectTimeout']) + $this->getData(['config', 'connect', 'timeout']) < time() + AND $this->getData(['user',$userId,'connectFail']) === $this->getData(['config', 'connect', 'attempt']) ) { + $this->setData(['user',$userId,'connectFail',0 ]); + $this->setData(['user',$userId,'connectTimeout',0 ]); + } + // Check la présence des variables et contrôle du blocage du compte si valeurs dépassées + // Vérification du mot de passe et du groupe + if ( + ( $this->getData(['user',$userId,'connectTimeout']) + $this->getData(['config', 'connect', 'timeout']) ) < time() + AND $this->getData(['user',$userId,'connectFail']) < $this->getData(['config', 'connect', 'attempt']) + AND password_verify($this->getInput('userLoginPassword', helper::FILTER_STRING_SHORT, true), $this->getData(['user', $userId, 'password'])) + AND $this->getData(['user', $userId, 'group']) >= self::GROUP_MEMBER + AND $captcha === true + ) { + // RAZ + $this->setData(['user',$userId,'connectFail',0 ]); + $this->setData(['user',$userId,'connectTimeout',0 ]); + // Expiration + $expire = $this->getInput('userLoginLongTime') ? strtotime("+1 year") : 0; + $c = $this->getInput('userLoginLongTime', helper::FILTER_BOOLEAN) === true ? 'true' : 'false'; + setcookie('ZWII_USER_ID', $userId, $expire, helper::baseUrl(false, false) , '', helper::isHttps(), true); + setcookie('ZWII_USER_PASSWORD', $this->getData(['user', $userId, 'password']), $expire, helper::baseUrl(false, false), '', helper::isHttps(), true); + setcookie('ZWII_USER_LONGTIME', $c, $expire, helper::baseUrl(false, false), '', helper::isHttps(), true); + // Accès multiples avec le même compte + $this->setData(['user',$userId,'accessCsrf',$_SESSION['csrf']]); + // Valeurs en sortie lorsque le site est en maintenance et que l'utilisateur n'est pas administrateur + if( + $this->getData(['config', 'maintenance']) + AND $this->getData(['user', $userId, 'group']) < self::GROUP_ADMIN + ) { $this->addOutput([ - 'notification' => 'Compte verrouillé', + 'notification' => 'Seul un administrateur peut se connecter lors d\'une maintenance', 'redirect' => helper::baseUrl(), 'state' => false ]); } else { + $logStatus = 'Connexion réussie'; // Valeurs en sortie $this->addOutput([ - 'notification' => 'Identifiant ou mot de passe incorrects' + 'notification' => 'Bienvenue ' . $this->getData(['user',$userId,'firstname']) . ' ' . $this->getData(['user',$userId,'lastname']) , + 'redirect' => helper::baseUrl() . str_replace('_', '/', str_replace('__', '#', $this->getUrl(2))), + 'state' => true ]); } - /** - * Le compte existe - */ - } else { - // Cas 4 : le délai de blocage est dépassé et le compte est au max - Réinitialiser - if ($this->getData(['user',$userId,'connectTimeout']) + $this->getData(['config', 'connect', 'timeout']) < time() - AND $this->getData(['user',$userId,'connectFail']) === $this->getData(['config', 'connect', 'attempt']) ) { - $this->setData(['user',$userId,'connectFail',0 ]); - $this->setData(['user',$userId,'connectTimeout',0 ]); + // Sinon notification d'échec + } else { + $notification = 'Captcha, identifiant ou mot de passe incorrects'; + $logStatus = $captcha === true ? 'Erreur de mot de passe' : 'Erreur de captcha'; + // Cas 1 le nombre de connexions est inférieur aux tentatives autorisées : incrément compteur d'échec + if ($this->getData(['user',$userId,'connectFail']) < $this->getData(['config', 'connect', 'attempt'])) { + $this->setData(['user',$userId,'connectFail',$this->getdata(['user',$userId,'connectFail']) + 1 ]); } - // Check la présence des variables et contrôle du blocage du compte si valeurs dépassées - // Vérification du mot de passe et du groupe - if ( - ( $this->getData(['user',$userId,'connectTimeout']) + $this->getData(['config', 'connect', 'timeout']) ) < time() - AND $this->getData(['user',$userId,'connectFail']) < $this->getData(['config', 'connect', 'attempt']) - AND password_verify($this->getInput('userLoginPassword', helper::FILTER_STRING_SHORT, true), $this->getData(['user', $userId, 'password'])) - AND $this->getData(['user', $userId, 'group']) >= self::GROUP_MEMBER - ) { - // RAZ - $this->setData(['user',$userId,'connectFail',0 ]); - $this->setData(['user',$userId,'connectTimeout',0 ]); - // Expiration - $expire = $this->getInput('userLoginLongTime') ? strtotime("+1 year") : 0; - $c = $this->getInput('userLoginLongTime', helper::FILTER_BOOLEAN) === true ? 'true' : 'false'; - setcookie('ZWII_USER_ID', $userId, $expire, helper::baseUrl(false, false) , '', helper::isHttps(), true); - setcookie('ZWII_USER_PASSWORD', $this->getData(['user', $userId, 'password']), $expire, helper::baseUrl(false, false), '', helper::isHttps(), true); - setcookie('ZWII_USER_LONGTIME', $c, $expire, helper::baseUrl(false, false), '', helper::isHttps(), true); - // Accès multiples avec le même compte - $this->setData(['user',$userId,'accessCsrf',$_SESSION['csrf']]); - // Valeurs en sortie lorsque le site est en maintenance et que l'utilisateur n'est pas administrateur - if( - $this->getData(['config', 'maintenance']) - AND $this->getData(['user', $userId, 'group']) < self::GROUP_ADMIN - ) { - $this->addOutput([ - 'notification' => 'Seul un administrateur peut se connecter lors d\'une maintenance', - 'redirect' => helper::baseUrl(), - 'state' => false - ]); - } else { - // Valeurs en sortie - $this->addOutput([ - 'notification' => 'Bienvenue ' . $this->getData(['user',$userId,'firstname']) . ' ' . $this->getData(['user',$userId,'lastname']) , - 'redirect' => helper::baseUrl() . str_replace('_', '/', str_replace('__', '#', $this->getUrl(2))), - 'state' => true - ]); - } - // Sinon notification d'échec - } else { - $notification = 'Identifiant ou mot de passe incorrects'; - // Cas 1 le nombre de connexions est inférieur aux tentatives autorisées : incrément compteur d'échec - if ($this->getData(['user',$userId,'connectFail']) < $this->getData(['config', 'connect', 'attempt'])) { - $this->setData(['user',$userId,'connectFail',$this->getdata(['user',$userId,'connectFail']) + 1 ]); - } - // Cas 2 la limite du nombre de connexion est atteinte : placer le timer - if ( $this->getdata(['user',$userId,'connectFail']) == $this->getData(['config', 'connect', 'attempt']) ) { - $this->setData(['user',$userId,'connectTimeout', time()]); - } - // Cas 3 le délai de bloquage court - if ($this->getData(['user',$userId,'connectTimeout']) + $this->getData(['config', 'connect', 'timeout']) > time() ) { - $notification = 'Accès bloqué ' . ($this->getData(['config', 'connect', 'timeout']) / 60) . ' minutes.'; - } - // Journalisation - $dataLog = mb_detect_encoding(strftime('%d/%m/%y',time()), 'UTF-8', true) - ? strftime('%d/%m/%y',time()) . ';' . strftime('%R',time()) . ';' - : utf8_encode(strftime('%d/%m/%y',time())) . ';' . utf8_encode(strftime('%R',time())) . ';' ; - $dataLog .= helper::getIp() . ';'; - $dataLog .= $userId . ';' ; - $dataLog .= $this->getUrl() .';' ; - $dataLog .= 'échec de connexion' ; - $dataLog .= PHP_EOL; - if ($this->getData(['config','connect','log'])) { - file_put_contents(self::DATA_DIR . 'journal.log', $dataLog, FILE_APPEND); - } - // Valeurs en sortie - $this->addOutput([ - 'notification' => $notification - ]); + // Cas 2 la limite du nombre de connexion est atteinte : placer le timer + if ( $this->getdata(['user',$userId,'connectFail']) == $this->getData(['config', 'connect', 'attempt']) ) { + $this->setData(['user',$userId,'connectTimeout', time()]); } + // Cas 3 le délai de bloquage court + if ($this->getData(['user',$userId,'connectTimeout']) + $this->getData(['config', 'connect', 'timeout']) > time() ) { + $notification = 'Accès bloqué ' . ($this->getData(['config', 'connect', 'timeout']) / 60) . ' minutes.'; + } + + // Valeurs en sortie + $this->addOutput([ + 'notification' => $notification + ]); } } } + // Journalisation + $dataLog = mb_detect_encoding(strftime('%d/%m/%y',time()), 'UTF-8', true) + ? strftime('%d/%m/%y',time()) . ';' . strftime('%R',time()) . ';' + : utf8_encode(strftime('%d/%m/%y',time())) . ';' . utf8_encode(strftime('%R',time())) . ';' ; + $dataLog .= helper::getIp() . ';'; + $dataLog .= $this->getInput('userLoginId', helper::FILTER_ID) . ';' ; + $dataLog .= $this->getUrl() .';' ; + $dataLog .= $logStatus ; + $dataLog .= PHP_EOL; + if ($this->getData(['config','connect','log'])) { + file_put_contents(self::DATA_DIR . 'journal.log', $dataLog, FILE_APPEND); + } + // Stockage des cookies if (!empty($_COOKIE['ZWII_USER_ID'])) { self::$userId = $_COOKIE['ZWII_USER_ID']; } diff --git a/module/blog/blog.php b/module/blog/blog.php index 5cb40fb2..110d92f0 100755 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -81,13 +81,13 @@ class blog extends common { public static $articleConsent = [ self::EDIT_ALL => 'Tous les groupes', self::EDIT_GROUP => 'Groupe du propriétaire', - self::EDIT_OWNER => 'Propiétaire' + self::EDIT_OWNER => 'Propriétaire' ]; public static $users = []; - const BLOG_VERSION = '4.1'; + const BLOG_VERSION = '4.2'; /** * Flux RSS @@ -627,22 +627,28 @@ class blog extends common { foreach($this->getData(['user']) as $userId => $user) { if ($user['group'] >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentGroupNotification']) ) { $to[] = $user['mail']; + $firstname[] = $user['firstname']; + $lastname[] = $user['lastname']; } } // Envoi du mail $sent code d'erreur ou de réussite $notification = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentApproved']) === true ? 'Commentaire déposé en attente d\'approbation': 'Commentaire déposé'; if ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentNotification']) === true) { - $sent = $this->sendMail( - $to, - 'Nouveau commentaire déposé', - 'Bonjour' . ' ' . $user['firstname'] . ' ' . $user['lastname'] . ',

' . - 'L\'article ' . $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'title']) . ' a reçu un nouveau commentaire.

', - '' - ); + $error = 0; + foreach($to as $key => $adress){ + $sent = $this->sendMail( + $adress, + 'Nouveau commentaire déposé', + 'Bonjour' . ' ' . $firstname[$key] . ' ' . $lastname[$key] . ',

' . + 'L\'article ' . $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'title']) . ' a reçu un nouveau commentaire.

', + '' + ); + if( $sent === false) $error++; + } // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseUrl() . $this->getUrl() . '#comment', - 'notification' => ($sent === true ? $notification . '
Une notification a été envoyée.' : $notification . '
Erreur de notification : ' . $sent), + 'notification' => ($error === 0 ? $notification . '
Une notification a été envoyée.' : $notification . '
Erreur de notification : ' . $sent), 'state' => ($sent === true ? true : null) ]); diff --git a/site/data/.htaccess b/site/data/.htaccess index 2d900f16..ff0d5418 100755 --- a/site/data/.htaccess +++ b/site/data/.htaccess @@ -1,14 +1,5 @@ # Bloque l'accès aux données - + Order deny,allow Deny from all - - - Order deny,allow - Deny from all - -# Bloque l'accès htaccess - - Order deny,allow - Deny from all - \ No newline at end of file + \ No newline at end of file