Update manager.php

This commit is contained in:
macjohnny 2014-06-21 16:06:11 +02:00
parent 6a3d6d3e4b
commit 405e89f45a
1 changed files with 11 additions and 3 deletions

View File

@ -60,24 +60,32 @@ class Manager extends PublicEmitter {
$this->userManager = $userManager;
$cachedGroups = & $this->cachedGroups;
$cachedUserGroups = & $this->cachedUserGroups;
$this->listen('\OC\Group', 'postDelete', function ($group) use (&$cachedGroups, &$cachedUserGroups) {
$cachedUserGroupIds = & $this->cachedUserGroupIds;
$this->listen('\OC\Group', 'postDelete', function ($group) use (&$cachedGroups, &$cachedUserGroups, &$cachedUserGroupIds) {
/**
* @var \OC\Group\Group $group
*/
unset($cachedGroups[$group->getGID()]);
$cachedUserGroups = array();
$Position = array_search($group->getGID(), $cachedUserGroupIds);
if($Position !== false)
{
unset($cachedUserGroupIds[$Position]);
}
});
$this->listen('\OC\Group', 'postAddUser', function ($group) use (&$cachedUserGroups) {
$this->listen('\OC\Group', 'postAddUser', function ($group) use (&$cachedUserGroups, &$cachedUserGroupIds) {
/**
* @var \OC\Group\Group $group
*/
$cachedUserGroups = array();
$cachedUserGroupIds = array();
});
$this->listen('\OC\Group', 'postRemoveUser', function ($group) use (&$cachedUserGroups) {
$this->listen('\OC\Group', 'postRemoveUser', function ($group) use (&$cachedUserGroups, &$cachedUserGroupIds) {
/**
* @var \OC\Group\Group $group
*/
$cachedUserGroups = array();
$cachedUserGroupIds = array();
});
}