Esempio n. 1
0
$pwd = filter_input(INPUT_POST, 'p', FILTER_SANITIZE_STRING);
if (isset($username, $pwd) && $username != '' && $pwd != '') {
    $userid = getDetails($username, 'User ID');
    $user = User::createUserLoginDetails($userid);
    //Check if the user is currently locked out
    if ($user->getLocked()) {
        //$locktime = strtotime($details[0]['Locked Time']);
        $locktime = strtotime($user->getLockedTime());
        if ($locktime + 15 * 60 > time()) {
            //Still locked out so display message
            $message = "You have entered incorrect details too many times and have been temporarily locked out. Please come back soon and try again.";
            $desc = "The account for '{$username}' has been locked due to too many login attempts.";
            infoLog($desc);
            returnToPageError($message, $username);
        } else {
            unlockUser($userid);
            clearFailedLogins($userid);
            $user = User::createUserLoginDetails($userid);
        }
    }
    $random_salt = $user->getSalt();
    $pwd = hash('sha512', $pwd . $random_salt);
    if ($pwd === $user->getPassword()) {
        if ($user->getRole() === 'STUDENT') {
            $_SESSION['user'] = Student::createStudentFromId($userid);
        } else {
            $_SESSION['user'] = Teacher::createTeacherFromId($userid);
        }
        clearFailedLogins($userid);
        $_SESSION['timeout'] = time();
        $message = "User {$userid} has been successfully logged in.";
Esempio n. 2
0
    <body onload='javascript:alert ("User is successfully kicked!");'></body>
	<?php 
        }
    }
    //header("Location: " . $HTTP_SERVER_VARS['PHP_SELF'].'?part=4&class_type=Settings&itemID_=7&busItem=Settings&permit_type=Settings&settings_type=UserManager&item_id=Settings&com=kick');
}
if ($frmBtnUnlock == "Unlock User") {
    $checkif = @mysql_query("select lockout from ebpls_user where id = '{$frmId}'");
    $checkiff = @mysql_fetch_assoc($checkif);
    if ($checkiff[lockout] == "") {
        ?>
        <body onload='javascript:alert ("Cannot Unlock open user!"); return false;'></body>
        <?php 
    } else {
        $frmThreadId = $frmId;
        unlockUser($frmThreadId);
        $frmBtnUnlock = "";
        ?>
        <body onload='javascript:alert ("User is successfully unlocked!!");'></body>
        <?php 
    }
    //	header("Location: " . $HTTP_SERVER_VARS['PHP_SELF'].'?part=4&class_type=Settings&itemID_=7&busItem=Settings&permit_type=Settings&settings_type=UserManager&item_id=Settings&com=unlock');
}
?>


<?php 
// ********************** START HERE **********************
echo "<div align=\"CENTER\" class=\"thText\">\n";
require_once "lib/dbhtmltable.class.php";
$objDbTable = new DbHtmlTable($thThemeColor3, $thThemeColor4, "ARIAL,HELVETICA,SANS-SERIF", "2", null, 550, 1, 2);