Esempio n. 1
0
    $action = chop($HTTP_GET_VARS["action"]);
}
$target_passed = 0;
$login_failed = 0;
if ($target == "") {
    $target = "index.php";
} else {
    $target_passed = 1;
}
if ($action == "login") {
    $userid = chop($HTTP_POST_VARS["rollno"]);
    $pass = chop($HTTP_POST_VARS["passwd"]);
    if (XMEC::authenticate_user()) {
        XMEC::user_logout();
    }
    if (!XMEC::user_login($userid, $pass)) {
        //header("Location: failedlogin.php");
        //exit;
        $login_failed = 1;
    } else {
        header("Location: {$target}");
        exit;
    }
} else {
    if ($action == "logout") {
        XMEC::user_logout();
        header("Location: {$target}");
        exit;
    }
}
//$target = urlencode($target);