From 29e460ffadefbb0477fcc61ac4e6a94155c32e70 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 2 Jun 2020 11:49:19 +0200 Subject: [PATCH] 10.2.dev21 supprimer stockage IP --- core/core.php | 7 ++++--- core/module/user/user.php | 6 +----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/core/core.php b/core/core.php index 65eb3d92..0ee7916d 100755 --- a/core/core.php +++ b/core/core.php @@ -39,7 +39,7 @@ class common { const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '10.2.00.dev20'; + const ZWII_VERSION = '10.2.00.dev21'; const ZWII_UPDATE_CHANNEL = "v10"; public static $actions = []; @@ -1314,7 +1314,9 @@ class common { $this->setData(['config', 'connect', 'timeout',600]); $this->setData(['config', 'connect', 'log',false]); // Remettre à zéro le thème pour la génération du CSS du blog - unlink(self::DATA_DIR . 'theme.css'); + if (file_exists(self::DATA_DIR . 'theme.css')) { + unlink(self::DATA_DIR . 'theme.css'); + } $this->setData(['core', 'dataVersion', 10200]); } } @@ -1588,7 +1590,6 @@ class core extends common { } // Journalisation $dataLog = strftime('%d/%m/%y',time()) . ';' . strftime('%R',time()) . ';' ; - $dataLog .= $_SERVER['REMOTE_ADDR'] . ';' ; $dataLog .= $this->getUser('id') ? $this->getUser('id') . ';' : 'visiteur' . ';'; $dataLog .= $this->getUrl(); $dataLog .= PHP_EOL; diff --git a/core/module/user/user.php b/core/module/user/user.php index 133b1940..34a83c6e 100755 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -340,8 +340,6 @@ class user extends common { 'blacklist', $userId, [ - 'time' => time(), - 'ip' => $_SERVER['REMOTE_ADDR'], 'connectFail' => $this->getData(['blacklist',$userId,'connectFail']) ? $this->getData(['blacklist',$userId,'connectFail']) + 1 : 1 ] ]); @@ -406,14 +404,12 @@ class user extends common { // L'utilisateur n'existe pas // Bloquer l'IP après les tentatives autorisées avec ce compte, } elseif ( - $this->getData(['blacklist',$userId,'connectFail']) > $this->getData(['config', 'connect', 'attempt']) || - array_search($_SERVER['REMOTE_ADDR'],helper::arrayCollumn($this->getData(['blacklist']), 'ip')) + $this->getData(['blacklist',$userId,'connectFail']) > $this->getData(['config', 'connect', 'attempt']) ) { $notification = 'Trop de tentatives, compte verrouillé'; } // Journalisation $dataLog = strftime('%d/%m/%y',time()) . ';' . strftime('%R',time()) . ';' ; - $dataLog .= $_SERVER['REMOTE_ADDR'] . ';' ; $dataLog .= $userId . ';' ; $dataLog .= $this->getUrl() .';' ; $dataLog .= 'échec de connexion' ;