1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
updtr1107.php
См. документацию.
1<?
2if (CModule::IncludeModule("socialnetwork"))
3{
4 $GLOBALS["DB"]->Query("TRUNCATE TABLE b_sonet_log_right");
5 $rsLog = CSocNetLog::GetList(array("ID"=>"DESC"), array(), false, false, array("ID", "ENTITY_TYPE", "ENTITY_ID", "EVENT_ID"));
6 while ($arLog = $rsLog->Fetch())
7 {
9 if (in_array($arLog["ENTITY_TYPE"], array(SONET_SUBSCRIBE_ENTITY_GROUP, SONET_SUBSCRIBE_ENTITY_USER)))
10 {
11 if ($arLog["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP && $arLog["EVENT_ID"] == "system")
12 CSocNetLogRights::Add($arLog["ID"], array("SA", "SG".$arLog["ENTITY_ID"]."_".SONET_ROLES_OWNER, "SG".$arLog["ENTITY_ID"]."_".SONET_ROLES_MODERATOR, "SG".$arLog["ENTITY_ID"]."_".SONET_ROLES_USER));
13 elseif ($arLog["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_USER && in_array($arLog["EVENT_ID"], array("system", "system_groups", "system_friends")))
14 {
15 switch ($arLog["EVENT_ID"])
16 {
17 case "system": $operation = "viewprofile"; break;
18 case "system_groups": $operation = "viewgroups"; break;
19 case "system_friends": $operation = "viewfriends"; break;
20 }
21
22 $perm = CSocNetUserPerms::GetOperationPerms($arLog["ENTITY_ID"], $operation);
24 CSocNetLogRights::Add($arLog["ID"], array("SA", "U".$arLog["ENTITY_ID"], "SU".$arLog["ENTITY_ID"]."_".$perm));
26 CSocNetLogRights::Add($arLog["ID"], array("SA", "U".$arLog["ENTITY_ID"]));
28 CSocNetLogRights::Add($arLog["ID"], array("SA", "AU"));
30 CSocNetLogRights::Add($arLog["ID"], array("SA", "G2"));
31 }
32 elseif ($featureID = CSocNetLogTools::FindFeatureByEventID($arLog["EVENT_ID"]))
34 $arLog["ID"],
35 $arLog["ENTITY_TYPE"],
36 $arLog["ENTITY_ID"],
37 $featureID,
38 $GLOBALS["arSocNetFeaturesSettings"][$featureID]["subscribe_events"][$arLog["EVENT_ID"]]["OPERATION"]
39 );
40 elseif ($arLog["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP)
41 CSocNetLogRights::Add($arLog["ID"], array("SA", "SG".$arLog["ENTITY_ID"]."_".SONET_ROLES_OWNER, "SG".$arLog["ENTITY_ID"]."_".SONET_ROLES_MODERATOR, "SG".$arLog["ENTITY_ID"]."_".SONET_ROLES_USER));
42 elseif ($arLog["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_USER)
43 {
44 $perm = CSocNetUserPerms::GetOperationPerms($arLog["ENTITY_ID"], "viewprofile");
46 CSocNetLogRights::Add($arLog["ID"], array("SA", "U".$arLog["ENTITY_ID"], "SU".$arLog["ENTITY_ID"]."_".$perm));
48 CSocNetLogRights::Add($arLog["ID"], array("SA", "U".$arLog["ENTITY_ID"]));
50 CSocNetLogRights::Add($arLog["ID"], array("SA", "AU"));
52 CSocNetLogRights::Add($arLog["ID"], array("SA", "G2"));
53
54// tasks!!!
55
56 }
57 }
58 elseif (in_array($arLog["ENTITY_TYPE"], array('R')))
59 {
60// reports
61 }
62 elseif (in_array($arLog["ENTITY_TYPE"], array('T')))
63 {
64// timeman
65 }
66 else
67 CSocNetLogRights::Add($arLog["ID"], array("AU"));
68 }
69}
70?>
static GetOperationPerms($userID, $operation)
Определения user_perms.php:155
static GetList($arOrder=Array("ID"=> "DESC"), $arFilter=Array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array(), $arParams=array())
Определения log.php:338
static SetForSonet($logID, $entity_type, $entity_id, $feature, $operation, $bNew=false)
Определения log_rights.php:320
static DeleteByLogID($LOG_ID)
Определения log_rights.php:232
static Add($LOG_ID, $GROUP_CODE, $bShare=false, $followSet=true)
Определения log_rights.php:8
static FindFeatureByEventID($event_id)
Определения log_tools.php:15
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$perm
Определения options.php:169
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
const SONET_ROLES_USER
Определения include.php:31
const SONET_SUBSCRIBE_ENTITY_USER
Определения include.php:121
const SONET_SUBSCRIBE_ENTITY_GROUP
Определения include.php:120
const SONET_ROLES_MODERATOR
Определения include.php:30
const SONET_ROLES_OWNER
Определения include.php:29
const SONET_RELATIONS_TYPE_FRIENDS
Определения include.php:41
const SONET_RELATIONS_TYPE_FRIENDS2
Определения include.php:40
const SONET_RELATIONS_TYPE_ALL
Определения include.php:38
const SONET_RELATIONS_TYPE_AUTHORIZED
Определения include.php:39
const SONET_RELATIONS_TYPE_NONE
Определения include.php:42
$GLOBALS['_____370096793']
Определения update_client.php:1