2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]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 \*=====================================================================*/
13 define('STOP_MARK', 7);
14 define('ACTIVE_SITE', 'install.php');
16 require_once('./global.php');
20 // ###################################################################
22 if ($bugsys->in
['mark'] == 0)
25 <h1
>Welcome to BugStrike
</h1
>
27 <p
>This installer will take you through the procedure of setting up your BugStrike installation
. If you are seeing this message
, that means that your configuration file was read properly
and that your database is accessible
.</p
>
29 <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
>
31 <p
>To begin the installation process
, please click the button below
.</p
>
35 // ###################################################################
37 if ($bugsys->in
['mark'] == 1)
40 <h1
>Initializing Database
</h1
>
42 <p
>This step will load the tables into your database so the rest of the installation can proceed forward
.</p
>
46 require_once('./install/schema.php');
48 foreach ($query AS $table => $query)
51 echo 'Creating table ' . $table . '<br />' . "\n";
55 // ###################################################################
57 if ($bugsys->in
['mark'] == 2)
60 <h1
>Loading
Default Data
</h1
>
62 <p
>Default table data
for usergroups
, statuses
, priorities
, and other various options are being loaded
. This will allow you to
use BugStrike with minimal setup
.</p
>
66 require_once('./install/default_data.php');
68 foreach ($data AS $table => $records)
70 foreach ($records AS $record)
72 $fields = $values = array();
73 foreach ($record AS $field => $value)
76 $values[] = addslashes($value);
79 $db->query("INSERT INTO " . TABLE_PREFIX
. "$table (" . implode(',', $fields) . ") VALUES ('" . implode("', '", $values) . "')");
82 echo 'Populating table ' . $table . '<br />' . "\n";
85 $db->query("INSERT INTO " . TABLE_PREFIX
. "product (componentmother, shortname, displayorder, title, description) VALUES (0, 'main', 10, 'Main Product', 'Default product from installer')");
86 $db->query("INSERT INTO " . TABLE_PREFIX
. "version (productid, version, displayorder) VALUES (1, 'Main Version', 100)");
88 echo 'Inserting default product and version<br />' . "\n";
91 // ###################################################################
93 if ($bugsys->in
['mark'] == 3)
96 <h1
>Loading Settings
</h1
>
98 <p
>Default settings are being loaded into the system
.</p
>
102 class dummy {
function string() {} }
105 require_once('./includes/settings.php');
107 foreach ($config AS $varname => $setting)
109 $db->query("INSERT INTO " . TABLE_PREFIX
. "setting (varname, value) VALUES ('" . $varname . "', '" . addslashes($setting[3]) . "')");
112 echo 'Settings loaded...';
115 // ###################################################################
117 if ($bugsys->in
['mark'] == 4)
119 $value = 'http' . ($_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '') . str_replace('/install/install.php', '', $_SERVER['SCRIPT_NAME']);
121 <h1
>General Settings
</h1
>
123 <p
>These three settings are fundamental in setting up your bug tracking system
. Please fill them in to proceed with the installation
.</p
>
125 <form name
="settings-do" action
="install.php" method
="post">
126 <input type
="hidden" name
="mark" value
="5" />
128 <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
>
129 <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
>
130 <div
><strong
>Webmaster Email
:</strong
> <input type
="text" name
="webmasteremail" size
="50" /></div
>
132 <input type
="submit" name
="submit" value
="Next Step" />
141 // ###################################################################
143 if ($bugsys->in
['mark'] == 5)
146 <h1
>New Administrator
</h1
>
148 <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
>
150 <form name
="user-do" action
="install.php" method
="post">
151 <input type
="hidden" name
="mark" value
="6" />
153 <div
><strong
>Display Name
:</strong
> <input type
="text" name
="displayname" size
="50" /></div
>
154 <div
><strong
>Email Address
:</strong
> <input type
="text" name
="email" size
="50" /></div
>
155 <div
><strong
>Password
:</strong
> <input type
="password" name
="password" size
="50" /></div
>
157 <input type
="submit" name
="submit" value
="Next Step" />
162 $db->query("UPDATE " . TABLE_PREFIX
. "setting SET value = '" . $bugsys->in
['trackertitle'] . "' WHERE varname = 'trackertitle'");
163 $db->query("UPDATE " . TABLE_PREFIX
. "setting SET value = '" . $bugsys->in
['trackerurl'] . "' WHERE varname = 'trackerurl'");
164 $db->query("UPDATE " . TABLE_PREFIX
. "setting SET value = '" . $bugsys->in
['webmasteremail'] . "' WHERE varname = 'webmasteremail'");
169 // ###################################################################
171 if ($bugsys->in
['mark'] == 6)
176 <p
>Your
new user has been added
.</p
>
179 $bugsys->load('functions');
181 $salt = $funct->rand(15);
184 INSERT INTO " . TABLE_PREFIX
. "user
185 (email, displayname, password, salt, authkey, showemail, showcolours, usergroupid)
187 ('" . $bugsys->in
['email'] . "', '" . $bugsys->in
['displayname'] . "',
188 '" . md5(md5($bugsys->in
['password']) . md5($salt)) . "', '$salt',
189 '" . $funct->rand() . "', 1, 1, 6
194 // ###################################################################
196 if ($bugsys->in
['mark'] == 7)
201 <p
>In order to make BugStrike
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
>
204 require_once('./includes/permissions.php');
207 echo "Cached settings<br />\n";
210 echo "Cached usergroups<br />\n";
213 echo "Cached statuses<br />\n";
216 echo "Cached priorities<br />\n";
219 echo "Cached severities<br />\n";
222 echo "Cached assignable users/developers<br />\n";
225 echo "Cached resolutions<br />\n";
228 echo "Cached products<br />\n";
231 echo "Cached versions<br />\n";
234 // ###################################################################
238 /*=====================================================================*\
239 || ###################################################################
242 || ###################################################################
243 \*=====================================================================*/