diff --git a/workflow/engine/methods/login/authentication.php b/workflow/engine/methods/login/authentication.php index f95c984e0..2f7c512a6 100644 --- a/workflow/engine/methods/login/authentication.php +++ b/workflow/engine/methods/login/authentication.php @@ -112,7 +112,7 @@ try { $_SESSION["USERNAME_PREVIOUS1"] = (isset($_SESSION["USERNAME_PREVIOUS2"]))? $_SESSION["USERNAME_PREVIOUS2"] : ""; $_SESSION["USERNAME_PREVIOUS2"] = $usr; - $_SESSION["FAILED_LOGINS"] = (isset($frm['FAILED_LOGINS']))? $frm['FAILED_LOGINS'] : 0; + $_SESSION["FAILED_LOGINS"] = is_numeric(Cache::get("FAILED_LOGINS{$usr}")) ? Cache::get("FAILED_LOGINS{$usr}") : 0; if (!isset($uid) || $uid < 0) { if ($_SESSION["USERNAME_PREVIOUS1"] != "" && $_SESSION["USERNAME_PREVIOUS2"] != "" && $_SESSION["USERNAME_PREVIOUS1"] != $_SESSION["USERNAME_PREVIOUS2"]) { @@ -139,6 +139,7 @@ try { $oStatement = $oConnection->prepareStatement("UPDATE USERS SET USR_STATUS = 'INACTIVE' WHERE USR_UID = '" . $sUserUID . "'"); $oStatement->executeQuery(); unset($_SESSION['FAILED_LOGINS']); + Cache::forget("FAILED_LOGINS{$usr}"); $errLabel = G::LoadTranslation('ID_ACCOUNT') . ' "' . $usr . '" ' . G::LoadTranslation('ID_ACCOUNT_DISABLED_CONTACT_ADMIN'); } //Log failed authentications @@ -267,6 +268,7 @@ try { //$_SESSION['USR_ROLENAME'] = $rol['ROL_NAME']; unset($_SESSION['FAILED_LOGINS']); + Cache::forget("FAILED_LOGINS{$usr}"); // Assign the uid of user to userloggedobj $RBAC->loadUserRolePermission($RBAC->sSystem, $uid); diff --git a/workflow/engine/methods/login/login.php b/workflow/engine/methods/login/login.php index 0fc9612a2..105b6a1f7 100644 --- a/workflow/engine/methods/login/login.php +++ b/workflow/engine/methods/login/login.php @@ -1,5 +1,6 @@ aConfig["login_defaultLanguage"]) && $oConf->aConfig["login_de $G_PUBLISH = new Publisher(); $version = explode('.', trim(file_get_contents(PATH_GULLIVER . 'VERSION'))); $version = isset($version[0]) ? intval($version[0]) : 0; -$aFields["FAILED_LOGINS"] = $sFailedLogins; +Cache::put("FAILED_LOGINS{$usernamePrevious2}", $sFailedLogins, 1800); //this value will be lost after 30 minutes if ($version >= 3) { $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/loginpm3', '', $aFields, SYS_URI . 'login/authentication.php'); } else { diff --git a/workflow/engine/xmlform/login/loginpm3.html b/workflow/engine/xmlform/login/loginpm3.html index cb5ccfb95..df8f0d053 100644 --- a/workflow/engine/xmlform/login/loginpm3.html +++ b/workflow/engine/xmlform/login/loginpm3.html @@ -16,8 +16,6 @@ {$form.USR_PASSWORD_MASK} {$form.USER_LANG} {$form.URL} - {$form.FAILED_LOGINS} -