From ff6ff61c00920df8a8c39ef08d08c326aa6c92ca Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Fri, 11 Jul 2014 12:07:24 -0400 Subject: [PATCH] BUG 15419 Notificaciones incorrectas aplicando PPP_FAILED_LOGINS SOLVED - The message was overwrited with the standard message - Now the message is displayed correctly and I made some improvements in the PPP functionality --- .../engine/methods/login/authentication.php | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/workflow/engine/methods/login/authentication.php b/workflow/engine/methods/login/authentication.php index c25eb35e5..be9903e58 100755 --- a/workflow/engine/methods/login/authentication.php +++ b/workflow/engine/methods/login/authentication.php @@ -93,7 +93,7 @@ try { } if (!isset($uid) || $uid < 0) { - if (isset($_SESSION['FAILED_LOGINS'])) { + if (isset($_SESSION['FAILED_LOGINS']) && ($uid == -1 || $uid == -2)) { $_SESSION['FAILED_LOGINS']++; } if (!defined('PPP_FAILED_LOGINS')) { @@ -113,8 +113,13 @@ try { $oStatement = $oConnection->prepareStatement("UPDATE USERS SET USR_STATUS = 'INACTIVE' WHERE USR_UID = '" . $sUserUID . "'"); $oStatement->executeQuery(); unset($_SESSION['FAILED_LOGINS']); - G::SendMessageText(G::LoadTranslation('ID_ACCOUNT') . ' "' . $usr . '" ' . G::LoadTranslation('ID_ACCOUNT_DISABLED_CONTACT_ADMIN'), 'warning'); + $errLabel = G::LoadTranslation('ID_ACCOUNT') . ' "' . $usr . '" ' . G::LoadTranslation('ID_ACCOUNT_DISABLED_CONTACT_ADMIN'); } + //Log failed authentications + $message = "| Many failed authentication attempts for USER: " . $usr . " | IP: " . G::getIpAddress() . " | WS: " . SYS_SYS; + $message .= " | BROWSER: " . $_SERVER['HTTP_USER_AGENT'] ." | \n" ; + + G::log($message, PATH_DATA, 'loginFailed.log'); } } @@ -131,20 +136,6 @@ 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; }