-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
57 lines (51 loc) · 1.31 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
<?php
if (!headers_sent())
{
if (isset($_GET['session_id']))
{
$session_id = trim($_GET['session_id']);
$pattern = '/[a-zA-Z0-9]+/';
if (version_compare(PHP_VERSION, '5.0.0', '>='))
{
$pattern = '/[a-zA-Z0-9,-]+/';
}
if (preg_match($pattern, $session_id))
{
session_id($session_id);
}
}
session_name('CarParkBooking');
@session_start();
}
if (isset($_GET["reporting"]) && $_GET["reporting"] == '0')
{
$_SESSION["error_reporting"] = '0';
} else if (isset($_GET["reporting"]) && $_GET["reporting"]== '1') {
$_SESSION["error_reporting"] = '1';
}
if (isset($_SESSION["error_reporting"]) && $_SESSION["error_reporting"]=='1')
{
ini_set("display_errors", "On");
error_reporting(E_ALL|E_STRICT);
} else {
error_reporting(0);
}
header("Content-type: text/html; charset=utf-8");
if (!defined("ROOT_PATH"))
{
define("ROOT_PATH", dirname(__FILE__) . '/');
}
require ROOT_PATH . 'app/config/options.inc.php';
require_once PJ_FRAMEWORK_PATH . 'pjAutoloader.class.php';
pjAutoloader::register();
if (!isset($_GET['controller']) || empty($_GET['controller']))
{
header("HTTP/1.1 301 Moved Permanently");
pjUtil::redirect(PJ_INSTALL_URL . basename($_SERVER['PHP_SELF'])."?controller=pjAdmins&action=pjActionIndex");
}
if (isset($_GET['controller']))
{
$pjObserver = pjObserver::factory();
$pjObserver->init();
}
?>