/
index.php
59 lines (50 loc) · 1.61 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Site Initialization
*
* @author Christopher Troup <chris@norex.ca>
* @package CMS
* @subpackage Core
* @version 2.0
*/
include_once 'include/Debugger.php';
error_reporting(E_ALL);
$debugger = Debugger::instance();
$oldErrorHandler = set_error_handler(array (&$debugger, 'errorHandler'), E_ALL);
$debugger->debug("first call");
/*
* Kicks things off with initiliziation of the general framework infrastructure.
*/
include_once 'include/Site.php';
error_reporting(E_ALL);
/*
* Assess whether we are logging in on this page request.
*/
if (isset($_REQUEST['username']) && isset($_REQUEST['password'])) {
$auth_container = new CMSAuthContainer();
$auth = new Auth($auth_container, null, 'authInlineHTML');
$auth->start();
}
if (@!isset($_REQUEST['module'])) {
$options = Config::singleton()->options;
$_REQUEST['module'] = 'Content';
$_REQUEST['page'] = $options['defaultPage'];
}
require_once 'HTML/AJAX/Helper.php';
$ajaxHelper = new HTML_AJAX_Helper ( );
if ( $ajaxHelper->isAJAX () ){
echo Module::factory($_REQUEST['module'], $smarty)->getUserInterface($_REQUEST);
} else {
//$smarty->addJS('/AJAX/server.php?client=all');
//$smarty->addJS('/js/login.js');
$smarty->addJS('/js/scriptaculous.js');
$smarty->addJS('/modules/Menu/js/sfMenus.js');
//$smarty->addJS('/js/frontend.js');
$smarty->content[$_REQUEST['module']] = Module::factory($_REQUEST['module'], $smarty)->getUserInterface($_REQUEST);
$smarty->assign ( 'module', $_REQUEST['module'] );
if (isset($_SESSION['authenticated_user'])) {
$smarty->assign ( 'user', $_SESSION['authenticated_user'] );
}
$smarty->render ( 'db:site.tpl' );
}
?>