From 3deae5e02902e190d46e6945052bca25fa49c931 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 16 Feb 2005 22:50:43 +0000 Subject: [PATCH] Implement authorizaiton for admin/config sections Use committee members for authorization Add auth required checks in all admin/config sections --- admin/committees.php | 2 + admin/index.php | 1 + admin/registration.php | 1 + admin/registration_list.php | 1 + admin/registration_receivedforms.php | 1 + admin/reports.php | 1 + admin/reports_checkin.php | 1 + committee_auth.php | 45 ++++++++++++++++++++ committee_login.php | 61 ++++++++++++++++++++++++++++ common.inc.php | 27 ++++++++++-- config/categories.php | 2 + config/dates.php | 1 + config/divisions.php | 1 + config/images.php | 1 + config/index.php | 2 + config/subdivisions.php | 1 + config/variables.php | 1 + 17 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 committee_auth.php create mode 100644 committee_login.php diff --git a/admin/committees.php b/admin/committees.php index f0f0e35..dedd40f 100644 --- a/admin/committees.php +++ b/admin/committees.php @@ -23,6 +23,8 @@ ?> diff --git a/admin/index.php b/admin/index.php index 2320fb5..414b32b 100644 --- a/admin/index.php +++ b/admin/index.php @@ -23,6 +23,7 @@ ?> << ".i18n("Back to Administration")."
"; echo "
"; diff --git a/admin/registration_list.php b/admin/registration_list.php index f0f200a..b1617d0 100644 --- a/admin/registration_list.php +++ b/admin/registration_list.php @@ -23,6 +23,7 @@ ?> << ".i18n("Back to Administration")."
"; echo "
"; diff --git a/admin/reports_checkin.php b/admin/reports_checkin.php index 6d8f36a..282c605 100644 --- a/admin/reports_checkin.php +++ b/admin/reports_checkin.php @@ -23,6 +23,7 @@ ?> access_admin; + $accesscache['config']=$r->access_config; + $accesscache['super']=$r->access_super; + + switch($access) + { + case "config": if($r->access_config=='Y') return true; break; + case "admin": if($r->access_admin=='Y') return true; break; + case "super": if($r->access_super=='Y') return true; break; + default: + return false; + break; + } + } + return false; + +} + +function auth_required($access="") +{ + global $config; + + if(!auth_has_access($access)) + header("Location: ".$config['SFIABDIRECTORY']."/committee_login.php"); +} + +?> diff --git a/committee_login.php b/committee_login.php new file mode 100644 index 0000000..c2d76de --- /dev/null +++ b/committee_login.php @@ -0,0 +1,61 @@ +email; + $_SESSION['committee_member_id']=$r->id; + send_header("Committee Login"); + echo happy(i18n("Successfully logged in")); + echo i18n("Use the menu on the left to access the committee pages"); + } + else + { + send_header("Committee Login"); + echo error(i18n("Invalid Email/Password")); + } + + } + else + { + send_header("Committee Login"); + echo error(i18n("Email/Password missing")); + } + } + else if($_GET['action']=="logout") + { + unset($_SESSION['email']); + unset($_SESSION['committee_member_id']); + send_header("Committee Login"); + echo notice(i18n("You have been successfully logged out")); + } + else + { + + send_header("Committee Login"); + + ?> +
+ + + + +
+ : +
+ : +
+ +
+
+ diff --git a/common.inc.php b/common.inc.php index a0d433d..47c46b6 100644 --- a/common.inc.php +++ b/common.inc.php @@ -22,7 +22,8 @@ */ ?> ".i18n($config['fairname'])."";
diff --git a/config/categories.php b/config/categories.php index 57bc435..8d447e0 100644 --- a/config/categories.php +++ b/config/categories.php @@ -23,6 +23,8 @@ ?> << ".i18n("Back to Configuration")."
"; diff --git a/config/dates.php b/config/dates.php index 9e8cfff..387b222 100644 --- a/config/dates.php +++ b/config/dates.php @@ -23,6 +23,7 @@ ?> << ".i18n("Back to Configuration")."
"; diff --git a/config/divisions.php b/config/divisions.php index 4221218..74ae633 100644 --- a/config/divisions.php +++ b/config/divisions.php @@ -23,6 +23,7 @@ ?> << ".i18n("Back to Configuration")."
"; diff --git a/config/images.php b/config/images.php index 95773c4..b83ee0f 100644 --- a/config/images.php +++ b/config/images.php @@ -23,6 +23,7 @@ ?> << ".i18n("Back to Configuration")."
"; diff --git a/config/index.php b/config/index.php index 51e9a0b..c891fcf 100644 --- a/config/index.php +++ b/config/index.php @@ -23,6 +23,8 @@ ?> << ".i18n("Back to Configuration")."
"; diff --git a/config/variables.php b/config/variables.php index 722bed0..6672518 100644 --- a/config/variables.php +++ b/config/variables.php @@ -23,6 +23,7 @@ ?> << ".i18n("Back to Configuration")."
";