forked from asxzy/Program-O
-
Notifications
You must be signed in to change notification settings - Fork 0
/
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
/***************************************
* http://www.program-o.com
* PROGRAM O
* Version: 2.6.7
* FILE: index.php
* AUTHOR: Elizabeth Perreau and Dave Morton
* DATE: 02-13-2013
* DETAILS: Program O's starting point
***************************************/
if (!file_exists('config/global_config.php'))
{
# No config exists we will run install
header('Location: install/install_programo.php');
}
else
{
$get_vars = filter_input_array(INPUT_GET);
$qs = '?';
if (!empty($get_vars))
{
$qs .= http_build_query($get_vars);
}
# Config exists we will goto the bot
$thisFile = __FILE__;
/** @noinspection PhpIncludeInspection */
require_once('config/global_config.php');
require_once(_LIB_PATH_ . '/misc_functions.php');
/** @noinspection PhpUndefinedVariableInspection */
$format = (isset($get_vars['format'])) ? $get_vars['format'] : $format;
$format = _strtolower($format);
switch ($format)
{
case 'json':
$gui = 'jquery';
break;
case 'xml':
$gui= 'xml';
break;
default:
$gui = 'plain';
}
if (!defined('SCRIPT_INSTALLED'))
{
header('Location: ' . _INSTALL_URL_ . 'install_programo.php');
}
else
{
header("Location: gui/$gui/$qs");
}
}