Here you can either export or import the standard data tables for Bugdar. These include things such as usergroups, priorities, etc.
-<h3>[<strong><a href="datatools.php?do=export">Export</a></strong>] [<strong><a href="datatools.php?do=import">Import</a></strong>] [<strong><a href="datatools.php?do=view">View</a></strong>]</h3>
+<h3>[<strong><a href="datatools.php?do=export">Export</a></strong>] [<strong><a href="datatools.php?do=import">Import</a></strong>] [<strong><a href="datatools.php?do=view">View</a></strong>] [<strong><a href="datatools.php?do=settings">Dump Settings</a></strong>]</h3>
<hr />
echo '<textarea style="height: 500px; width: 100%">' . htmlspecialchars($build) . '</textarea>';
}
+// ###################################################################
+
+if ($_REQUEST['do'] == 'settings')
+{
+ $fout = <<<FILE
+<?php
+/*=====================================================================*
+|| ###################################################################
+|| # Bugdar [#]version[#]
+|| # Copyright ©2002-[#]year[#] Blue Static
+|| #
+|| # This program is free software; you can redistribute it and/or modify
+|| # it under the terms of the GNU General Public License as published by
+|| # the Free Software Foundation; version [#]gpl[#] of the License.
+|| #
+|| # This program is distributed in the hope that it will be useful, but
+|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+|| # more details.
+|| #
+|| # You should have received a copy of the GNU General Public License along
+|| # with this program; if not, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
+\*=====================================================================*/
+
+// this stores all the settings for a new installation
+
+\$settings = array(
+FILE;
+
+ $settings = $db->query("SELECT * FROM " . TABLE_PREFIX . "setting");
+ while ($setting = $db->fetch_array($settings))
+ {
+ $fout .= "\n\t'$setting[varname]' => '" . str_replace("'", "\'", $setting['value']) . "',";
+ }
+
+ $fout .= <<<FILE
+
+);
+
+/*=====================================================================*
+|| ###################################################################
+|| # \$HeadURL: \$
+|| # \$Id: \$
+|| ###################################################################
+\*=====================================================================*/
+?>
+FILE;
+
+ file_put_contents('install/settings.php', $fout);
+
+ echo 'Dumping current settings into install/settings.php';
+}
+
?>
\ No newline at end of file
<?php
- // TODO - fix the way we insert default settings
- require_once('./includes/settings.php');
+ require_once('./install/settings.php');
- foreach ($settings AS $group => $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...';
--- /dev/null
+<?php
+/*=====================================================================*
+|| ###################################################################
+|| # Bugdar [#]version[#]
+|| # Copyright ©2002-[#]year[#] Blue Static
+|| #
+|| # This program is free software; you can redistribute it and/or modify
+|| # it under the terms of the GNU General Public License as published by
+|| # the Free Software Foundation; version [#]gpl[#] of the License.
+|| #
+|| # This program is distributed in the hope that it will be useful, but
+|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+|| # more details.
+|| #
+|| # You should have received a copy of the GNU General Public License along
+|| # with this program; if not, write to the Free Software Foundation, Inc.,
+|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+|| ###################################################################
+\*=====================================================================*/
+
+// this stores all the settings for a new installation
+
+$settings = array(
+ 'allownewreg' => '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