From 3ef8578a460b94bd776e62cf7e6e9f5753d00a2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 27 Nov 2011 17:22:07 +0100 Subject: [PATCH] Guests are not supported. --- file/lib/page/ChatPage.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/file/lib/page/ChatPage.class.php b/file/lib/page/ChatPage.class.php index 06577d5..5730b4f 100644 --- a/file/lib/page/ChatPage.class.php +++ b/file/lib/page/ChatPage.class.php @@ -37,6 +37,9 @@ public function assignVariables() { )); } + /** + * Reads chat-version. Used to avoid caching of JS-File when Tims Chat is updated. + */ public function readChatVersion() { CacheHandler::getInstance()->addResource( 'packages', @@ -47,7 +50,7 @@ public function readChatVersion() { foreach ($packages as $package) { if ($package->package != 'timwolla.wcf.chat') continue; $this->chatVersion = $package->packageVersion; - break; + return; } } @@ -99,6 +102,9 @@ public function readParameters() { if (isset($_GET['id'])) $this->roomID = (int) $_GET['id']; } + /** + * Reads the smilies in the default category. + */ public function readDefaultSmileys() { $smilies = \wcf\data\smiley\SmileyCache::getInstance()->getSmilies(); $this->smilies = $smilies[null]; @@ -108,6 +114,10 @@ public function readDefaultSmileys() { * @see \wcf\page\IPage::show() */ public function show() { + // guests are not supported + if (!WCF::getUser()->userID) { + throw new \wcf\system\exception\PermissionDeniedException(); + } \wcf\system\menu\page\PageMenu::getInstance()->setActiveMenuItem('wcf.header.menu.chat'); // remove index breadcrumb