source: trunk/globals/common.php @ 245

Revision 245, 2.6 KB checked in by sque, 11 months ago (diff)

Merge branches/awmn 221:235
[awmn] Allow users to delete zones and nameservers without making a request to hostmaster
[awmn] Untaint sprintf
[awmn] Don't change to php script dir
[awmn] Add support to dump list of stealth nameservers
[awmn] Add active peers search fields to hostmaster's ranges page
[awmn] Redirect errors to stderr
[awmn] Don't explicitly set owner to 'N' (#146)
[awmn] Restrict ip ranges to valid b-classes (0-255)
[awmn] Escape HTML special characters
[awmn] Use appropriate entities for < and > HTML special characters
[awmn] Add missing 'alt' attribute for 'img' element
[awmn] Close 'td' and 'tr' elements properly
[awmn] Escape HTML special characters in services URLs
[awmn] Remove end of line carriage returns

Line 
1<?php
2/*
3 * WiND - Wireless Nodes Database
4 *
5 * Copyright (C) 2005 Nikolaos Nikalexis <winner@cube.gr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 dated June, 1991.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19 *
20 */
21if (file_exists(ROOT_PATH."/install")) {
22        die("WiND error: Please delete \"install/\" folder if you have completed installation ...");
23}
24if (!file_exists(ROOT_PATH."config/config.php")) {
25        die("WiND error: Please make config/config.php file ...");
26}
27
28include_once(ROOT_PATH."globals/vars.php");
29include_once(ROOT_PATH."config/config.php");
30$vars = array_merge($vars, $config);
31include_once($vars['templates']['path'].$vars['templates']['default'].'/config.php');
32$vars = array_merge($vars, $template_config);
33include_once(ROOT_PATH."globals/functions.php");
34
35$php_start = getmicrotime();
36
37include_once(ROOT_PATH."globals/classes/mysql.php");
38include_once(ROOT_PATH."globals/classes/construct.php");
39include_once(ROOT_PATH."globals/classes/form.php");
40include_once(ROOT_PATH."globals/classes/table.php");
41
42if (!file_exists($vars['smarty']['class'])) {
43        die("WiND error: Cannot find Smarty lib. Please check config.php ...");
44}
45include_once($vars['smarty']['class']);
46
47if ($vars['template']['version'] < $vars['info']['min_template_version']
48                || $vars['template']['version'] > $vars['info']['version']) {
49        die("WiND error: Template version does not match.");
50}
51
52$smarty = new Smarty;
53$smarty->template_dir = $vars['templates']['path'].$vars['templates']['default'].'/';
54$smarty->plugins_dir = array($vars['templates']['path'].$vars['templates']['default'].'/plugins/', 'plugins');
55$smarty->compile_dir = $vars['templates']['compiled_path'].$vars['templates']['default'].'/';
56$smarty->register_modifier('stripslashes', 'stripslashes');
57reset_smarty();
58
59$construct = new construct;
60
61if ($vars['mail']['smtp'] != '') {
62        ini_set('SMTP', $vars['mail']['smtp']);
63        ini_set('smtp_port', $vars['mail']['smtp_port']);
64}
65
66$db = new mysql($vars['db']['server'], $vars['db']['username'], $vars['db']['password'], $vars['db']['database']);
67
68if ($db->error) {
69        die("WiND MySQL database error: $db->error_report");
70}
71
72?>
Note: See TracBrowser for help on using the repository browser.