PMCORE-4045 Manipulation of login records
This commit is contained in:
@@ -111,7 +111,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"]) {
|
||||
@@ -138,6 +138,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
|
||||
@@ -266,6 +267,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);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
@@ -246,7 +247,7 @@ if (isset($oConf->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 {
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
{$form.USR_PASSWORD_MASK}
|
||||
{$form.USER_LANG}
|
||||
{$form.URL}
|
||||
{$form.FAILED_LOGINS}
|
||||
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label class="panel-login">
|
||||
|
||||
@@ -19,7 +19,6 @@ SELECT LANG_ID, LANG_NAME FROM langOptions
|
||||
<en><![CDATA[Language]]></en>
|
||||
</USER_LANG>
|
||||
<URL type="hidden"/>
|
||||
<FAILED_LOGINS type="hidden"/>
|
||||
<LOGIN_VERIFY_MSG type="private" showInTable="0"/>
|
||||
<BSUBMIT type="button">
|
||||
<en><![CDATA[Login]]></en>
|
||||
|
||||
Reference in New Issue
Block a user