From 5d56e802a08d110d0c9b1b3f18fc78401dc733fc Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 19 Nov 2007 00:33:38 +0000 Subject: [PATCH] - Change auth_required to user_auth_required to check for committee access too - Add a top navbar to every page --- config/categories.php | 15 +++++++++++---- config/dates.php | 8 +++++--- config/divisions.php | 18 +++++++++++++----- config/divisions_cwsf.php | 10 +++++----- config/images.php | 8 ++++---- config/index.php | 6 ++++-- config/judges_questions.php | 8 +++++--- config/languagepacks.php | 9 ++++++--- config/pagetexts.php | 8 +++++--- config/rollover.php | 9 +++++---- config/safetyquestions.php | 9 +++++---- config/signaturepage.php | 9 +++++---- config/subdivisions.php | 16 +++++++++++----- config/variables.php | 8 +++++--- config/versionchecker.php | 8 +++++--- 15 files changed, 94 insertions(+), 55 deletions(-) diff --git a/config/categories.php b/config/categories.php index b93a9bd..f6003e6 100644 --- a/config/categories.php +++ b/config/categories.php @@ -23,10 +23,18 @@ ?> << ".i18n("Back to Configuration")."
"; + if($_GET['action']=="edit" || $_GET['action']=="new") { + send_header(($_GET['action']=="edit") ? 'Edit Category' : 'New Category', + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php', + 'Age Categories' => 'config/categories.php')); + } else { + send_header("Age Categories", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php')); + } if($_POST['action']=="edit") { @@ -96,7 +104,6 @@ } echo "
"; - echo "

".i18n("Age Categories")."

"; if(! ($_GET['action']=="edit" || $_GET['action']=="new") ) echo "".i18n("Add new age category")."\n"; diff --git a/config/dates.php b/config/dates.php index db80d5b..8c09e8b 100644 --- a/config/dates.php +++ b/config/dates.php @@ -23,9 +23,11 @@ ?> << ".i18n("Back to Configuration")."
"; + user_auth_required('committee', 'config'); + send_header("Dates", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php') + ); $error_ids = array(); diff --git a/config/divisions.php b/config/divisions.php index 0ae14e1..350b900 100644 --- a/config/divisions.php +++ b/config/divisions.php @@ -23,10 +23,20 @@ ?> << ".i18n("Back to Configuration")."
"; + user_auth_required('committee', 'config'); +if($_GET['action']=="edit" || $_GET['action']=="new") { + send_header(($_GET['action']=="edit") ? "Edit Division" : "New Division", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php', + 'Project Divisions' => 'config/divisions.php') ); + } else { + send_header("Project Divisions", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php')); + } + + if($_POST['action']=="edit") { if($_POST['id'] && $_POST['division'] ) @@ -117,8 +127,6 @@ echo ""; - echo "

".i18n("Project Divisions")."

"; - if(! ($_GET['action']=="edit" || $_GET['action']=="new") ) echo "".i18n("Add new division")."\n"; diff --git a/config/divisions_cwsf.php b/config/divisions_cwsf.php index 21bca53..66f0900 100644 --- a/config/divisions_cwsf.php +++ b/config/divisions_cwsf.php @@ -23,9 +23,11 @@ ?> << ".i18n("Back to Configuration")."
"; + user_auth_required('committee', 'config'); + send_header("CWSF Project Divisions", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php') + ); if(count($_POST['cwsfdivision'])) { @@ -38,8 +40,6 @@ echo ""; - echo "

".i18n("CWSF Project Divisions")."

"; - echo i18n("For each of your divisions, please select a corresponding CWSF division if applicable. If no corresponding CWSF division is chosen then you will need to manually select the CWSF division for each project that you register for the CWSF. You can select the 'most likely' division to use as a default which can then be changed on a per-project basis when you perform the automatic CWSF registration"); diff --git a/config/images.php b/config/images.php index 7cf5dc0..c6ea87f 100644 --- a/config/images.php +++ b/config/images.php @@ -23,9 +23,10 @@ ?> << ".i18n("Back to Configuration")."
"; + user_auth_required('committee', 'config'); + send_header("Fair Logo Image", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php')); if($_POST['action']=="addimage") { @@ -85,7 +86,6 @@ if($_POST['action']=="delimage") { echo ""; echo "\n"; - echo "

".i18n("Fair Logo Image")."

"; echo ""; if(file_exists("../data/logo.gif")) { diff --git a/config/index.php b/config/index.php index 7398846..10ff05a 100644 --- a/config/index.php +++ b/config/index.php @@ -23,9 +23,11 @@ ?> 'committee_main.php') + ); echo "".i18n("Configuration Variables")."
"; echo "".i18n("Important Dates")."
"; diff --git a/config/judges_questions.php b/config/judges_questions.php index 157b2cd..7aaec62 100644 --- a/config/judges_questions.php +++ b/config/judges_questions.php @@ -24,9 +24,11 @@ << ".i18n("Back to Configuration")."
"; + user_auth_required('committee', 'config'); + send_header("Judge Registration Questions", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php') + ); questions_editor('judgereg', $config['FAIRYEAR'], 'question', $_SERVER['PHP_SELF']); diff --git a/config/languagepacks.php b/config/languagepacks.php index 1cb0914..b6c23a6 100644 --- a/config/languagepacks.php +++ b/config/languagepacks.php @@ -23,9 +23,11 @@ ?> << ".i18n("Back to Configuration")."
"; + user_auth_required('committee', 'config'); + send_header("Language Packs", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php') + ); echo i18n("Checking for language packs will access a remote server, if you wish to continue click the 'Check for available language packs' link below"); echo "
"; @@ -62,6 +64,7 @@ $packs=loadLanguagePacks(); $num=count($packs); + echo '
'; echo i18n("Found %1 available language pack(s)",array($num)); //format of each line is: //lang:filename:lastupdate diff --git a/config/pagetexts.php b/config/pagetexts.php index 91c234f..5728e83 100644 --- a/config/pagetexts.php +++ b/config/pagetexts.php @@ -23,9 +23,11 @@ ?> << ".i18n("Back to Configuration")."
"; + user_auth_required('committee', 'config'); + send_header("Page Texts", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php') + ); $q=mysql_query("SELECT * FROM pagetext WHERE year='-1' ORDER BY textname"); while($r=mysql_fetch_object($q)) diff --git a/config/rollover.php b/config/rollover.php index c2e7d2d..d0084e9 100644 --- a/config/rollover.php +++ b/config/rollover.php @@ -23,8 +23,11 @@ ?> 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php') + ); ?> << ".i18n("Back to Configuration")."
"; - if($_POST['action']=="rollover" && $_POST['nextfairyear']) { $newfairyear=$_POST['nextfairyear']; diff --git a/config/safetyquestions.php b/config/safetyquestions.php index 5001ef4..6598f43 100644 --- a/config/safetyquestions.php +++ b/config/safetyquestions.php @@ -23,10 +23,11 @@ ?> << ".i18n("Back to Configuration")."
"; - + user_auth_required('committee', 'config'); + send_header("Safety Questions", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php') + ); if($_POST['action']=="save" && $_POST['save']) { if($_POST['question']) diff --git a/config/signaturepage.php b/config/signaturepage.php index 0bec720..3dd4bbe 100644 --- a/config/signaturepage.php +++ b/config/signaturepage.php @@ -23,9 +23,11 @@ ?> << ".i18n("Back to Configuration")."
"; + user_auth_required('committee', 'config'); + send_header("Signature Page", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php') + ); if($_POST['action']=="save") { @@ -41,7 +43,6 @@ echo happy(i18n("Signature page text successfully saved")); } - echo "
"; $q=mysql_query("SELECT * FROM signaturepage WHERE name='exhibitordeclaration'"); $r=mysql_fetch_object($q); diff --git a/config/subdivisions.php b/config/subdivisions.php index 1066b3d..0aa1b92 100644 --- a/config/subdivisions.php +++ b/config/subdivisions.php @@ -23,9 +23,17 @@ ?> << ".i18n("Back to Configuration")."
"; + user_auth_required('committee', 'config'); + if($_GET['action']=="edit" || $_GET['action']=="new") { + send_header(($_GET['action']=="edit") ? "Edit Sub-Division" : "New Sub-Division", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php', + 'Project Sub-Divisions' => 'config/subdivisions.php')); + } else { + send_header("Project Sub-Divisions", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php')); + } if($_POST['action']=="edit") { @@ -95,8 +103,6 @@ echo ""; - echo "

".i18n("Project Sub-Divisions")."

"; - if(! ($_GET['action']=="edit" || $_GET['action']=="new") ) echo "".i18n("Add new sub-division")."\n"; diff --git a/config/variables.php b/config/variables.php index 130d85b..750202e 100644 --- a/config/variables.php +++ b/config/variables.php @@ -24,9 +24,11 @@ << ".i18n("Back to Configuration")."
"; + user_auth_required('committee', 'config'); + send_header("Variables", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php') + ); $q=mysql_query("SELECT * FROM config WHERE year='-1'"); while($r=mysql_fetch_object($q)) diff --git a/config/versionchecker.php b/config/versionchecker.php index ecc6ba1..4d0a81a 100644 --- a/config/versionchecker.php +++ b/config/versionchecker.php @@ -23,9 +23,11 @@ ?> << ".i18n("Back to Configuration")."
"; + user_auth_required('committee', 'config'); + send_header("Version Checker", + array('Committee Main' => 'committee_main.php', + 'SFIAB Configuration' => 'config/index.php') + ); echo i18n("Checking for new versions will access a remote server, if you wish to continue click the 'Check for new versions' link below"); echo "
";