15 if (!CSocNetGroup::__ValidateID(
$ID))
23 if (!CSocNetGroup::DeleteNoDemand(
$ID))
38 CSocNetUserToGroup::DeleteNoDemand(
$ID);
42 CSocNetFeatures::DeleteNoDemand(
$ID);
43 CSocNetSubscription::DeleteEx(
$ID);
55 $rsUser = CUser::GetByID(
$arFields[
"ID"]);
56 if (($arUser = $rsUser->Fetch()) && !defined(
"GLOBAL_ACTIVE_VALUE"))
58 define(
"GLOBAL_ACTIVE_VALUE", $arUser[
"ACTIVE"]);
69 \CSocNetUser::DisableModuleAdmin();
76 && defined(
"GLOBAL_ACTIVE_VALUE")
77 && GLOBAL_ACTIVE_VALUE !=
$arFields[
"ACTIVE"]
97 CSocNetGroup::SetStat($group);
106 if (!
$USER->IsAuthorized())
109 CUser::SetLastActivityDate(
$USER->GetID(),
true);
116 if ((
int)$user_id <= 0)
121 $bIM = Loader::includeModule(
'im');
123 $dbRelation = CSocNetUserToGroup::GetList(
126 "USER_ID" => $user_id,
132 array(
"ID",
"GROUP_ID")
134 while ($arRelation = $dbRelation->Fetch())
137 CSocNetUserToGroup::UserConfirmRequestToBeMember($user_id, $arRelation[
"ID"],
false)
138 && defined(
"BX_COMP_MANAGED_CACHE")
141 $CACHE_MANAGER->ClearByTag(
"sonet_user2group_G".$arRelation[
"GROUP_ID"]);
146 CIMNotify::DeleteByTag(
"SOCNET|INVITE_GROUP|".$user_id.
"|". (
int)$arRelation[
"ID"]);
154 $userID = (int)$userID;
160 return CUser::IsOnLine($userID);
165 return (COption::GetOptionString(
"socialnetwork",
"allow_frields",
"Y") ===
"Y");
170 return (COption::GetOptionString(
"socialnetwork",
"allow_frields_friends",
"Y") ===
"Y");
179 return isset(Application::getInstance()->getKernelSession()[
'SONET_ADMIN']);
188 Application::getInstance()->getKernelSession()[
'SONET_ADMIN'] =
'Y';
197 unset(Application::getInstance()->getKernelSession()[
'SONET_ADMIN']);
206 if (!is_object(
$USER) || !
$USER->IsAuthorized())
222 if (!isset($cache[$cacheKey]))
230 $modulePerms =
$APPLICATION->GetGroupRight(
"socialnetwork",
false,
"Y",
"Y",
array($site_id_tmp,
false));
231 if ($modulePerms >=
"W")
241 $result = ($modulePerms >=
"W");
273 return (array_key_exists($userID, $arModuleAdmin));
284 $lastName = Trim($lastName);
288 if ($formatName <>
'' && $lastName <>
'')
292 $formatName .= $lastName;
293 if ($formatName ==
'')
304 $lastName = Trim($lastName);
305 $secondName = Trim($secondName);
311 if ($formatName <>
'' && $secondName <>
'')
315 $formatName .= $secondName;
316 if ($formatName <>
'' && $lastName <>
'')
320 $formatName .= $lastName;
321 if ($formatName ==
'')
328 $formatName .=
" <" .
$email .
">";
330 $formatName .=
" [".$id.
"]";
342 if ($user.
"|" == (
int)$user .
"|")
344 $userID = (int)$user;
349 $arMatches =
array();
350 if (preg_match(
"#\[(\d+)\]#i", $user, $arMatches))
352 $userID = (int)$arMatches[1];
362 $dbUsers = CUser::GetList(
367 "NAV_PARAMS" =>
false,
374 $arMatches =
array();
375 if (preg_match(
"#<(.+?)>#i", $user, $arMatches))
381 $user = Trim(Str_Replace(
"<".
$email.
">",
"", $user));
386 $arUserTmp = Explode(
" ", $user);
387 foreach ($arUserTmp as $s)
405 $dbUsers = CUser::GetList(
"id",
"asc",
$arFilter);
409 $dbUsers = CUser::SearchUserByName($arUser,
$email);
416 while ($arUsers = $dbUsers->GetNext())
420 $arUsers[
"SECOND_NAME"],
421 $arUsers[
"LAST_NAME"],
438 $dbUser = CUser::GetByID(
$ID);
439 if ($arUser = $dbUser->GetNext())
441 $arUser[
"NAME_FORMATTED"] = CUser::FormatName(CSite::GetNameFormat(
false), $arUser);
457 "SECOND_NAME" =>
GetMessage(
"SONET_UP1_SECOND_NAME"),
458 "LAST_NAME" =>
GetMessage(
"SONET_UP1_LAST_NAME"),
460 "TIME_ZONE" =>
GetMessage(
"SONET_UP1_TIME_ZONE"),
461 "LAST_LOGIN" =>
GetMessage(
"SONET_UP1_LAST_LOGIN"),
462 "LAST_ACTIVITY_DATE" =>
GetMessage(
"SONET_UP1_LAST_ACTIVITY_DATE"),
463 "DATE_REGISTER" =>
GetMessage(
"SONET_UP1_DATE_REGISTER"),
465 "PASSWORD" =>
GetMessage(
"SONET_UP1_PASSWORD"),
466 "PERSONAL_BIRTHDAY" =>
GetMessage(
"SONET_UP1_PERSONAL_BIRTHDAY"),
467 "PERSONAL_BIRTHDAY_YEAR" =>
GetMessage(
"SONET_UP1_PERSONAL_BIRTHDAY_YEAR"),
468 "PERSONAL_BIRTHDAY_DAY" =>
GetMessage(
"SONET_UP1_PERSONAL_BIRTHDAY_DAY"),
470 "PERSONAL_PROFESSION" =>
GetMessage(
"SONET_UP1_PERSONAL_PROFESSION"),
471 "PERSONAL_WWW" =>
GetMessage(
"SONET_UP1_PERSONAL_WWW"),
472 "PERSONAL_ICQ" =>
GetMessage(
"SONET_UP1_PERSONAL_ICQ"),
473 "PERSONAL_GENDER" =>
GetMessage(
"SONET_UP1_PERSONAL_GENDER"),
474 "PERSONAL_PHOTO" =>
GetMessage(
"SONET_UP1_PERSONAL_PHOTO"),
475 "PERSONAL_NOTES" =>
GetMessage(
"SONET_UP1_PERSONAL_NOTES"),
477 "PERSONAL_PHONE" =>
GetMessage(
"SONET_UP1_PERSONAL_PHONE"),
478 "PERSONAL_FAX" =>
GetMessage(
"SONET_UP1_PERSONAL_FAX"),
479 "PERSONAL_MOBILE" =>
GetMessage(
"SONET_UP1_PERSONAL_MOBILE"),
480 "PERSONAL_PAGER" =>
GetMessage(
"SONET_UP1_PERSONAL_PAGER"),
482 "PERSONAL_COUNTRY" =>
GetMessage(
"SONET_UP1_PERSONAL_COUNTRY"),
483 "PERSONAL_STATE" =>
GetMessage(
"SONET_UP1_PERSONAL_STATE"),
484 "PERSONAL_CITY" =>
GetMessage(
"SONET_UP1_PERSONAL_CITY"),
485 "PERSONAL_ZIP" =>
GetMessage(
"SONET_UP1_PERSONAL_ZIP"),
486 "PERSONAL_STREET" =>
GetMessage(
"SONET_UP1_PERSONAL_STREET"),
487 "PERSONAL_MAILBOX" =>
GetMessage(
"SONET_UP1_PERSONAL_MAILBOX"),
489 "WORK_COMPANY" =>
GetMessage(
"SONET_UP1_WORK_COMPANY"),
490 "WORK_DEPARTMENT" =>
GetMessage(
"SONET_UP1_WORK_DEPARTMENT"),
491 "WORK_POSITION" =>
GetMessage(
"SONET_UP1_WORK_POSITION"),
492 "WORK_WWW" =>
GetMessage(
"SONET_UP1_WORK_WWW"),
493 "WORK_PROFILE" =>
GetMessage(
"SONET_UP1_WORK_PROFILE"),
494 "WORK_LOGO" =>
GetMessage(
"SONET_UP1_WORK_LOGO"),
495 "WORK_NOTES" =>
GetMessage(
"SONET_UP1_WORK_NOTES"),
497 "WORK_PHONE" =>
GetMessage(
"SONET_UP1_WORK_PHONE"),
498 "WORK_FAX" =>
GetMessage(
"SONET_UP1_WORK_FAX"),
499 "WORK_PAGER" =>
GetMessage(
"SONET_UP1_WORK_PAGER"),
501 "WORK_COUNTRY" =>
GetMessage(
"SONET_UP1_WORK_COUNTRY"),
502 "WORK_STATE" =>
GetMessage(
"SONET_UP1_WORK_STATE"),
503 "WORK_CITY" =>
GetMessage(
"SONET_UP1_WORK_CITY"),
504 "WORK_ZIP" =>
GetMessage(
"SONET_UP1_WORK_ZIP"),
505 "WORK_STREET" =>
GetMessage(
"SONET_UP1_WORK_STREET"),
506 "WORK_MAILBOX" =>
GetMessage(
"SONET_UP1_WORK_MAILBOX"),
509 if (ModuleManager::isModuleInstalled(
'forum'))
511 $arRes[
"FORUM_SHOW_NAME"] =
GetMessage(
"SONET_UP1_FORUM_PREFIX").GetMessage(
"SONET_UP1_FORUM_SHOW_NAME");
512 $arRes[
"FORUM_DESCRIPTION"] =
GetMessage(
"SONET_UP1_FORUM_PREFIX").GetMessage(
"SONET_UP1_FORUM_DESCRIPTION");
513 $arRes[
"FORUM_INTERESTS"] =
GetMessage(
"SONET_UP1_FORUM_PREFIX").GetMessage(
"SONET_UP1_FORUM_INTERESTS");
514 $arRes[
"FORUM_SIGNATURE"] =
GetMessage(
"SONET_UP1_FORUM_PREFIX").GetMessage(
"SONET_UP1_FORUM_SIGNATURE");
515 $arRes[
"FORUM_AVATAR"] =
GetMessage(
"SONET_UP1_FORUM_PREFIX").GetMessage(
"SONET_UP1_FORUM_AVATAR");
516 $arRes[
"FORUM_HIDE_FROM_ONLINE"] =
GetMessage(
"SONET_UP1_FORUM_PREFIX").GetMessage(
"SONET_UP1_FORUM_HIDE_FROM_ONLINE");
517 $arRes[
"FORUM_SUBSC_GET_MY_MESSAGE"] =
GetMessage(
"SONET_UP1_FORUM_PREFIX").GetMessage(
"SONET_UP1_FORUM_SUBSC_GET_MY_MESSAGE");
520 if (ModuleManager::isModuleInstalled(
'blog'))
522 $arRes[
"BLOG_ALIAS"] =
GetMessage(
"SONET_UP1_BLOG_PREFIX").GetMessage(
"SONET_UP1_BLOG_ALIAS");
523 $arRes[
"BLOG_DESCRIPTION"] =
GetMessage(
"SONET_UP1_BLOG_PREFIX").GetMessage(
"SONET_UP1_BLOG_DESCRIPTION");
524 $arRes[
"BLOG_INTERESTS"] =
GetMessage(
"SONET_UP1_BLOG_PREFIX").GetMessage(
"SONET_UP1_BLOG_INTERESTS");
525 $arRes[
"BLOG_AVATAR"] =
GetMessage(
"SONET_UP1_BLOG_PREFIX").GetMessage(
"SONET_UP1_BLOG_AVATAR");
534 return array_keys($arUserFields);
546 $dbUser = \CUser::getById((
int)$arUser);
547 $arUser = $dbUser->fetch();
552 || !isset($arUser[
"ID"])
553 || (
int)$arUser[
"ID"] <= 0
560 (
int)$currentUserId === (
int)
$USER->GetId()
561 && self::isCurrentUserModuleAdmin()
567 if (self::OnGetProfileView($currentUserId, $arUser,
$siteId, $arContext))
572 if (self::isCalendarSharingUser($currentUserId, $arUser,
$siteId, $arContext))
578 foreach(
GetModuleEvents(
"socialnetwork",
"OnGetProfileView",
true) as $arEvent)
580 if (ModuleManager::isModuleInstalled($arEvent[
'TO_MODULE_ID']))
595 if (!ModuleManager::isModuleInstalled(
'mail'))
600 $currentUserId = (int)$currentUserId;
604 || !is_array($arUser)
611 isset($arUser[
'EXTERNAL_AUTH_ID'])
612 && $arUser[
'EXTERNAL_AUTH_ID'] ===
'email'
613 && Loader::includeModule(
'intranet')
616 $res = \Bitrix\Intranet\UserTable::getList([
618 '=ID' => $currentUserId,
620 'select' => [
'USER_TYPE' ],
624 ($currentUserFields =
$res->fetch())
625 && $currentUserFields[
'USER_TYPE'] ===
'employee'
633 !isset($arContext[
'ENTITY_TYPE'], $arContext[
'ENTITY_ID'], $arUser[
'ID'])
634 || (
int)$arContext[
'ENTITY_ID'] <= 0
635 || $arContext[
'ENTITY_TYPE'] !==
'LOG_ENTRY'
636 || (
int)$arUser[
'ID'] <= 0
644 isset($arUser[
'EXTERNAL_AUTH_ID'])
645 && $arUser[
'EXTERNAL_AUTH_ID'] ===
'email'
649 (
$res = \CUser::getById($currentUserId))
650 && ($currentUserFields =
$res->fetch())
651 && ($currentUserFields[
'EXTERNAL_AUTH_ID'] ===
'email')
655 return self::CheckContext($currentUserId, $arUser[
'ID'], $arContext);
661 private static function isCalendarSharingUser($currentUserId, $arUser,
$siteId, $arContext)
663 if (!ModuleManager::isModuleInstalled(
'calendar'))
668 $currentUserId = (int)$currentUserId;
672 || !is_array($arUser)
679 isset($arUser[
'EXTERNAL_AUTH_ID'])
680 && $arUser[
'EXTERNAL_AUTH_ID'] ===
'calendar_sharing'
681 && Loader::includeModule(
'intranet')
684 $res = \Bitrix\Intranet\UserTable::getList([
686 '=ID' => $currentUserId,
688 'select' => [
'USER_TYPE' ],
692 ($currentUserFields =
$res->fetch())
693 && $currentUserFields[
'USER_TYPE'] ===
'employee'
701 !isset($arContext[
'ENTITY_TYPE'], $arContext[
'ENTITY_ID'], $arUser[
'ID'])
702 || (
int)$arContext[
'ENTITY_ID'] <= 0
703 || $arContext[
'ENTITY_TYPE'] !==
'LOG_ENTRY'
704 || (
int)$arUser[
'ID'] <= 0
712 isset($arUser[
'EXTERNAL_AUTH_ID'])
713 && $arUser[
'EXTERNAL_AUTH_ID'] ===
'calendar_sharing'
717 (
$res = \CUser::getById($currentUserId))
718 && ($currentUserFields =
$res->fetch())
719 && ($currentUserFields[
'EXTERNAL_AUTH_ID'] ===
'calendar_sharing')
723 return self::CheckContext($currentUserId, $arUser[
'ID'], $arContext);
732 (
int)$currentUserId <= 0
734 || !is_array($arContext)
735 || empty($arContext[
"ENTITY_TYPE"])
736 || empty($arContext[
"ENTITY_ID"])
742 if ($arContext[
"ENTITY_TYPE"] ===
"LOG_ENTRY")
747 "LOG_ID" => (
int)$arContext[
"ENTITY_ID"]
751 $arLogEntryUserId = $arSonetGroupId = $arDepartmentId =
array();
752 $bIntranetInstalled = ModuleManager::IsModuleInstalled(
'intranet');
763 && !in_array(
$matches[1], $arSonetGroupId)
771 && !in_array(
$matches[1], $arDepartmentId)
778 if (!empty($arContext[
'SITE_ID']))
780 $arLogSite =
array();
782 while ($arSite = $rsSite->Fetch())
784 $arLogSite[] = $arSite[
"SITE_ID"];
787 return in_array($arContext[
'SITE_ID'], $arLogSite);
793 in_array($currentUserId, $arLogEntryUserId)
794 && in_array(
$userId, $arLogEntryUserId)
800 if (in_array(
$userId, $arLogEntryUserId))
802 if (!empty($arSonetGroupId))
804 foreach($arSonetGroupId as $groupId)
806 if (CSocNetUserToGroup::GetUserRole($currentUserId, $groupId) <=
SONET_ROLES_USER)
814 !empty($arDepartmentId)
815 && Loader::includeModule(
'intranet')
818 $arDepartmentUserId =
array();
820 $rsDepartmentUserId = \Bitrix\Intranet\Util::getDepartmentEmployees(
array(
821 'DEPARTMENTS' => $arDepartmentId,
825 'SELECT' =>
array(
'ID')
828 while ($arUser = $rsDepartmentUserId->Fetch())
830 $arDepartmentUserId[] = $arUser[
"ID"];
833 if (in_array($currentUserId, $arDepartmentUserId))
843 "ID" => (
int)$arContext[
"ENTITY_ID"]
851 if ($arLog = $rsLog->Fetch())
855 in_array($currentUserId, $arLogEntryUserId)
856 && (
$userId == $arLog[
"USER_ID"])
859 in_array(
$userId, $arLogEntryUserId)
860 && ($currentUserId == $arLog[
"USER_ID"])
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static deleteNoDemand($userId=0)
static deleteByGroupCode($value='')
static getModuleAdminList($siteIdList)
static DeleteNoDemand($userID)
static DeleteNoDemand($userID)
static DeleteNoDemand($userID)
static GetFieldsMap($bAdditional=false)
static OnGetProfileView($currentUserId, $arUser, $siteId, $arContext)
static IsUserModuleAdmin($userID, $site_id=SITE_ID)
static OnAfterUserUpdate(&$arFields)
static IsFriendsAllowed()
static OnUserInitialize($user_id, $arFields=array())
static OnAfterUserAdd(&$arFields)
static SearchUser($user, $bIntranet=false)
static DisableModuleAdmin()
static DeleteUserAdminCache()
static CanProfileView($currentUserId, $arUser, $siteId=SITE_ID, $arContext=[])
static IsEnabledModuleAdmin()
static IsCurrentUserModuleAdmin($site_id=SITE_ID, $bUseSession=true)
static FormatNameEx($name, $secondName, $lastName, $login, $email, $id)
static IsFriendsFriendsAllowed()
static OnBeforeUserUpdate(&$arFields)
static CheckContext($currentUserId=false, $userId=false, $arContext=array())
static OnAfterUserLogout(&$arParams)
static FormatName($name, $lastName, $login)
static GetFields($bAdditional=false)
static EnableModuleAdmin()
static DeleteNoDemand($userID)
static DeleteNoDemand($userID)
static GetList($arOrder=Array("ID"=> "DESC"), $arFilter=Array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array(), $arParams=array())
static DeleteNoDemand($userID)
static GetList($aSort=array(), $aFilter=array())
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
ExecuteModuleEventEx($arEvent, $arParams=[])
htmlspecialcharsback($str)
GetModuleEvents($MODULE_ID, $MESSAGE_ID, $bReturnArray=false)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
BXClearCache($full=false, $initdir='')
check_email($email, $strict=false, $domainCheck=false)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
const SONET_ROLES_REQUEST
const SONET_INITIATED_BY_GROUP