forked from science-ation/science-ation
migration to new user system
This commit is contained in:
parent
bffcf724d8
commit
5cd3f22088
@ -114,10 +114,10 @@ echo mysql_error();
|
||||
}
|
||||
|
||||
$u = user_load($id);
|
||||
|
||||
$types = array_keys($u['roles']);
|
||||
$selected = $_GET['tab'];
|
||||
if(!array_key_exists($selected, $tabs)) {
|
||||
if(in_array('fair', $u['types']) )
|
||||
if(in_array('fair', $types) )
|
||||
$selected = 'fairinfo';
|
||||
else
|
||||
$selected = 'personal';
|
||||
@ -149,7 +149,7 @@ foreach($tabs as $k=>$t) {
|
||||
/* Make sure the tab is enabled */
|
||||
if($t['enabled'] == false) continue;
|
||||
/* Make sure the user has the right type to see the tab */
|
||||
$i = array_intersect($t['types'], $u['types']);
|
||||
$i = array_intersect($t['types'], $types);
|
||||
if(count($i) == 0) continue;
|
||||
|
||||
if($k == $selected) $selected_index = $index;
|
||||
|
Loading…
x
Reference in New Issue
Block a user