Example #1
0
            echo loginByProvider($provider);
            break;
        case 'login':
            $username = $_POST['username'];
            $password = $_POST['password'];
            echo login($username, $password);
            break;
        case 'logout':
            echo logout();
            break;
        case 'lostPassword':
            $email = $_POST['email'];
            echo lostPassword($email);
            break;
        case 'checkSessionAuth':
            echo checkSessionAuth();
            break;
    }
}
function checkSessionAuth()
{
    if ($_SESSION['user_auth'] === '1') {
        return true;
    } else {
        return false;
    }
}
function loginByProvider($provider)
{
    global $bdd;
    global $_TABLES;
Example #2
0
{
    header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
}
ae_nocache();
session_start();
ini_set('display_errors', 1);
$USERLOGGEDIN = false;
$BODY = "<div id=innercontent>";
require_once "mysql.inc.php";
require_once "auth.lib.php";
mysqlConnect();
if (checkSessionAuth() == true) {
    $USERLOGGEDIN = true;
}
if (!isset($_GET['page'])) {
    $page = "home";
} else {
    $page = $_GET['page'];
    if ($page == "") {
        $page = "home";
    }
}
if ($page == "login") {
    require_once "ui/login.lib.php";
    checkLogin($USERLOGGEDIN);
    if ($USERLOGGEDIN == true) {
        $BODY .= "Login Successful! <a href='index.php?page=home'>Click Here</a>.";
Example #3
0
    mkdir($sessdir, 0777);
}
ini_set('session.save_path', $sessdir);
function ae_nocache()
{
    header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
}
ae_nocache();
session_start();
ini_set('display_errors', 1);
require_once "../auth.lib.php";
require_once "../mysql.inc.php";
mysqlConnect();
if (!checkSessionAuth()) {
    showWarning(1);
    exit(1);
}
if (isLevelCompleted($LEVELNAME)) {
    showWarning(2);
    exit(1);
}
$USERLOGGEDIN = true;
updateUserAttempt($LEVELNAME);
$LEVELPOINTS = getLevelPoints($LEVELNAME);
?>