From 43de9af71f7f4ca5731b94a06d688ae8412ba427 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Fri, 6 Jul 2018 11:14:41 +0200 Subject: 2018/Feb/28 -i állapot hozzáadva, mint a módosítások kiindulási állapota --- mayor-orig/www/policy/public/auth/login-pre.php | 86 +++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 mayor-orig/www/policy/public/auth/login-pre.php (limited to 'mayor-orig/www/policy/public/auth/login-pre.php') diff --git a/mayor-orig/www/policy/public/auth/login-pre.php b/mayor-orig/www/policy/public/auth/login-pre.php new file mode 100644 index 00000000..c524751f --- /dev/null +++ b/mayor-orig/www/policy/public/auth/login-pre.php @@ -0,0 +1,86 @@ + $userAccount, 'password' => $userPassword, 'policy' => $toPolicy, 'skin'=>$toSkin); + if ($sessionID != '') $accountInformation['sessionID'] = $sessionID; + + if ($userAccount != '' and $userPassword != '') { + + $result = userAuthentication($userAccount, $userPassword, $accountInformation, $toPolicy); // ??? toPolicy benne van az AccountInformation-ben!!! Ldap backend only? + logLogin($toPolicy, $userAccount, $result); + if ($result === _AUTH_SUCCESS) { + $sessionID = newSession($accountInformation, $toPolicy); + if ($toSkin == '') $toSkin = $skin; + header('Location: '.location("index.php?page=$toPage&sub=$toSub&f=$toF&sessionID=$sessionID&policy=$toPolicy&lang=$lang&skin=$toSkin", array('alertOLD'))); + } elseif ($result === _AUTH_EXPIRED) { + $_SESSION['alert'][] = 'message:force_pw_update'; + header('Location: '.location("index.php?policy=public&page=password&f=changeMyPassword&userAccount=".$userAccount."&toPolicy=$toPolicy&skin=$toSkin", array('alertOLD'))); + } elseif ($result >= _AUTH_FAILURE) { + // sikertelen azonosítás - a hibaüzenetet a függvény generálja + //$NOF = @getFailedLoginCount($toPolicy,$userAccount); + //if ($NOF>1) sleep(min($NOF,10,rand(1,10))); // harden brute force attempts + } else { + // Ilyen csak hibás függvényműködés esetén lehet: + $_SESSION['alert'][] = "message:default:hibás visszatérési érték:userAuthentication:($result)"; + } + } else { + $_SESSION['alert'][] = 'message:empty_field'; + } + } + +?> -- cgit v1.2.3