示例#1
0
文件: login.php 项目: r3-gis/EcoGIS
<?php

$scriptStartTime = microtime(true);
require_once dirname(__FILE__) . '/../../etc/config.php';
require_once R3_LIB_DIR . 'eco_app.php';
require_once R3_LIB_DIR . 'eco_utils.php';
require_once R3_LIB_DIR . 'storevar.php';
require_once R3_LANG_DIR . 'lang.php';
initLog();
// Initialize ezLog
register_shutdown_function('shutdown');
//
define('CURRENT_DOMAIN_NAME', R3EcoGisHelper::getSubDomainName($_SERVER['HTTP_HOST'], true));
/* ------------------------------ Settings ------------------------------ */
$act = initVar('act');
$status = initVar('status');
$warning = initVar('warning');
/* ------------------------------ Functions ------------------------------ */
function redirect($url)
{
    header("Location: {$url}");
    die;
}
/* ------------------------------ Authentication ------------------------------ */
if ($auth->isAuth()) {
    if ($auth->getConfigValue('APPLICATION', 'LOGON_AUTH_USER', false)) {
        // Allow to enter user already authenticate
        redirect($auth->getConfigValue('APPLICATION', 'LOGON_ACCESS_POINT', 'main.php'));
    } else {
        // force logoff
        $auth->logout();