Allow to reset configuration.
This commit is contained in:
@@ -22,7 +22,7 @@ if (isset($_POST['action'])) {
|
|||||||
$action = '';
|
$action = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['cfg'])) {
|
if (isset($_POST['cfg']) && $action != 'clear' ) {
|
||||||
$cfg = unserialize(remove_slashes($_POST['cfg']));
|
$cfg = unserialize(remove_slashes($_POST['cfg']));
|
||||||
} else {
|
} else {
|
||||||
$cfg = array();
|
$cfg = array();
|
||||||
@@ -197,6 +197,7 @@ function get_cfg_string() {
|
|||||||
unset($c['Servers']);
|
unset($c['Servers']);
|
||||||
|
|
||||||
foreach($c as $key => $val) {
|
foreach($c as $key => $val) {
|
||||||
|
// FIXME: more intelligent array output
|
||||||
$ret .= "\$cfg['$key'] = " . var_export($val, TRUE) . ";\n";
|
$ret .= "\$cfg['$key'] = " . var_export($val, TRUE) . ";\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,6 +494,7 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'clear': // Actual clearing is done at top
|
||||||
case 'main':
|
case 'main':
|
||||||
case '':
|
case '':
|
||||||
$show_info = TRUE;
|
$show_info = TRUE;
|
||||||
@@ -520,6 +522,7 @@ if (!$fail_dir) {
|
|||||||
show_action('save', 'Save current configuration');
|
show_action('save', 'Save current configuration');
|
||||||
show_action('load', 'Load saved configuration');
|
show_action('load', 'Load saved configuration');
|
||||||
}
|
}
|
||||||
|
show_action('clear', 'Clear current configuration');
|
||||||
|
|
||||||
echo '<hr class="separator" />';
|
echo '<hr class="separator" />';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user