From 2be427840f27e585cdb8dc1b0d70d1a1c7296a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Fri, 25 Nov 2005 15:53:16 +0000 Subject: [PATCH] Allow to reset configuration. --- scripts/setup.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/setup.php b/scripts/setup.php index 1982bf4c3..3db474843 100644 --- a/scripts/setup.php +++ b/scripts/setup.php @@ -22,7 +22,7 @@ if (isset($_POST['action'])) { $action = ''; } -if (isset($_POST['cfg'])) { +if (isset($_POST['cfg']) && $action != 'clear' ) { $cfg = unserialize(remove_slashes($_POST['cfg'])); } else { $cfg = array(); @@ -197,6 +197,7 @@ function get_cfg_string() { unset($c['Servers']); foreach($c as $key => $val) { + // FIXME: more intelligent array output $ret .= "\$cfg['$key'] = " . var_export($val, TRUE) . ";\n"; } @@ -493,6 +494,7 @@ switch ($action) { } } break; + case 'clear': // Actual clearing is done at top case 'main': case '': $show_info = TRUE; @@ -520,6 +522,7 @@ if (!$fail_dir) { show_action('save', 'Save current configuration'); show_action('load', 'Load saved configuration'); } +show_action('clear', 'Clear current configuration'); echo '
';