10.2.dev21 supprimer stockage IP

This commit is contained in:
Fred Tempez 2020-06-02 11:49:19 +02:00
parent 3734697e90
commit 29e460ffad
2 changed files with 5 additions and 8 deletions

View File

@ -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;

View File

@ -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' ;