From 4152462ade4c8a182d86fdd53a9c7326a6021135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 26 Feb 2012 18:16:28 +0100 Subject: [PATCH] Include ACL-group-permissions as well --- acptemplate/chatRoomAdd.tpl | 2 +- file/lib/data/chat/room/ChatRoomEditor.class.php | 3 +-- .../chat/permission/ChatPermissionHandler.class.php | 9 ++++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/acptemplate/chatRoomAdd.tpl b/acptemplate/chatRoomAdd.tpl index 615fe51..bb67e30 100644 --- a/acptemplate/chatRoomAdd.tpl +++ b/acptemplate/chatRoomAdd.tpl @@ -14,7 +14,7 @@ 'wcf.icon.users': '{@$__wcf->getPath('wcf')}icon/users1.svg' }); - new WCF.ACL.List($('#groupPermissions'), {@$objectTypeID}{if $groupID|isset}, {@$groupID}{/if}); + new WCF.ACL.List($('#groupPermissions'), {@$objectTypeID}); }); //]]> diff --git a/file/lib/data/chat/room/ChatRoomEditor.class.php b/file/lib/data/chat/room/ChatRoomEditor.class.php index 01f2118..43216c4 100644 --- a/file/lib/data/chat/room/ChatRoomEditor.class.php +++ b/file/lib/data/chat/room/ChatRoomEditor.class.php @@ -21,8 +21,7 @@ class ChatRoomEditor extends \wcf\data\DatabaseObjectEditor implements \wcf\data * Clears the room cache. */ public static function resetCache() { - ChatRoom::getCache(); - \wcf\system\cache\CacheHandler::getInstance()->clearResource('chatrooms'); + \wcf\system\cache\CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.chatrooms.php'); } /** diff --git a/file/lib/system/chat/permission/ChatPermissionHandler.class.php b/file/lib/system/chat/permission/ChatPermissionHandler.class.php index e125c56..f61a749 100644 --- a/file/lib/system/chat/permission/ChatPermissionHandler.class.php +++ b/file/lib/system/chat/permission/ChatPermissionHandler.class.php @@ -1,6 +1,7 @@ getGroupIDs()); + $groupsFileName = \wcf\util\StringUtil::getHash(implode('-', WCF::getUser()->getGroupIDs())); + CacheHandler::getInstance()->addResource('chatPermission-'.$groups, WCF_DIR.'cache/cache.chatPermission-'.$groupsFileName.'.php', 'wcf\system\cache\builder\ChatPermissionCacheBuilder'); + $this->chatPermissions = CacheHandler::getInstance()->get('chatPermission-'.$groups); // get user permissions if (WCF::getUser()->userID) { @@ -87,5 +93,6 @@ public static function clearCache() { $ush = \wcf\system\user\storage\UserStorageHandler::getInstance(); $ush->resetAll('chatUserPermissions', $packageID); + \wcf\system\cache\CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.chatPermission-[a-f0-9]{40}.php'); } } \ No newline at end of file