Merge pull request #2490 from Jennydmz/master

Log LoginFailed
This commit is contained in:
julceslauhub
2014-07-03 16:30:43 -04:00
5 changed files with 18 additions and 3 deletions

View File

@@ -912,7 +912,7 @@ function saveLog($sSource, $sType, $sDescription)
}
G::verifyPath(PATH_DATA . "log" . PATH_SEP, true);
G::log(date("Y-m-d H:i:s") . " | $sObject | " . $sSource . " | $sType | " . $sDescription . "\n", PATH_DATA);
G::log("| $sObject | " . $sSource . " | $sType | " . $sDescription . "\n", PATH_DATA);
} catch (Exception $e) {
//CONTINUE
}

View File

@@ -338,7 +338,7 @@ function saveLog($sSource, $sType, $sDescription)
print date ('H:i:s') . " ($sSource) $sType $sDescription <br>\n";
G::verifyPath (PATH_DATA . 'log' . PATH_SEP, true);
$message = date ('Y-m-d H:i:s') . '(' . $sSource . ') ' . $sDescription . "\n";
$message = '(' . $sSource . ') ' . $sDescription . "\n";
if ($sType == 'action') {
G::log($message, PATH_DATA);
}

View File

@@ -517,7 +517,7 @@ function saveLog($sSource, $sType, $sDescription)
print date ('H:i:s') . " ($sSource) $sType $sDescription <br>\n";
G::verifyPath (PATH_DATA . 'log' . PATH_SEP, true);
$message = date ('Y-m-d H:i:s') . '(' . $sSource . ') ' . $sDescription . "\n";
$message = '(' . $sSource . ') ' . $sDescription . "\n";
if ($sType == 'action') {
G::log($message, PATH_DATA);
}

View File

@@ -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 = "| 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;
}