- Force the config page to reload when saved, so changes in $config are

reloaded and thus immediately displayed.
This commit is contained in:
dave 2009-02-05 09:22:31 +00:00
parent 0f763de1ac
commit 65ba63bd81

View File

@ -26,11 +26,6 @@
require_once("../user.inc.php");
require_once("../config_editor.inc.php");
user_auth_required('committee', 'config');
send_header("Configuration Variables",
array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php')
,"configuration_variables"
);
$q=mysql_query("SELECT * FROM config WHERE year='-1'");
while($r=mysql_fetch_object($q))
@ -56,7 +51,7 @@
mysql_query("UPDATE config SET val='".mysql_escape_string(stripslashes($val))."' WHERE year='0' AND var='$key'");
}
}
echo happy(i18n("Configuration successfully saved"));
message_push(happy(i18n("Configuration successfully saved")));
}
//get the category, and if nothing is chosen, default to Global
@ -64,6 +59,19 @@
else if($_POST['category']) $category=$_POST['category'];
else $category="Global";
$action = config_editor_handle_actions($category, $config['FAIRYEAR'], "var");
if($action == 'update') {
header("Location: variables.php?category=$category");
exit;
}
send_header("Configuration Variables",
array('Committee Main' => 'committee_main.php',
'SFIAB Configuration' => 'config/index.php')
,"configuration_variables"
);
$q=mysql_query("SELECT DISTINCT(category) AS cat FROM config ORDER BY cat");
echo "\n<table valign=\"top\" cellspacing=0 cellpadding=5 border=0>";