97 $cacheTime = defined(
'BX_COMP_MANAGED_CACHE') ? 3153600 : 3600*4;
98 $cacheId =
'report-rights-'.$this->userId;
99 $cacheDir =
'/report/rights/'.$this->userId;
100 $cache =
new CPHPCache;
101 if($cache->initCache($cacheTime, $cacheId, $cacheDir))
103 $listEntity = $cache->getVars();
107 global $CACHE_MANAGER;
108 $cache->startDataCache();
110 $userObject = \CUser::getByID($this->userId);
111 if($userData = $userObject->fetch())
113 if(Loader::includeModule(
'socialnetwork'))
115 $queryObject = UserToGroupTable::getList(array(
116 'select' => array(
'GROUP_ID'),
118 'USER_ID' => $userData[
'ID'],
120 UserToGroupTable::ROLE_USER,
121 UserToGroupTable::ROLE_MODERATOR,
122 UserToGroupTable::ROLE_OWNER
126 while ($groupData = $queryObject->fetch())
130 if(!empty($userData[
'UF_DEPARTMENT']))
132 $parentDepartmentList = array();
133 foreach($userData[
'UF_DEPARTMENT'] as $departmentId)
134 $parentDepartmentList[] = \CIntranetUtils::getIBlockTopSection($departmentId);
136 $childrenDepartmentList = \CIntranetUtils::getIBlockSectionChildren($parentDepartmentList);
137 foreach($childrenDepartmentList as $departmentId)
141 $CACHE_MANAGER->startTagCache($cacheDir);
142 $CACHE_MANAGER->registerTag(
"sonet_user2group_U".$this->userId);
143 $CACHE_MANAGER->registerTag(
"USER_CARD_".intval($this->userId/TAGGED_user_card_size));
144 $CACHE_MANAGER->endTagCache();
145 $cache->endDataCache($listEntity);