Exemplo n.º 1
0
/*
 * responds to login form data
 */
if (isset($_GET['loginformdata'])) {
    // For each previous failed login attempt, the wait time until another
    // attempt can be made doubles.  The wait time begins with 2 seconds.
    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
 */
Exemplo n.º 2
0
 }
 // For each previous failed login attempt, the wait time until another
 // attempt can be made doubles.  The wait time begins with 2 seconds.
 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 $siteroot . 'demo2/app/pages_public/confirmation.inc.html.php';
     exit;
 }
 if (userIsLoggedIn()) {
     // 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;