3
* Xibo - Digitial Signage - http://www.xibo.org.uk
4
* Copyright (C) 2006,2007,2008 Daniel Garner and James Packer
6
* This file is part of Xibo.
8
* Xibo is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Affero General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
13
* Xibo is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Affero General Public License for more details.
18
* You should have received a copy of the GNU Affero General Public License
19
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
21
defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");
23
// No errors reported until we read the settings from the DB
25
ini_set('display_errors', 0);
26
ini_set('gd.jpeg_ignore_warning', 1);
28
// Required Library Files
29
require_once("lib/app/translationengine.class.php");
30
require_once("lib/app/debug.class.php");
31
require_once("lib/app/kit.class.php");
32
require_once("lib/app/pagemanager.class.php");
33
require_once("lib/app/menumanager.class.php");
34
require_once("lib/app/modulemanager.class.php");
35
require_once("lib/app/formmanager.class.php");
36
require_once("lib/app/helpmanager.class.php");
37
require_once("lib/app/responsemanager.class.php");
38
require_once("lib/app/datemanager.class.php");
39
require_once("lib/app/app_functions.php");
40
require_once("lib/modules/module.interface.php");
41
require_once("lib/modules/module.class.php");
42
require_once("lib/data/data.class.php");
43
require_once("lib/app/session.class.php");
45
// Required Config Files
46
require_once("config/config.class.php");
47
require_once("config/db_config.php");
49
// Sort out Magic Quotes
50
if (get_magic_quotes_gpc())
52
function stripslashes_deep($value)
54
$value = is_array($value) ?
55
array_map('stripslashes_deep', $value) :
61
$_POST = array_map('stripslashes_deep', $_POST);
62
$_GET = array_map('stripslashes_deep', $_GET);
63
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
64
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
68
* Before we do anything else, lets check to see if we have a settings.php file
69
* Without that file we can deduce that
70
* a) This is a first time install
71
* b) This is a corrupt or failed install
73
if (!file_exists("settings.php"))
75
Kit::Redirect("install.php");
79
if (file_exists("upgrade.php"))
81
Kit::Redirect("upgrade.php");
85
// parse and init the settings.php
88
// create a database class instance
91
if (!$db->connect_db($dbhost, $dbuser, $dbpass))
93
die('Xibo has a database connection problem.');
96
if (!$db->select_db($dbname))
98
die('Xibo has a database connection problem.');
101
date_default_timezone_set(Config::GetSetting($db, "defaultTimezone"));
103
// Error Handling (our error handler requires a DB connection
104
set_error_handler(array(new Debug(), "ErrorHandler"));
106
// Define the VERSION
107
Config::Version($db);
109
// What is the production mode of the server?
110
if(Config::GetSetting($db, "SERVER_MODE")=="Test") ini_set('display_errors', 1);
113
if(Config::GetSetting($db, "debug")=="On") error_reporting(E_ALL);
115
// Setup the translations for gettext
116
TranslationEngine::InitLocale($db);
118
// Create login control system
119
require_once('modules/' . Config::GetSetting($db, "userModule"));
121
$user = new User($db);
122
$session = new Session($db);
124
// Page variable set? Otherwise default to index
125
$page = Kit::GetParam('p', _REQUEST, _WORD, 'index');
127
// Assign the page name to the session
128
$session->set_page(session_id(), $page);
131
$pageManager = new PageManager($db, $user, $page);
132
$pageManager->Authenticate();
133
$pageManager->Render();
3
* Xibo - Digitial Signage - http://www.xibo.org.uk
4
* Copyright (C) 2006,2007,2008 Daniel Garner and James Packer
6
* This file is part of Xibo.
8
* Xibo is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Affero General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
13
* Xibo is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Affero General Public License for more details.
18
* You should have received a copy of the GNU Affero General Public License
19
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
21
defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");
23
// No errors reported until we read the settings from the DB
25
ini_set('display_errors', 0);
26
ini_set('gd.jpeg_ignore_warning', 1);
28
// Required Library Files
29
require_once("lib/app/translationengine.class.php");
30
require_once("lib/app/debug.class.php");
31
require_once("lib/app/kit.class.php");
32
require_once("lib/app/pagemanager.class.php");
33
require_once("lib/app/menumanager.class.php");
34
require_once("lib/app/modulemanager.class.php");
35
require_once("lib/app/formmanager.class.php");
36
require_once("lib/app/helpmanager.class.php");
37
require_once("lib/app/responsemanager.class.php");
38
require_once("lib/app/datemanager.class.php");
39
require_once("lib/app/app_functions.php");
40
require_once("lib/modules/module.interface.php");
41
require_once("lib/modules/module.class.php");
42
require_once("lib/data/data.class.php");
43
require_once("lib/app/session.class.php");
45
// Required Config Files
46
require_once("config/config.class.php");
47
require_once("config/db_config.php");
49
// Sort out Magic Quotes
50
if (get_magic_quotes_gpc())
52
function stripslashes_deep($value)
54
$value = is_array($value) ?
55
array_map('stripslashes_deep', $value) :
61
$_POST = array_map('stripslashes_deep', $_POST);
62
$_GET = array_map('stripslashes_deep', $_GET);
63
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
64
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
68
* Before we do anything else, lets check to see if we have a settings.php file
69
* Without that file we can deduce that
70
* a) This is a first time install
71
* b) This is a corrupt or failed install
73
if (!file_exists("settings.php"))
75
Kit::Redirect("install.php");
79
if (file_exists("upgrade.php"))
81
Kit::Redirect("upgrade.php");
85
// parse and init the settings.php
88
// create a database class instance
91
if (!$db->connect_db($dbhost, $dbuser, $dbpass))
93
die('Xibo has a database connection problem.');
96
if (!$db->select_db($dbname))
98
die('Xibo has a database connection problem.');
101
date_default_timezone_set(Config::GetSetting($db, "defaultTimezone"));
103
// Error Handling (our error handler requires a DB connection
104
set_error_handler(array(new Debug(), "ErrorHandler"));
106
// Define the VERSION
107
Config::Version($db);
109
// What is the production mode of the server?
110
if(Config::GetSetting($db, "SERVER_MODE")=="Test") ini_set('display_errors', 1);
113
if(Config::GetSetting($db, "debug")=="On") error_reporting(E_ALL);
115
// Setup the translations for gettext
116
TranslationEngine::InitLocale($db);
118
// Create login control system
119
require_once('modules/' . Config::GetSetting($db, "userModule"));
121
$user = new User($db);
122
$session = new Session($db);
124
// Page variable set? Otherwise default to index
125
$page = Kit::GetParam('p', _REQUEST, _WORD, 'index');
127
// Assign the page name to the session
128
$session->set_page(session_id(), $page);
131
$pageManager = new PageManager($db, $user, $page);
132
$pageManager->Authenticate();
133
$pageManager->Render();
b'\\ No newline at end of file'