17 if (!self::checkModules())
28 $cacheId =
'im_sonet_extranet_v3_'.$userId;
29 $cachePath =
'/bx/imc/sonet/extranet'.\Bitrix\Im\Common::getCacheUserPostfix(
$userId);
34 if($cache->initCache(self::CACHE_TOKEN_TTL, $cacheId, $cachePath))
36 return $cache->getVars();
39 $cache->startDataCache();
41 $taggedCache->startTagCache($cachePath);
43 $db = \CSocNetUserToGroup::GetList(
48 "GROUP_SITE_ID" => \CExtranet::GetExtranetSiteID(),
49 "GROUP_ACTIVE" =>
"Y",
54 array(
"ID",
"GROUP_ID",
"GROUP_NAME")
59 while ($row = $db->GetNext(
true,
false))
61 $groupIds[] = $row[
"GROUP_ID"];
63 'ID' =>
'SG'.$row[
'GROUP_ID'],
64 'NAME' => Loc::getMessage(
'IM_INT_SN_GROUP_EXTRANET', Array(
'#GROUP_NAME#' => $row[
'GROUP_NAME'])),
68 $taggedCache->registerTag(
'sonet_group_'.$row[
'GROUP_ID']);
69 $taggedCache->registerTag(
'sonet_user2group_G'.$row[
'GROUP_ID']);
77 $taggedCache->registerTag(
'sonet_user2group');
79 $taggedCache->endTagCache();
82 '@GROUP_ID' => $groupIds,
84 'USER_CONFIRM_CODE' =>
false
87 if ($filterActiveUser)
92 $db = \CSocNetUserToGroup::GetList(
97 [
'ID',
'USER_ID',
'GROUP_ID']
99 while ($row = $db->GetNext(
true,
false))
101 if($row[
'USER_ID'] ==
$userId || !isset(
$groups[
'SG'.$row[
'GROUP_ID']]))
104 $groups[
'SG'.$row[
'GROUP_ID']][
'USERS'][] = $row[
'USER_ID'];