示例#1
0
    if (isUserInLoginWaitingPeriod($_POST['email']) == TRUE) {
        $title = "Too Many Unsuccessful Login Attempts";
        $longdesc = "For each failed login attempt, the wait time until another\n            attempt can be made doubles.  Please wait a moment and try again or\n            use the password recovery tool.";
        include '/home/simpleco/demo2/app/pages_eventadmin/confirmation.inc.html.php';
        exit;
    }
    if (userIsLoggedIn()) {
        logevent($user_info['id'], NULL, 'good login');
        // reset the failed_logins field
        recordGoodLogin($user_info['id']);
        // return to index.php
        header("Location: .");
    } else {
        logevent($user_info['id'], NULL, 'bad login');
        // add to the failed_logins field
        recordBadLogin($user_info['id']);
        $title = 'Unauthorized User';
        $longdesc = "That email and password combination was not found.";
        include '/home/simpleco/demo2/app/pages_eventadmin/confirmation.inc.html.php';
        exit;
    }
}
/*
 * responds to logout attempt
 */
if (isset($_GET['logout'])) {
    logevent($user_info['id'], NULL, 'logout');
    unset($_SESSION['loggedIn']);
    unset($_SESSION['email']);
    unset($_SESSION['password']);
    header("Location: index.php");
示例#2
0
        // get the user id
        $id = userID($_SESSION['email']);
        // log the action
        logevent($id, NULL, 'good login');
        // reset the failed_logins field
        recordGoodLogin($id);
        // return to the previous page
        header("Location: .");
        exit;
    } else {
        // get the user id
        $id = userID($_POST['email']);
        // log the action
        logevent($id, NULL, 'bad login');
        // add to the failed_logins field
        recordBadLogin($id);
        // display error
        $title = "Incorrect Login";
        $longdesc = "That email/password combination does not belong to a \n            registered user or you have not verified your email address yet.";
        include $siteroot . 'demo2/app/pages_public/confirmation.inc.html.php';
        exit;
    }
}
// responds to logout attempt
if (isset($_GET['logout'])) {
    // get the user id
    $id = userID($_SESSION['email']);
    // log the action
    logevent($id, NULL, 'logout');
    // logout
    unset($_SESSION['loggedIn']);