From f231ce5aaed0fdb913b86c12b2a7e61f2dc03e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 26 Dec 2011 12:43:19 +0100 Subject: [PATCH] Check permissions in Page-Menu --- .../menu/page/ChatPageMenuItemProvider.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php b/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php index 3f44ff4..533f707 100644 --- a/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php +++ b/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php @@ -25,8 +25,14 @@ public function isVisible() { try { $cache = ChatRoom::getCache(); - $cache->seek(0); - $this->room = $cache->search($cache->key()); + $i = 0; + + do { + $cache->seek($i++); + $this->room = $cache->search($cache->key()); + } + while (!$this->room->canEnter()); + return true; } catch (\OutOfBoundsException $e) {