From ec69e70ea0a0d2436d74aabf92844598b6aae095 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 16 Feb 2007 06:52:29 +0000 Subject: [PATCH] r1413: Fixing the installer to allow settings to actually be inserted into the database --- docs/datatools.php | 57 +++++++++++++++++++++++++++++++++++++++- install/install.php | 14 +++------- install/settings.php | 62 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 12 deletions(-) create mode 100644 install/settings.php diff --git a/docs/datatools.php b/docs/datatools.php index 3a89305..4fe972a 100644 --- a/docs/datatools.php +++ b/docs/datatools.php @@ -48,7 +48,7 @@ $THELIST = array( Here you can either export or import the standard data tables for Bugdar. These include things such as usergroups, priorities, etc. -

[Export] [Import] [View]

+

[Export] [Import] [View] [Dump Settings]


@@ -165,4 +165,59 @@ if ($_REQUEST['do'] == 'view') echo ''; } +// ################################################################### + +if ($_REQUEST['do'] == 'settings') +{ + $fout = <<query("SELECT * FROM " . TABLE_PREFIX . "setting"); + while ($setting = $db->fetch_array($settings)) + { + $fout .= "\n\t'$setting[varname]' => '" . str_replace("'", "\'", $setting['value']) . "',"; + } + + $fout .= << +FILE; + + file_put_contents('install/settings.php', $fout); + + echo 'Dumping current settings into install/settings.php'; +} + ?> \ No newline at end of file diff --git a/install/install.php b/install/install.php index 6583ba8..3a2e6cd 100644 --- a/install/install.php +++ b/install/install.php @@ -106,19 +106,11 @@ if ($bugsys->in['mark'] == 3) $sgroup) + foreach ($settings AS $key => $value) { - foreach ($sgroup AS $varname => $setting) - { - if (!is_array($setting)) - { - continue; - } - $db->query("INSERT INTO " . TABLE_PREFIX . "setting (varname, value) VALUES ('" . $varname . "', '" . addslashes($setting[1]) . "')"); - } + $db->query("INSERT INTO " . TABLE_PREFIX . "setting (varname, value) VALUES ('" . $key . "', '" . $db->escape_string($value) . "')"); } echo 'Settings loaded...'; diff --git a/install/settings.php b/install/settings.php new file mode 100644 index 0000000..0e6d2d2 --- /dev/null +++ b/install/settings.php @@ -0,0 +1,62 @@ + '1', + 'verifyemail' => '1', + 'moderatenewusers' => '0', + 'webmasteremail' => 'noreply@bluestatic.org', + 'trackertitle' => 'Avalon Development Tracker', + 'trackerversion' => '[#]version[#]', + 'defaultcomment' => '', + 'sendwelcomemail' => '1', + 'allowhtml' => '0', + 'allowrawhtml' => '0', + 'allowsafehtml' => '1', + 'defaultseverity' => '2', + 'defaultpriority' => '3', + 'defaultstatus' => '1', + 'defaultresolve' => '1', + 'defaultassign' => '0', + 'dateformat' => 'F j, Y h:i:s A', + 'defaultpp' => '20', + 'maxpp' => '100', + 'pagelinks' => '2', + 'trackerurl' => 'http://localhost/bugtrack', + 'defaultlanguage' => '1', + 'syndicateditems' => '10', + 'hidestatuses' => '0', + 'defaultsortkey' => 'lastpost', + 'defaultsortas' => 'desc', + 'defaulttimezone' => '0', + 'columnoptions' => 'a:12:{s:5:"bugid";s:1:"1";s:7:"summary";s:1:"2";s:6:"userid";s:1:"2";s:7:"product";s:1:"3";s:9:"component";s:1:"0";s:7:"version";s:1:"3";s:6:"status";s:1:"4";s:10:"resolution";s:1:"4";s:8:"priority";s:1:"5";s:8:"severity";s:1:"5";s:8:"lastpost";s:1:"6";s:5:"votes";s:1:"0";}', + 'redirectheaders' => '0', +); + +/*=====================================================================* +|| ################################################################### +|| # $HeadURL$ +|| # $Id$ +|| ################################################################### +\*=====================================================================*/ +?> \ No newline at end of file -- 2.43.5