LOGINFAILED LOG

Cuando el usuario falla 3 veces consecutivas el logeo, se crea si no existiese, el file shared/log/loginFailed.log y se agrega un nuevo registro con los siguientes datos:

2014-07-02 16:55:22  |  Many failed authentication attempts for USER: admin  |  IP: 192.168.10.109  |   WS: dmuz  |  Browser: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36
This commit is contained in:
jennylee
2014-07-02 17:07:33 -04:00
parent f195af5132
commit f77fe56284

View File

@@ -54,7 +54,7 @@ try {
if (isset($_SESSION['__AUTH_ERROR__'])) {
G::SendMessageText($_SESSION['__AUTH_ERROR__'], "warning");
unset($_SESSION['__AUTH_ERROR__']);
}
}
break;
//The user is inactive
case -3:
@@ -131,6 +131,20 @@ try {
}
}
//LOG Filed authentications
$filedTimes = (defined(PPP_FAILED_LOGINS)) ? PPP_FAILED_LOGINS : 3;
if($_SESSION['FAILED_LOGINS'] > $filedTimes){
$ip = G::getIpAddress();
$browser = $_SERVER['HTTP_USER_AGENT'];
$path = PATH_DATA;
$message = date('Y-m-d H:i:s'). " | Many failed authentication attempts for USER: " . $usr . " | IP: " . $ip . " | WS: " . SYS_SYS . " | Browser: " .$browser ." \n" ;
$file = "loginFailed.log";
G::log($message, $path, $file);
}
G::header("location: $loginUrl");
die;
}