15 $GLOBALS[
"APPLICATION"]->ThrowException(
"System error 870164",
"ERROR");
21 $GLOBALS[
"APPLICATION"]->ThrowException(
GetMessage(
"SONET_GB_EMPTY_USER_ID"),
"EMPTY_USER_ID");
29 $GLOBALS[
"APPLICATION"]->ThrowException(
GetMessage(
"SONET_GB_ERROR_NO_USER_ID"),
"ERROR_NO_USER_ID");
36 $GLOBALS[
"APPLICATION"]->ThrowException(
GetMessage(
"SONET_GG_EMPTY_OPERATION_ID"),
"EMPTY_OPERATION_ID");
41 $GLOBALS[
"APPLICATION"]->ThrowException(str_replace(
"#ID#",
$arFields[
"OPERATION_ID"],
GetMessage(
"SONET_GG_ERROR_NO_OPERATION_ID")),
"ERROR_NO_OPERATION_ID");
47 $GLOBALS[
"APPLICATION"]->ThrowException(
GetMessage(
"SONET_GG_EMPTY_RELATION_TYPE"),
"EMPTY_RELATION_TYPE");
52 $GLOBALS[
"APPLICATION"]->ThrowException(str_replace(
"#ID#",
$arFields[
"RELATION_TYPE"],
GetMessage(
"SONET_GG_ERROR_NO_RELATION_TYPE")),
"ERROR_NO_RELATION_TYPE");
70 if (!CSocNetGroup::__ValidateID(
$ID))
77 $bSuccess =
$DB->Query(
"DELETE FROM b_sonet_user_perms WHERE ID = ".
$ID.
"",
true);
86 if (!CSocNetGroup::__ValidateID($userID))
89 $userID = intval($userID);
93 $bSuccess =
$DB->Query(
"DELETE FROM b_sonet_user_perms WHERE USER_ID = ".$userID.
"",
true);
102 if (!CSocNetGroup::__ValidateID(
$ID))
112 $strUpdate =
$DB->PrepareUpdate(
"b_sonet_user_perms",
$arFields);
115 if ($strUpdate <>
'')
118 "UPDATE b_sonet_user_perms SET ".
120 "WHERE ID = ".$ID.
" ";
138 if (!CSocNetGroup::__ValidateID(
$ID))
158 static $arCachedUserPerms;
162 && !$arCachedUserPerms
164 $arCachedUserPerms =
array();
166 if (!is_array($userID))
168 $userID = intval($userID);
173 $operation = mb_strtolower(Trim($operation));
177 $arUserPerms =
array();
180 && isset(
$GLOBALS[
"SONET_USER_PERMS_".$userID])
181 && is_array(
$GLOBALS[
"SONET_USER_PERMS_".$userID])
182 && !array_key_exists(
"SONET_USER_PERMS_".$userID,
$_REQUEST)
184 $arUserPerms =
$GLOBALS[
"SONET_USER_PERMS_".$userID];
187 && isset($arCachedUserPerms[$userID])
188 && is_array($arCachedUserPerms[$userID])
189 && !array_key_exists(
"SONET_USER_PERMS_".$userID,
$_REQUEST)
191 $arUserPerms = $arCachedUserPerms[$userID];
197 if (!is_array($userID))
202 if (!is_array($userID))
203 $GLOBALS[
"SONET_USER_PERMS_".$userID] = $arUserPerms;
206 if (!is_array($userID))
208 $toUserOperationPerms = (
209 array_key_exists($operation, $arUserPerms)
210 ? $arUserPerms[$operation]
219 return $toUserOperationPerms;
223 foreach ($userID as $user_id_tmp)
224 if (!array_key_exists($user_id_tmp, $arCachedUserPerms))
225 $arCachedUserPerms[$user_id_tmp] =
array();
231 public static function CanPerformOperation($fromUserID, $toUserID, $operation, $bCurrentUserIsAdmin =
false)
235 $fromUserID = intval($fromUserID);
236 $toUserID = intval($toUserID);
239 $operation = mb_strtolower(Trim($operation));
244 if (CModule::IncludeModule(
'extranet') && CExtranet::IsExtranetSite())
247 if ($bCurrentUserIsAdmin)
249 if ($fromUserID == $toUserID)
266 return ($fromUserID > 0);
280 public static function InitUserPerms($currentUserID, $userID, $bCurrentUserIsAdmin)
286 $currentUserID = intval($currentUserID);
287 $userID = intval($userID);
294 $arReturn[
"Operations"] =
array();
295 if ($currentUserID <= 0)
297 $arReturn[
"IsCurrentUser"] =
false;
298 $arReturn[
"Relation"] =
false;
299 $arReturn[
"Operations"][
"modifyuser"] =
false;
300 $arReturn[
"Operations"][
"viewcontacts"] =
false;
308 $arReturn[
"IsCurrentUser"] = ($currentUserID == $userID);
309 $arReturn[
"Relation"] = (
310 $arReturn[
"IsCurrentUser"]
317 || $arReturn[
"IsCurrentUser"]
320 $arReturn[
"Operations"][
"modifyuser"] =
true;
321 $arReturn[
"Operations"][
"viewcontacts"] =
true;
324 $arReturn[
"Operations"][$operation] =
true;
329 $arReturn[
"Operations"][
"modifyuser"] =
false;
330 $arReturn[
"Operations"][
"viewcontacts"] = (
331 CSocNetUser::IsFriendsAllowed()
341 $arReturn[
"Operations"][
"modifyuser_main"] =
false;
342 if ($arReturn[
"IsCurrentUser"])
344 if (
$USER->CanDoOperation(
'edit_own_profile'))
346 $arReturn[
"Operations"][
"modifyuser_main"] =
true;
350 $USER->CanDoOperation(
'edit_all_users')
352 $USER->CanDoOperation(
'edit_subordinate_users')
357 $arReturn[
"Operations"][
"modifyuser_main"] =
true;
366 $userID = intval($userID);
367 $feature = Trim($feature);
373 "USER_ID" => $userID,
374 "OPERATION_ID" => $feature,
389 if ($e =
$GLOBALS[
"APPLICATION"]->GetException())
397 elseif ($feature ==
"viewprofile")
398 unset(
$GLOBALS[
"SONET_USER_PERMS_".$userID]);
static processEqualityFieldsToUpdate($fields1, &$update)
static getEqualityFields(&$fields)
static GetOperationPerms($userID, $operation)
static InitUserPerms($currentUserID, $userID, $bCurrentUserIsAdmin)
static CheckFields($ACTION, &$arFields, $ID=0)
static CanPerformOperation($fromUserID, $toUserID, $operation, $bCurrentUserIsAdmin=false)
static SetPerm($userID, $feature, $perm)
static Update($ID, $arFields)
static DeleteNoDemand($userID)
static GetRelation($firstUserID, $secondUserID)
static IsFriends($firstUserID, $secondUserID)
static GetList($arOrder=Array("ID"=> "DESC"), $arFilter=Array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
while($arParentIBlockProperty=$dbParentIBlockProperty->Fetch()) $errorMessage
IsModuleInstalled($module_id)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
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_RELATIONS_FRIEND
const SONET_RELATIONS_TYPE_FRIENDS
const SONET_RELATIONS_TYPE_FRIENDS2
const SONET_RELATIONS_TYPE_ALL
const SONET_RELATIONS_TYPE_AUTHORIZED
foreach($arLogEvents as $eventCode=> $arLogEventTmp) global $arSocNetUserOperations
const SONET_RELATIONS_TYPE_NONE
global $arSocNetAllowedRelationsType
const SONET_RELATIONS_BAN
$GLOBALS['_____370096793']