mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2025-01-09 00:20:08 +00:00
Include ACL-group-permissions as well
This commit is contained in:
parent
dbd4e7b849
commit
4152462ade
@ -14,7 +14,7 @@
|
|||||||
'wcf.icon.users': '{@$__wcf->getPath('wcf')}icon/users1.svg'
|
'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});
|
||||||
});
|
});
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
|
@ -21,8 +21,7 @@ class ChatRoomEditor extends \wcf\data\DatabaseObjectEditor implements \wcf\data
|
|||||||
* Clears the room cache.
|
* Clears the room cache.
|
||||||
*/
|
*/
|
||||||
public static function resetCache() {
|
public static function resetCache() {
|
||||||
ChatRoom::getCache();
|
\wcf\system\cache\CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.chatrooms.php');
|
||||||
\wcf\system\cache\CacheHandler::getInstance()->clearResource('chatrooms');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace wcf\system\chat\permission;
|
namespace wcf\system\chat\permission;
|
||||||
use \wcf\system\acl\ACLHandler;
|
use \wcf\system\acl\ACLHandler;
|
||||||
|
use \wcf\system\cache\CacheHandler;
|
||||||
use \wcf\system\package\PackageDependencyHandler;
|
use \wcf\system\package\PackageDependencyHandler;
|
||||||
use \wcf\system\WCF;
|
use \wcf\system\WCF;
|
||||||
|
|
||||||
@ -22,7 +23,12 @@ class ChatPermissionHandler extends \wcf\system\SingletonFactory {
|
|||||||
protected function init() {
|
protected function init() {
|
||||||
$packageID = PackageDependencyHandler::getPackageID('timwolla.wcf.chat');
|
$packageID = PackageDependencyHandler::getPackageID('timwolla.wcf.chat');
|
||||||
$ush = \wcf\system\user\storage\UserStorageHandler::getInstance();
|
$ush = \wcf\system\user\storage\UserStorageHandler::getInstance();
|
||||||
// TODO: get groups permissions
|
|
||||||
|
// get groups permissions
|
||||||
|
$groups = implode(',', WCF::getUser()->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
|
// get user permissions
|
||||||
if (WCF::getUser()->userID) {
|
if (WCF::getUser()->userID) {
|
||||||
@ -87,5 +93,6 @@ public static function clearCache() {
|
|||||||
$ush = \wcf\system\user\storage\UserStorageHandler::getInstance();
|
$ush = \wcf\system\user\storage\UserStorageHandler::getInstance();
|
||||||
|
|
||||||
$ush->resetAll('chatUserPermissions', $packageID);
|
$ush->resetAll('chatUserPermissions', $packageID);
|
||||||
|
\wcf\system\cache\CacheHandler::getInstance()->clear(WCF_DIR.'cache', 'cache.chatPermission-[a-f0-9]{40}.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user