<?php
/**
 * SyberFrame (PHP Framework)
 *
 * @version      0.1, 06/21/2004
 * @author      David Lundgren <dlundgren@syberisle.net>
 * @copyright    2004 SyberIsle Productions. All Rights Reserved
 */
/* sanitize PHP_SELF */
$_SERVER['PHP_SELF'] = str_replace($_SERVER['PATH_INFO'], ''$_SERVER['PHP_SELF']);

if(
false == isset($_POST)) $_POST = &$HTTP_POST_VARS;
unset(
$gCfg);
unset(
$gCurrent);
unset(
$gVars);
/* Initial Requirements */
require_once('config.php');
//require_once('libraries/gacl/gacl.class.php');
//require_once('libraries/gacl/gacl_api.class.php');
require_once('libraries/SipTemplate.class.php');
require_once(
'libraries/SipModule.class.php');
require_once(
'libraries/SipCode.class.php');
require_once(
'libraries/SipProgram.class.php');
require_once(
'libraries/ExternalCode.class.php');

/* Do the session stuff */
session_name($gCfg['session']['name']);
session_start();

/* Define the base theme, and the base template */
$gCurrent['name_display'] = (false == $_SESSION['user']['name_display']) ? $gCfg['name_display'][($gCfg['defaults']['name_display'])]['style'] : $gCfg['name_display'][($_SESSION['user']['name_display'])]['style'];
$gCurrent['date_display'] = (false == $_SESSION['user']['date_display']) ? $gCfg['date_display'][($gCfg['defaults']['date_display'])]['style'] : $gCfg['date_display'][($_SESSION['user']['date_display'])]['style'];
$gCurrent['theme'] = $gCfg['themes'][($gCfg['defaults']['theme'])];
$gCurrent['theme_path'] = $gCfg['paths']['base_dir'] . '/themes/' $gCurrent['theme']['path'];
$gCurrent['tpl_path'] = $gCfg['paths']['base_dir'] . '/themes/' $gCurrent['theme']['path'] . '/templates/';
$gCfg['current'] = $gCurrent;

/* global configuration into the vars */
$gVars $gCfg['urls'];
$gVars['css'] = $gCfg['urls']['theme'] . $gCurrent['theme']['path'] . '/css/';
$gVars['theme_path'] = $gCfg['urls']['theme'] . $gCurrent['theme']['path'] . '/';
$gVars['theme'] = $gCurrent['theme']['path'];

if (!
preg_match('#/index\.#i'$_SERVER['REQUEST_URI'])) {
    
$_GET['module'] = $_POST['module'] = 'Page';
    
// switch to the page module
}
elseif (
'/' == $_SERVER['REQUEST_URI']) {
    
$_GET['module'] = $_POST['module'] = 'Page';
    if (
$_SESSION['user']['email'] == 'Guest') {
        
$_GET['page'] = 'index';
    }
}

$mod = new SipProgram();
$mod->execute();
$mod->display();