|| ###################################################################
\*=====================================================================*/
-define('STOP_MARK', 7);
+define('STOP_MARK', 8);
define('ACTIVE_SITE', 'install.php');
require_once('./global.php');
if ($bugsys->in['mark'] == 1)
{
?>
+<h1>Installation Check</h1>
+
+<style type="text/css" media="screen">
+<!--
+ .fail
+ {
+ font-weight: bold;
+ color: rgb(255, 0, 0);
+ }
+ .pass
+ {
+ color: rgb(0, 150, 0);
+ }
+//-->
+</style>
+
+<p>This step will ensure that Bugdar can install and run properly. In all of these tests, <span class="pass">green means the test succeeded</span> and <span class="fail">red means it didn't</span>.</p>
+
+<strong>MySQL Privileges:</strong>
+<ul>
+<?php
+
+ $db->showerrors = false;
+
+ $pf = $tests[] = ($db->query("CREATE TABLE install_check (col1 VARCHAR(255) NULL);") ? 'pass' : 'fail');
+ echo "\n\t<li class=\"$pf\">CREATE TABLE</li>";
+
+ $pf = $tests[] = ($db->query("INSERT INTO install_check (col1) VALUES ('example')") ? 'pass' : 'fail');
+ echo "\n\t<li class=\"$pf\">INSERT</li>";
+
+ $pf = $tests[] = ($db->query("UPDATE install_check SET col1 = 'example2'") ? 'pass' : 'fail');
+ echo "\n\t<li class=\"$pf\">UPDATE</li>";
+
+ $pf = $tests[] = ($db->query("SELECT * FROM install_check") ? 'pass' : 'fail');
+ echo "\n\t<li class=\"$pf\">SELECT</li>";
+
+ $pf = $tests[] = ($db->query("DELETE FROM install_check WHERE col1 = 'example2'") ? 'pass' : 'fail');
+ echo "\n\t<li class=\"$pf\">DELETE</li>";
+
+ $pf = $tests[] = ($db->query("ALTER TABLE install_check ADD col3 BOOL") ? 'pass' : 'fail');
+ echo "\n\t<li class=\"$pf\">ALTER</li>";
+
+ $pf = $tests[] = ($db->query("ALTER TABLE install_check ADD INDEX (col1)") ? 'pass' : 'fail');
+ echo "\n\t<li class=\"$pf\">ALTER ADD INDEX</li>";
+
+ $pf = $tests[] = ($db->query("REPLACE INTO install_check (col1) VALUES ('example3')") ? 'pass' : 'fail');
+ echo "\n\t<li class=\"$pf\">REPLACE</li>";
+
+ $pf = $tests[] = ($db->query("OPTIMIZE TABLE install_check") ? 'pass' : 'fail');
+ echo "\n\t<li class=\"$pf\">OPTIMIZE</li>";
+
+ $pf = $tests[] = ($db->query("DROP TABLE install_check") ? 'pass' : 'fail');
+ echo "\n\t<li class=\"$pf\">DROP TABLE</li>";
+
+ echo "\n</ul>";
+
+ $valcount = array_count_values($tests);
+ if ($valcount['fail'] > 0)
+ {
+ echo "<p>Please adjust your MySQL setup and refresh this page to ensure that Bugdar can operate properly. If you do not do so, Bugdar cannot be installed.</p>";
+ page_end(false);
+ }
+}
+
+// ###################################################################
+
+if ($bugsys->in['mark'] == 2)
+{
+?>
<h1>Initializing Database</h1>
<p>This step will load the tables into your database so the rest of the installation can proceed forward.</p>
// ###################################################################
-if ($bugsys->in['mark'] == 2)
+if ($bugsys->in['mark'] == 3)
{
?>
<h1>Loading Default Data</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 3)
+if ($bugsys->in['mark'] == 4)
{
?>
<h1>Loading Settings</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 4)
+if ($bugsys->in['mark'] == 5)
{
?>
<h1>Cache Data</h1>
// ###################################################################
-if ($bugsys->in['mark'] == 5)
+if ($bugsys->in['mark'] == 6)
{
$value = 'http' . ($_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '') . str_replace('/install/install.php', '', $_SERVER['SCRIPT_NAME']);
?>
<p>These three settings are fundamental in setting up your bug tracking system. Please fill them in to proceed with the installation.</p>
<form name="settings-do" action="install.php" method="post">
-<input type="hidden" name="mark" value="6" />
+<input type="hidden" name="mark" value="7" />
<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>
<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="<?php echo $value; ?>" /></div>
// ###################################################################
-if ($bugsys->in['mark'] == 6)
+if ($bugsys->in['mark'] == 7)
{
?>
<h1>New Administrator</h1>
<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>
<form name="user-do" action="install.php" method="post">
-<input type="hidden" name="mark" value="7" />
+<input type="hidden" name="mark" value="8" />
<div><strong>Display Name:</strong> <input type="text" name="displayname" size="50" /></div>
<div><strong>Email Address:</strong> <input type="text" name="email" size="50" /></div>
// ###################################################################
-if ($bugsys->in['mark'] == 7)
+if ($bugsys->in['mark'] == 8)
{
?>
<h1>User Added</h1>