r752: Fixing a bug that caused installation to fail for those with register_globals...
[bugdar.git] / install / global.php
1 <?php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # Bugdar [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
12
13 error_reporting(E_ALL & ~E_NOTICE);
14
15 // ###################################################################
16 // load system
17
18 chdir('./../');
19
20 define('ISSO_MT_START', microtime());
21
22 if (!file_exists('./includes/config.php'))
23 {
24 echo 'includes/config.php needs to be present!';
25 exit;
26 }
27
28 require_once('./includes/config.php');
29 $thepass = $password; // darn register_globals
30
31 define('ISSO_ESCAPE_STRINGS', 1);
32 define('ISSO_CHECK_POST_REFERER', 1);
33
34 require_once($pathtoisso . 'kernel.php');
35 $bugsys =& $_isso;
36 $bugsys->application = 'Bugdar';
37 $bugsys->apppath = $bugsys->fetch_sourcepath(getcwd());
38 $bugsys->appversion = '[#]version[#]';
39 $bugsys->debug = $debug;
40 $bugsys->sourcepath = $bugsys->fetch_sourcepath($pathtoisso);
41
42 $bugsys->load('db_mysql');
43 $db->database = $database;
44 $db->connect($servername, $username, $thepass, $usepconnect);
45
46 $bugsys->exec_sanitize_data();
47
48 define('DEVDEBUG', $debug);
49 define('TABLE_PREFIX', $tableprefix);
50 define('COOKIE_PREFIX', $cookieprefix);
51
52 unset($database, $servername, $username, $password, $usepconnect, $tableprefix, $cookieprefix);
53
54 require_once('./includes/functions_datastore.php');
55 require_once('./includes/functions.php');
56
57 // ###################################################################
58 // init the big three
59 $bugsys->options = array();
60 $bugsys->userinfo = array();
61 $bugsys->datastore = array();
62
63 // ###################################################################
64
65 $bugsys->in['mark'] = intval($bugsys->in['mark']);
66
67 // ###################################################################
68 // ###################################################################
69 // ###################################################################
70
71 // ###################################################################
72 // constructs the page header bit
73
74 function page_start()
75 {
76 ?>
77 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
78 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
79 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
80 <head>
81 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
82 <link rel="stylesheet" href="install.css" media="screen" />
83 <title>Bugdar Installer</title>
84 </head>
85 <body>
86
87 <?php
88 }
89
90 // ###################################################################
91 // puts the end of the page down
92
93 function page_end($next = true)
94 {
95 global $bugsys;
96
97 if (defined('STOP_MARK') AND $next)
98 {
99 if ($bugsys->in['mark'] >= STOP_MARK)
100 {
101 echo '<div class="buttonlink"><a href="../admin/">Go to the Administrative Control Panel</a></div>';
102 }
103 else
104 {
105 echo '<div class="buttonlink"><a href="' . ACTIVE_SITE . '?mark=' . ($bugsys->in['mark'] + 1) . '">Next Step</a></div>';
106 }
107 }
108
109 echo '
110
111 </body>
112
113 </html>';
114
115 exit;
116 }
117
118 /*=====================================================================*\
119 || ###################################################################
120 || # $HeadURL$
121 || # $Id$
122 || ###################################################################
123 \*=====================================================================*/
124 ?>