diff --git a/admin/award_awards.php b/admin/award_awards.php index 0aafc3b..1833788 100644 --- a/admin/award_awards.php +++ b/admin/award_awards.php @@ -27,7 +27,7 @@ user_auth_required('committee', 'admin'); require_once('awards.inc.php'); - switch($_GET['action']) { + switch(get_value_from_array($_GET, 'action')) { case 'awardinfo_load': $id = intval($_GET['id']); diff --git a/admin/committees.php b/admin/committees.php index db8abbb..317c5c3 100644 --- a/admin/committees.php +++ b/admin/committees.php @@ -28,7 +28,7 @@ user_auth_required('committee', 'admin'); -if($_POST['users_uid']) +if(get_value_from_array($_POST,'users_uid')) $uid = intval($_POST['users_uid']); @@ -95,7 +95,7 @@ function actionChanged() } function actionSubmit() -{ +{ if(document.forms.memberaction.action.selectedIndex==0) { alert('You must choose an action'); @@ -124,8 +124,8 @@ function actionSubmit() //--> - -if($_POST['addcommittee']) +global $uid; +if(get_value_from_array($_POST,'addcommittee')) { //add a new committee //re-order the committees @@ -134,7 +134,7 @@ if($_POST['addcommittee']) echo happy(i18n("Committee successfully added")); } -if($_POST['committees_id'] && $_POST['committees_ord']) { +if(get_value_from_array($_POST,'committees_id') && get_value_from_array($_POST,'committees_ord')) { //re-order the committees $x=0; $ids=$_POST['committees_id']; @@ -172,9 +172,9 @@ if($_POST['committees_id'] && $_POST['committees_ord']) { } -if($_POST['action']=="assign") +if(get_value_from_array($_POST, 'action', "assign")) { - if($_POST['committees_id'] && $_POST['users_uid']) { + if(get_value_from_array($_POST, 'committees_id') && get_vaue_from_array($_POST,'users_uid')) { $cid = intval($_POST['committees_id']); $q = $pdo->prepare("SELECT * FROM committees_link WHERE committees_id='$cid' AND users_uid='$uid'"); $q->execute(); @@ -191,7 +191,7 @@ if($_POST['action']=="assign") echo error(("You must choose both a member and a committee")); } -if($_GET['deletecommittee']) { +if(get_value_from_array($_GET, 'deletecommittee')) { $del = intval($_GET['deletecommittee']); $q = $pdo->prepare("DELETE FROM committees WHERE id='$del'"); @@ -199,13 +199,13 @@ if($_GET['deletecommittee']) { echo happy(i18n("Committee removed")); } -if($_POST['action']=="remove") { +if(get_value_from_array($_POST, 'action',"remove")) { /* user_delete takes care of unlinking the user in other tables */ user_delete($uid, 'committee'); echo happy(i18n("Committee member deleted")); } -if($_GET['unlinkmember'] && $_GET['unlinkcommittee']) { +if(get_value_from_array($_GET, 'unlinkmember') && get_value_from_array($_GET,'unlinkcommittee')) { $mem = intval($_GET['unlinkmember']); $com = intval($_GET['unlinkcommittee']); //unlink the member from the committee @@ -304,7 +304,7 @@ if($_GET['unlinkmember'] && $_GET['unlinkcommittee']) { $q = $pdo->prepare("SELECT * FROM committees ORDER BY ord,name"); $q->execute(); - if($q->rowCout()) + if($q->rowCount()) { echo "