Beispiel #1
0
/**
 * Check if user is signed in
 *
 */
function chkFePage()
{
    global $_SESSION;
    global $pagePriv;
    if (!$_SESSION['fe_security']) {
        gotoURL("index.php?NotAuthorized=1");
    }
    if (!$pagePriv) {
        return null;
    }
    $find = array_search($_SESSION['fe_security'], $pagePriv);
    if (!is_bool($find)) {
        if ($find == 0) {
            $find = true;
        }
    }
    if ($find == false) {
        gotoURL("index.php?NotAuthorized=1");
    }
    if (!$_SESSION['fe_us_id']) {
        gotoURL("index.php?NotAuthorized=1");
    }
}
Beispiel #2
0
<?php

ini_set('display_errors', '0');
require_once '../include/share.php';
if ($_REQUEST['logout'] != null) {
    session_destroy();
    session_start();
}
$userinfo = getSessionData("userinfo");
if ($userinfo == null) {
    require_once "login.php";
} else {
    if ($userinfo["type"] == 1 || $userinfo["type"] == 2) {
        gotoURL("user.php");
    } else {
        gotoURL("server.php");
    }
}