示例#1
0
        } else {
            $fb_user = $facebook->require_login();
        }
    }
}
require_once l_r('lib/auth.php');
if (!defined('AJAX')) {
    if (isset($_REQUEST['logoff'])) {
        $success = libAuth::keyWipe();
        $User = new User(GUESTID);
        // Give him a guest $User
        header('refresh: 4; url=logon.php?noRefresh=on');
        libHTML::notice(l_t("Logged out"), l_t("You have been logged out, and are being redirected to the logon page."));
    }
    global $User;
    $User = libAuth::auth();
    if ($User->type['Admin']) {
        Config::$debug = true;
        if (isset($_REQUEST['auid']) || isset($_SESSION['auid'])) {
            $User = libAuth::adminUserSwitch($User);
        } else {
            define('AdminUserSwitch', $User->id);
        }
    } elseif ($Misc->Maintenance) {
        unset($DB);
        // This lets libHTML know there's a problem
        libHTML::error(Config::$serverMessages['Maintenance']);
    }
}
// This gets called by libHTML::footer
function close()