Quick correction on how lang is described in the user_get_fields function

This commit is contained in:
jacob 2010-11-17 15:52:02 +00:00
parent 0ff766175b
commit 2848ed177d

View File

@ -375,7 +375,7 @@ function user_role_field_required($role, $fieldname){
// accepts either an array of roles (eg. {'judge', 'teacher', 'foo'}), a single one as a string (eg. 'judge'), or a null value (no roles at all)
function user_get_fields($userRoles = null){
global $roles, $conference;
global $roles, $conference, $config;
if($userRoles == null){
$userRoles = array();
@ -445,11 +445,11 @@ function user_get_fields($userRoles = null){
switch($fieldName){
case 'languages':
$fields[$fieldName]['type'] = 'multiselect';
$fields[$fieldName]['options'] = array();
$query = mysql_query("SELECT lang, langname FROM languages WHERE active = 'Y'");
while($row = mysql_fetch_assoc($query)){
$fields[$fieldName]['options'][$row['lang']] = $row['langname'];
}
$fields[$fieldName]['options'] = $config['languages'];
break;
case 'lang':
$fields[$fieldName]['type'] = 'singleselect';
$fields[$fieldName]['options'] = $config['languages'];
break;
case 'cat_prefs':
$fields[$fieldName]['description'] = 'Preference levels for judging individual project categories';
@ -1317,7 +1317,6 @@ function updateSessionRoles($u=null) {
if(!$u)
$u=user_load($_SESSION['users_id']);
$_SESSION['roles']=array();
// echo "updateSessionRole for {$_SESSION['users_id']}:";print_r($u);
if($u && is_array($u['roles'])) {
foreach($u['roles'] AS $r=>$rd) {
if($rd['active']=="yes" || $r=='admin' || $r=='config' || $r=='committee')