2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
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 [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 define('STOP_MARK', 8);
23 define('ACTIVE_SITE', 'install.php');
25 require_once('./global.php');
29 // ###################################################################
31 if ($bugsys->in
['mark'] == 0)
34 <h1
>Welcome to Bugdar
</h1
>
36 <p
>This installer will take you through the procedure of setting up your Bugdar installation
. If you are seeing this message
, that means that your configuration file was read properly
and that your database is accessible
.</p
>
38 <p
>The following steps will initialize your database
, place the
default settings
and data in your database
, and finally ask you to enter in some settings to allow you to access the system when the installer finishes
.</p
>
40 <p
>To begin the installation process
, please click the button below
.</p
>
44 // ###################################################################
46 if ($bugsys->in
['mark'] == 1)
49 <h1
>Initializing Database
</h1
>
51 <p
>This step will load the tables into your database so the rest of the installation can proceed forward
.</p
>
55 require_once('./install/schema.php');
57 foreach ($query AS $table => $query)
60 echo 'Creating table ' . $table . '<br />' . "\n";
64 // ###################################################################
66 if ($bugsys->in
['mark'] == 2)
69 <h1
>Loading
Default Data
</h1
>
71 <p
>Default table data
for usergroups
, statuses
, priorities
, and other various options are being loaded
. This will allow you to
use Bugdar with minimal setup
.</p
>
75 require_once('./install/default_data.php');
77 foreach ($data AS $table => $records)
79 foreach ($records AS $record)
81 $fields = $values = array();
82 foreach ($record AS $field => $value)
85 $values[] = addslashes($value);
88 $db->query("INSERT INTO " . TABLE_PREFIX
. "$table (" . implode(',', $fields) . ") VALUES ('" . implode("', '", $values) . "')");
91 echo 'Populating table ' . $table . '<br />' . "\n";
94 $db->query("INSERT INTO " . TABLE_PREFIX
. "language (title, languagecode, charset, direction, filename, userselect, debug) VALUES ('English (US)', 'en', 'utf-8', 'ltr', './includes/strings/english-us.strings.xml', 1, 0)");
95 echo 'Inserting default language<br />' . "\n";
98 // ###################################################################
100 if ($bugsys->in
['mark'] == 3)
103 <h1
>Loading Settings
</h1
>
105 <p
>Default settings are being loaded into the system
.</p
>
109 class dummy {
function string() {} }
112 require_once('./includes/settings.php');
114 foreach ($config AS $varname => $setting)
116 $db->query("INSERT INTO " . TABLE_PREFIX
. "setting (varname, value) VALUES ('" . $varname . "', '" . addslashes($setting[3]) . "')");
119 echo 'Settings loaded...';
122 // ###################################################################
124 if ($bugsys->in
['mark'] == 4)
126 $value = 'http' . ($_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '') . str_replace('/install/install.php', '', $_SERVER['SCRIPT_NAME']);
128 <h1
>General Settings
</h1
>
130 <p
>These three settings are fundamental in setting up your bug tracking system
. Please fill them in to proceed with the installation
.</p
>
132 <form name
="settings-do" action
="install.php" method
="post">
133 <input type
="hidden" name
="mark" value
="5" />
135 <div
><strong
>Tracker
Name (the name of the entire tracking system
, for instance
"Acme Inc. Bug Tracker"):</strong
> <input type
="text" name
="trackertitle" size
="50" /></div
>
136 <div
><strong
>Tracker
URL (the root URL of your tracker
, we have tried to guess this
for you
; <em
>it does not end with a trailing slash
!</em
>):</strong
> <input type
="text" name
="trackerurl" size
="50" value
="<?= $value ?>" /></div
>
137 <div
><strong
>Webmaster Email
:</strong
> <input type
="text" name
="webmasteremail" size
="50" /></div
>
139 <input type
="submit" name
="submit" value
="Next Step" />
148 // ###################################################################
150 if ($bugsys->in
['mark'] == 5)
153 <h1
>New Administrator
</h1
>
155 <p
>Your settings have been saved
. Now you must create a
new administrative account
for yourself
. This account will have complete control over the system
.</p
>
157 <form name
="user-do" action
="install.php" method
="post">
158 <input type
="hidden" name
="mark" value
="6" />
160 <div
><strong
>Display Name
:</strong
> <input type
="text" name
="displayname" size
="50" /></div
>
161 <div
><strong
>Email Address
:</strong
> <input type
="text" name
="email" size
="50" /></div
>
162 <div
><strong
>Password
:</strong
> <input type
="password" name
="password" size
="50" /></div
>
164 <input type
="submit" name
="submit" value
="Next Step" />
169 $db->query("UPDATE " . TABLE_PREFIX
. "setting SET value = '" . $bugsys->in
['trackertitle'] . "' WHERE varname = 'trackertitle'");
170 $db->query("UPDATE " . TABLE_PREFIX
. "setting SET value = '" . $bugsys->in
['trackerurl'] . "' WHERE varname = 'trackerurl'");
171 $db->query("UPDATE " . TABLE_PREFIX
. "setting SET value = '" . $bugsys->in
['webmasteremail'] . "' WHERE varname = 'webmasteremail'");
176 // ###################################################################
178 if ($bugsys->in
['mark'] == 6)
183 <p
>Your
new user has been added
.</p
>
186 $bugsys->load('functions');
188 $salt = $funct->rand(15);
191 INSERT INTO " . TABLE_PREFIX
. "user
192 (email, displayname, password, salt, authkey, showemail, showcolours, usergroupid)
194 ('" . $bugsys->in
['email'] . "', '" . $bugsys->in
['displayname'] . "',
195 '" . md5(md5($bugsys->in
['password']) . md5($salt)) . "', '$salt',
196 '" . $funct->rand() . "', 1, 1, 6
201 // ###################################################################
203 if ($bugsys->in
['mark'] == 7)
208 <p
>In order to make Bugdar
as efficient
as possible
, the system caches the portions of data it can
. This reduces the load of your server without compromising usability
. Currently the caches are being built
.</p
>
211 require_once('./includes/permissions.php');
214 echo "Cached settings<br />\n";
217 echo "Cached usergroups<br />\n";
220 echo "Cached statuses<br />\n";
223 echo "Cached priorities<br />\n";
226 echo "Cached severities<br />\n";
229 echo "Cached assignable users/developers<br />\n";
232 echo "Cached resolutions<br />\n";
235 echo "Cached products<br />\n";
238 echo "Cached versions<br />\n";
241 echo "Cached user help documentation<br />\n";
244 // ###################################################################
246 if ($bugsys->in
['mark'] == 8)
249 <h1
>Load Language Strings
</h1
>
251 <p
>Bugdar
's flexible language system caches all of the strings in the database. Currently, the strings are being read from the raw file into the cache.</p>
254 class dummy { function setlex() {} function string() {} }
257 $bugsys->load('xml
', 'xml
');
261 require_once('./includes
/language
.php
');
262 build_language_cache(1);
265 // ###################################################################
269 /*=====================================================================*\
270 || ###################################################################
273 || ###################################################################
274 \*=====================================================================*/