Don't allow changing FISCALYEAR variable, and update the braces formatting on the file

This commit is contained in:
james 2009-10-22 17:03:27 +00:00
parent e33c39a011
commit 7e99c85bfe

View File

@ -28,8 +28,7 @@
user_auth_required('committee', 'config');
$q=mysql_query("SELECT * FROM config WHERE year='-1'");
while($r=mysql_fetch_object($q))
{
while($r=mysql_fetch_object($q)) {
mysql_query("INSERT INTO config (var,val,category,type,type_values,ord,description,year) VALUES (
'".mysql_escape_string($r->var)."',
'".mysql_escape_string($r->val)."',
@ -42,12 +41,9 @@
}
//for the Special category
if($_POST['action']=="save")
{
if($_POST['specialconfig'])
{
foreach($_POST['specialconfig'] as $key=>$val)
{
if($_POST['action']=="save") {
if($_POST['specialconfig']) {
foreach($_POST['specialconfig'] as $key=>$val) {
mysql_query("UPDATE config SET val='".mysql_escape_string(stripslashes($val))."' WHERE year='0' AND var='$key'");
}
}
@ -78,8 +74,7 @@
echo "<tr><td width=\"120\" style=\"border-right: 1px solid black;\">";
echo "<table cellspacing=0 cellpadding=3 border=0>";
$trclass = 'odd';
while($r=mysql_fetch_object($q))
{
while($r=mysql_fetch_object($q)) {
$trclass = ($trclass == 'odd') ? 'even' : 'odd';
echo "<tr class=\"$trclass\">";
echo "<td align=\"right\">";
@ -94,10 +89,8 @@
echo "</td><td>";
if($category)
{
if($category=="Special")
{
if($category) {
if($category=="Special") {
echo "<h3>".i18n("Special Configuration Settings")."</h3>";
echo "<form method=\"post\" action=\"variables.php\">";
echo "<input type=\"hidden\" name=\"action\" value=\"save\">\n";
@ -107,14 +100,11 @@
echo "<tr><td colspan=\"2\">";
echo i18n("Warning, modifying values on this configuration variables page could cause your SFIAB to stop working. Only change anything on this page if you really know what you are doing");
echo "</td></tr>";
while($r=mysql_fetch_object($q))
{
if($r->var=="FAIRYEAR" || $r->var=="DBVERSION")
{
while($r=mysql_fetch_object($q)) {
if($r->var=="FAIRYEAR" || $r->var=="DBVERSION" || $r->var=="FISCALYEAR") {
echo "<tr><td><b>$r->var</b> - ".i18n($r->description)."</td><td>$r->val</td></tr>";
}
else
{
else {
echo "<tr><td><b>$r->var</b> - ".i18n($r->description)."</td><td><input type=\"text\" name=\"specialconfig[$r->var]\" value=\"$r->val\" /></td></tr>";
}
}
@ -122,16 +112,14 @@
echo "<input type=\"submit\" value=\"".i18n("Save Configuration")."\" />\n";
echo "</form>";
}
else
{
else {
// echo "<h3>".i18n("Configuration settings for fair year %1",array($config['FAIRYEAR']),array("fair year"))."</h3>";
echo "<h3>".i18n($category)." ({$config['FAIRYEAR']})</h3>";
config_editor($category, $config['FAIRYEAR'], "var", $_SERVER['PHP_SELF']);
}
}
else
{
else {
echo i18n("Please choose a configuration category");
}