Changeset 11582 for extensions/AMenuManager/amm_root.class.inc.php
- Timestamp:
- Jun 29, 2011, 11:45:00 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMenuManager/amm_root.class.inc.php
r11071 r11582 540 540 $registeredBlocks = $menu->get_registered_blocks(); 541 541 542 $userGroups=array(); 543 $sql="SELECT group_id 544 FROM ".USER_GROUP_TABLE." 545 WHERE user_id = '".$user['id']."';"; 546 $result=pwg_query($sql); 547 if($result) 548 { 549 while($row=pwg_db_fetch_assoc($result)) 550 { 551 $userGroups[$row['group_id']]=''; 552 } 553 } 554 542 555 $sql="SELECT id, `order`, users, groups 543 556 FROM ".$this->tables['blocks']." … … 548 561 while($row=pwg_db_fetch_assoc($result)) 549 562 { 550 $row['users']= explode(',', $row['users']);551 $row['groups']= explode(',', $row['groups']);563 $row['users']=(trim($row['users'])=='')?array():explode(',', $row['users']); 564 $row['groups']=(trim($row['groups'])=='')?array():explode(',', $row['groups']); 552 565 553 566 if(isset($registeredBlocks[$row['id']])) … … 559 572 if($users->isAllowed($user['status'])) 560 573 { 561 $groups->setAlloweds($row['groups'], false); 562 foreach($row['groups'] as $val) 574 if(count($userGroups)) 563 575 { 564 if(!$groups->isAllowed($val)) $ok=false; 576 $groups->setAlloweds($row['groups'], false); 577 foreach($row['groups'] as $val) 578 { 579 if(isset($userGroups[$val]) and !$groups->isAllowed($val)) $ok=false; 580 } 581 } 582 else 583 { 584 if(count($row['groups'])==0) $ok=false; 565 585 } 566 586 }
Note: See TracChangeset
for help on using the changeset viewer.