From 3867b9b539ec7a36043f0a67d90a20ab33601d98 Mon Sep 17 00:00:00 2001 From: jacob Date: Thu, 21 Oct 2010 16:08:41 +0000 Subject: [PATCH] Fixes on the modified user_load function --- user.inc.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/user.inc.php b/user.inc.php index e0632d8..4d1485e 100644 --- a/user.inc.php +++ b/user.inc.php @@ -94,7 +94,34 @@ function user_load($users_id, $accounts_id = false) user_fields_enabled($roledata['type'])); $fields = array_merge($fields, user_fields_required($roledata['type'])); + + switch($roledata['type']) { + case 'committee': + $fields = array_merge($fields, array('ord', 'displayemail')); + break; + + case 'judge': + $fields = array_merge($fields, array( + 'years_school', 'years_regional', 'years_national', 'willing_chair', + 'special_award_only', 'cat_prefs', 'div_prefs', 'divsub_prefs', + 'languages', 'highest_psd' + )); + break; + + case 'sponsor': + $fields[] = 'sponsors_id'; + break; + + case 'volunteer': + $fields[] = 'languages'; + break; + + default: + /* Nothing to do for all other roles */ + break; + } } + $fields = array_unique($fields); if(count($u['roles']) == 0) { /* No roles, that's ok actually, the previous logic here was that * a user without roles is deleted.. but.. this could happen for