-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·61 lines (49 loc) · 1.74 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
60
61
<?php
/**
* Site Initialization
*
* @author Christopher Troup <[email protected]>
* @package CMS
* @subpackage Core
* @version 2.0
*/
if(($_SERVER['HTTPS'] != 'on' || $_SERVER['HTTP_HOST'] != 'www.safeballot.com') && $_SERVER['SERVER_ADDR'] != '127.0.1.1'){
header("Location: https://www.safeballot.com".$_SERVER['REQUEST_URI']);
}
header("p3p: CP=\"ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV\"");
/*
* 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('/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' );
}
//Config::setModuleOptions('CMS', array('name'=>'Safeballot', 'defaultPage'=>'Home', 'defaultPageTitle'=>'Safeballot'));
?>