diff options
author | jwacalex <ich-bin@jwacalex.de> | 2017-04-11 17:25:34 +0200 |
---|---|---|
committer | jwacalex <ich-bin@jwacalex.de> | 2017-04-11 17:25:34 +0200 |
commit | b6d394e982255132ef3727c8bd2b3dae0c5ec67d (patch) | |
tree | b703b4a47806b1b1c068559543fd5cc562045599 /includes/sys_menu.php | |
parent | 7bbfe69583200e5cf2def8757a5c7995d1cc6fa2 (diff) |
first fix for #317. hidden rooms can be seen with admin_rooms priviledge
Diffstat (limited to 'includes/sys_menu.php')
-rw-r--r-- | includes/sys_menu.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/includes/sys_menu.php b/includes/sys_menu.php index e1a6a12e..cb90fb7b 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -154,8 +154,10 @@ function make_room_navigation($menu) { if (! in_array('view_rooms', $privileges)) { return $menu; } - - $rooms = Rooms(); + + //get a list of all rooms + $rooms = Rooms(true); + $room_menu = []; if (in_array('admin_rooms', $privileges)) { $room_menu[] = toolbar_item_link(page_link_to('admin_rooms'), 'list', _("Manage rooms")); @@ -164,7 +166,11 @@ function make_room_navigation($menu) { $room_menu[] = toolbar_item_divider(); } foreach ($rooms as $room) { - $room_menu[] = toolbar_item_link(room_link($room), 'map-marker', $room['Name']); + if($room['show'] == 'Y' || // room is public + ($room['show'] != 'Y' && in_array('admin_rooms', $privileges)) // room is not public, but user can admin_rooms + ) { + $room_menu[] = toolbar_item_link(room_link($room), 'map-marker', $room['Name']); + } } if (count($room_menu > 0)) { $menu[] = toolbar_dropdown('map-marker', _("Rooms"), $room_menu); |