Fixes on the modified user_load function

This commit is contained in:
jacob 2010-10-21 16:08:41 +00:00
parent b9bcb127a6
commit 3867b9b539

View File

@ -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