forked from science-ation/science-ation
Fixes on the modified user_load function
This commit is contained in:
parent
b9bcb127a6
commit
3867b9b539
27
user.inc.php
27
user.inc.php
@ -94,7 +94,34 @@ function user_load($users_id, $accounts_id = false)
|
|||||||
user_fields_enabled($roledata['type']));
|
user_fields_enabled($roledata['type']));
|
||||||
$fields = array_merge($fields,
|
$fields = array_merge($fields,
|
||||||
user_fields_required($roledata['type']));
|
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) {
|
if(count($u['roles']) == 0) {
|
||||||
/* No roles, that's ok actually, the previous logic here was that
|
/* No roles, that's ok actually, the previous logic here was that
|
||||||
* a user without roles is deleted.. but.. this could happen for
|
* a user without roles is deleted.. but.. this could happen for
|
||||||
|
Loading…
Reference in New Issue
Block a user