176 if (is_array($rights))
178 foreach ($rights as $right)
181 !in_array($right, $excludeCodes)
183 preg_match(
'/^SG(\d+)$/i', $right, $matches)
184 || preg_match(
'/^U(\d+)$/i', $right, $matches)
185 || preg_match(
'/^DR(\d+)$/i', $right, $matches)
186 || preg_match(
'/^CRMCONTACT(\d+)$/i', $right, $matches)
187 || preg_match(
'/^CRMCOMPANY(\d+)$/i', $right, $matches)
188 || preg_match(
'/^CRMLEAD(\d+)$/i', $right, $matches)
189 || preg_match(
'/^CRMDEAL(\d+)$/i', $right, $matches)
193 $result[] = mb_strtoupper($right);
197 $result = array_unique($result);
240 $res = \CUserOptions::getList(
243 "CATEGORY" =>
"socialnetwork",
244 "NAME" =>
"log_destination"
248 while ($option = $res->fetch())
250 if (!empty($option[
"VALUE"]))
252 $optionValue = unserialize($option[
"VALUE"], [
'allowed_classes' =>
false]);
254 if (is_array($optionValue))
256 foreach ($optionValue as $key => $val)
260 [
"users",
"sonetgroups",
"department",
"companies",
"contacts",
"leads",
"deals"]
263 $codes = \CUtil::jsObjectToPhp($val);
264 if (is_array($codes))
266 \Bitrix\Main\FinderDestTable::merge(
268 "USER_ID" => $option[
"USER_ID"],
269 "CONTEXT" =>
"blog_post",
270 "CODE" => array_keys($codes)
280 $res = \CUserOptions::getList(
284 "NAME" =>
"log_destination"
288 while ($option = $res->fetch())
290 if (!empty($option[
"VALUE"]))
292 $optionValue = unserialize($option[
"VALUE"], [
'allowed_classes' =>
false]);
294 if (is_array($optionValue))
296 foreach ($optionValue as $key => $val)
298 $codes = explode(
',', $val);
299 if (is_array($codes))
301 \Bitrix\Main\FinderDestTable::merge(
303 "USER_ID" => $option[
"USER_ID"],
304 "CONTEXT" =>
"crm_post",