本文整理汇总了PHP中CSocNetUser::IsCurrentUserModuleAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetUser::IsCurrentUserModuleAdmin方法的具体用法?PHP CSocNetUser::IsCurrentUserModuleAdmin怎么用?PHP CSocNetUser::IsCurrentUserModuleAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetUser
的用法示例。
在下文中一共展示了CSocNetUser::IsCurrentUserModuleAdmin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onPrepareComponentParams
public function onPrepareComponentParams($params)
{
$this->arIBlock = CIBlock::GetArrayByID($params["IBLOCK_ID"]);
$this->arResult["IBLOCK"] = htmlspecialcharsex($this->arIBlock);
$this->arResult["IBLOCK_ID"] = $this->arIBlock["ID"];
$this->arResult["GRID_ID"] = "lists_list_elements_" . $this->arResult["IBLOCK_ID"];
$this->arResult["ANY_SECTION"] = isset($_GET["list_section_id"]) && strlen($_GET["list_section_id"]) == 0;
$this->arResult["SECTIONS"] = array();
$this->arResult["SECTION_ID"] = false;
$this->arResult["LIST_SECTIONS"] = array();
if (isset($_GET["list_section_id"])) {
$sectionId = intval($_GET["list_section_id"]);
} else {
$sectionId = intval($params["SECTION_ID"]);
}
$rsSections = CIBlockSection::GetList(array("left_margin" => "asc"), array("IBLOCK_ID" => $this->arIBlock["ID"], "GLOBAL_ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y"));
while ($arSection = $rsSections->GetNext()) {
$this->arResult["SECTIONS"][$arSection["ID"]] = array("ID" => $arSection["ID"], "NAME" => $arSection["NAME"]);
if ($arSection["ID"] == $sectionId) {
$this->arResult["SECTION"] = $arSection;
$this->arResult["SECTION_ID"] = $arSection["ID"];
}
$this->arResult["LIST_SECTIONS"][$arSection["ID"]] = str_repeat(" . ", $arSection["DEPTH_LEVEL"]) . $arSection["NAME"];
}
$this->arResult["IS_SOCNET_GROUP_CLOSED"] = false;
if (intval($params["~SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule("socialnetwork")) {
$arSonetGroup = CSocNetGroup::GetByID(intval($params["~SOCNET_GROUP_ID"]));
if (is_array($arSonetGroup) && $arSonetGroup["CLOSED"] == "Y" && !CSocNetUser::IsCurrentUserModuleAdmin() && ($arSonetGroup["OWNER_ID"] != $GLOBALS["USER"]->GetID() || COption::GetOptionString("socialnetwork", "work_with_closed_groups", "N") != "Y")) {
$this->arResult["IS_SOCNET_GROUP_CLOSED"] = true;
}
}
return $params;
}
示例2: _FormatUser
function _FormatUser(&$arUser, $arPath)
{
global $USER, $CACHE_ABSENCE;
if ($arUser['PERSONAL_PHOTO']) {
$arImage = CIntranetUtils::InitImage($arUser['PERSONAL_PHOTO'], 30);
$arUser['PERSONAL_PHOTO'] = $arImage['IMG'];
}
if ($arPath['DETAIL_URL']) {
$arUser['DETAIL_URL'] = str_replace('#ID#', $arUser['ID'], $arPath['DETAIL_URL']);
}
$arUser["canViewProfile"] = CSocNetUserPerms::CanPerformOperation($USER->GetID(), $arUser['ID'], "viewprofile", CSocNetUser::IsCurrentUserModuleAdmin());
$arUser["canMessage"] = CSocNetUserPerms::CanPerformOperation($USER->GetID(), $arUser['ID'], "message", CSocNetUser::IsCurrentUserModuleAdmin());
if ($arPath['MESSAGES_CHAT_URL']) {
$arUser['MESSAGES_CHAT_URL'] = str_replace('#ID#', $arUser['ID'], $arPath['MESSAGES_CHAT_URL']);
}
$arUser['IS_ABSENT'] = CIntranetUtils::IsUserAbsent($arUser['ID']);
$arUser['IS_ONLINE'] = CSocNetUser::IsOnLine($arUser['ID']);
if ($arUser['IS_ABSENT']) {
$maxAbsence = 0;
foreach ($CACHE_ABSENCE[$arUser["ID"]] as $arAbsence) {
if (MakeTimeStamp($arAbsence["DATE_TO"]) > $maxAbsence) {
$arUser['ABSENT_TILL'] = $arAbsence["DATE_TO"];
}
}
}
$arFilter = array("TO_USER_ID" => $arUser['ID'], "MESSAGE_TYPE" => SONET_MESSAGE_PRIVATE, "FROM_USER_ID" => $USER->GetID());
$dbMessages = CSocNetMessages::GetList(array("DATE_CREATE" => "DESC"), $arFilter, false, array("nTopCount" => 1), array("ID", "DATE_CREATE"));
if ($arMessages = $dbMessages->GetNext()) {
$arUser['LAST_CHAT'] = $arMessages["DATE_CREATE"];
}
return true;
}
示例3: OnFillSocNetMenu
public static function OnFillSocNetMenu(&$arResult, $arParams = array())
{
global $USER;
$arResult["AllowSettings"]["group_lists"] = true;
$arResult["CanView"]["group_lists"] = (array_key_exists("ActiveFeatures", $arResult) ? array_key_exists("group_lists", $arResult["ActiveFeatures"]) : true) && CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), $arParams["ENTITY_TYPE"], $arParams["ENTITY_ID"], "group_lists", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["Title"]["group_lists"] = array_key_exists("ActiveFeatures", $arResult) && array_key_exists("group_lists", $arResult["ActiveFeatures"]) && strlen($arResult["ActiveFeatures"]["group_lists"]) > 0 ? $arResult["ActiveFeatures"]["group_lists"] : GetMessage("LISTS_SOCNET_TAB");
if (!array_key_exists("SEF_MODE", $arResult) || $arResult["SEF_MODE"] != "N") {
if (isset($arResult["Urls"])) {
$arResult["Urls"]["group_lists"] = $arResult["Urls"]["view"] . "lists/";
}
} else {
if (!array_key_exists("PAGE_VAR", $arResult)) {
$arResult["PAGE_VAR"] = "page";
}
if (!array_key_exists("GROUP_VAR", $arResult)) {
$arResult["GROUP_VAR"] = "group_id";
}
$arResult["Urls"]["group_lists"] = "?" . $arResult["PAGE_VAR"] . "=group_lists&" . $arResult["GROUP_VAR"] . "=" . $arResult["Group"]["ID"];
}
}
示例4: __GCEGetGroup
function __GCEGetGroup(&$group_id, &$arGroupProperties = array(), &$arGroupTmp = array(), $tab = false)
{
if (!CModule::IncludeModule("socialnetwork")) {
$group_id = 0;
return;
}
$arGroup = CSocNetGroup::GetByID($group_id);
if ($arGroup && ($tab == "edit" && ($arGroup["OWNER_ID"] == $GLOBALS["USER"]->GetID() || CSocNetUser::IsCurrentUserModuleAdmin()) || $tab == "invite" && (CSocNetUser::IsCurrentUserModuleAdmin() || CSocNetGroup::CanUserInitiate($GLOBALS["USER"]->GetID(), $group_id)))) {
$arGroupTmp["NAME"] = $arGroup["NAME"];
$arGroupTmp["DESCRIPTION"] = $arGroup["DESCRIPTION"];
$arGroupTmp["IMAGE_ID_DEL"] = "N";
$arGroupTmp["SUBJECT_ID"] = $arGroup["SUBJECT_ID"];
$arGroupTmp["VISIBLE"] = $arGroup["VISIBLE"];
$arGroupTmp["OPENED"] = $arGroup["OPENED"];
$arGroupTmp["CLOSED"] = $arGroup["CLOSED"];
$arGroupTmp["KEYWORDS"] = $arGroup["KEYWORDS"];
$arGroupTmp["OWNER_ID"] = $arGroup["OWNER_ID"];
$arGroupTmp["INITIATE_PERMS"] = $arGroup["INITIATE_PERMS"];
$arGroupTmp["SPAM_PERMS"] = $arGroup["SPAM_PERMS"];
$arGroupTmp["IMAGE_ID"] = $arGroup["IMAGE_ID"];
$arGroupTmp["IMAGE_ID_FILE"] = CFile::GetFileArray($arGroup["IMAGE_ID"]);
$arGroupTmp["IMAGE_ID_IMG"] = '<img src="' . ($arGroupTmp["IMAGE_ID_FILE"] != false ? $arGroupTmp["IMAGE_ID_FILE"]["SRC"] : "/bitrix/images/1.gif") . '" height="60" class="sonet-group-create-popup-image" id="sonet_group_create_popup_image" border="0">';
foreach ($arGroupProperties as $field => $arUserField) {
if (array_key_exists($field, $arGroup)) {
$arGroupProperties[$field]["VALUE"] = $arGroup["~" . $field];
$arGroupProperties[$field]["ENTITY_VALUE_ID"] = $arGroup["ID"];
}
}
$arGroupTmp["IS_EXTRANET_GROUP"] = "N";
if (CModule::IncludeModule("extranet") && CExtranet::IsExtranetSocNetGroup($group_id)) {
$arGroupTmp["IS_EXTRANET_GROUP"] = "Y";
}
} else {
$arGroupTmp["VISIBLE"] = "Y";
$arGroupTmp["IS_EXTRANET_GROUP"] = "N";
$group_id = 0;
}
}
示例5: inviteGroupUsers
public static function inviteGroupUsers($arFields)
{
global $USER;
$groupID = $arFields['GROUP_ID'];
$arUserID = $arFields['USER_ID'];
$message = $arFields['MESSAGE'];
if(intval($groupID) <= 0)
throw new Exception('Wrong group ID');
if (
(is_array($arUserID) && count($arUserID) <= 0)
|| (!is_array($arUserID) && intval($arUserID) <= 0)
)
throw new Exception('Wrong user IDs');
if (!is_array($arUserID))
$arUserID = array($arUserID);
$arSuccessID = array();
$dbRes = CSocNetGroup::GetList(array(), array(
"ID" => $groupID,
"CHECK_PERMISSIONS" => $USER->GetID(),
));
$arGroup = $dbRes->Fetch();
if(is_array($arGroup))
{
foreach($arUserID as $user_id)
{
$isCurrentUserTmp = ($USER->GetID() == $user_id);
$canInviteGroup = CSocNetUserPerms::CanPerformOperation($USER->GetID(), $user_id, "invitegroup", CSocNetUser::IsCurrentUserModuleAdmin(SITE_ID, false));
$user2groupRelation = CSocNetUserToGroup::GetUserRole($user_id, $arGroup["ID"]);
if (
!$isCurrentUserTmp && $canInviteGroup && !$user2groupRelation
&& CSocNetUserToGroup::SendRequestToJoinGroup($USER->GetID(), $user_id, $arGroup["ID"], $message, true)
)
$arSuccessID[] = $user_id;
}
}
else
throw new Exception('Socialnetwork group not found');
return $arSuccessID;
}
示例6: unset
unset($arFilter[">PERMS"]);
}
$arSelectedFields = array("ID", "BLOG_ID", "TITLE", "DATE_PUBLISH", "AUTHOR_ID", "DETAIL_TEXT", "BLOG_ACTIVE", "BLOG_URL", "BLOG_GROUP_ID", "BLOG_GROUP_SITE_ID", "AUTHOR_LOGIN", "AUTHOR_NAME", "AUTHOR_LAST_NAME", "AUTHOR_SECOND_NAME", "BLOG_USER_ALIAS", "BLOG_OWNER_ID", "VIEWS", "NUM_COMMENTS", "ATTACH_IMG", "BLOG_SOCNET_GROUP_ID", "CODE", "MICRO");
if (CModule::IncludeModule("socialnetwork") && $arParams["USE_SOCNET"] == "Y") {
unset($arFilter[">PERMS"]);
$arFilter["BLOG_USE_SOCNET"] = "Y";
if (IntVal($arParams["SOCNET_GROUP_ID"]) <= 0 && IntVal($arParams["USER_ID"]) <= 0) {
$arFilter["FOR_USER"] = $user_id;
} else {
if (IntVal($arParams["USER_ID"]) > 0) {
$arFilter["AUTHOR_ID"] = $arParams["USER_ID"];
$arFilter["FOR_USER"] = $user_id;
} elseif (IntVal($arParams["SOCNET_GROUP_ID"]) > 0) {
$arFilter["SOCNET_GROUP_ID"] = $arParams["SOCNET_GROUP_ID"];
$perms = BLOG_PERMS_DENY;
if (CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "blog", "full_post", CSocNetUser::IsCurrentUserModuleAdmin()) || $APPLICATION->GetGroupRight("blog") >= "W") {
$perms = BLOG_PERMS_FULL;
} elseif (CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "blog", "write_post")) {
$perms = BLOG_PERMS_WRITE;
} elseif (CSocNetFeaturesPerms::CanPerformOperation($user_id, SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "blog", "view_post")) {
$perms = BLOG_PERMS_READ;
}
}
}
}
if ($perms != BLOG_PERMS_DENY) {
$SORT = array($arParams["SORT_BY1"] => $arParams["SORT_ORDER1"], $arParams["SORT_BY2"] => $arParams["SORT_ORDER2"]);
if ($arParams["MESSAGE_COUNT"] > 0) {
$COUNT = array("nTopCount" => $arParams["MESSAGE_COUNT"]);
} else {
$COUNT = false;
示例7: foreach
if ($gadget["BLOG_ONLY"] == true && $gadget["SG_ONLY"] == true && intval($arParams["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule('socialnetwork') && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "blog")) {
continue;
}
if ($gadget["FORUM_ONLY"] == true && $gadget["SU_ONLY"] == true && intval($arParams["USER_ID"]) > 0 && CModule::IncludeModule('socialnetwork') && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_USER, $arParams["USER_ID"], "forum")) {
continue;
}
if ($gadget["FORUM_ONLY"] == true && $gadget["SG_ONLY"] == true && intval($arParams["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule('socialnetwork') && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "forum")) {
continue;
}
if ($gadget["SEARCH_ONLY"] == true && $gadget["SU_ONLY"] == true && intval($arParams["USER_ID"]) > 0 && CModule::IncludeModule('socialnetwork') && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_USER, $arParams["USER_ID"], "search")) {
continue;
}
if ($gadget["SEARCH_ONLY"] == true && $gadget["SG_ONLY"] == true && intval($arParams["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule('socialnetwork') && !CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "search")) {
continue;
}
if ($gadget["WIKI_ONLY"] == true && $gadget["SG_ONLY"] == true && intval($arParams["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule('socialnetwork') && (!CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "wiki") || !CSocNetFeaturesPerms::CanPerformOperation($USER->GetID(), SONET_ENTITY_GROUP, $arParams["SOCNET_GROUP_ID"], "wiki", "view", CSocNetUser::IsCurrentUserModuleAdmin()))) {
continue;
}
if ($gadget["GROUP"]["ID"] == "") {
$gadget["GROUP"]["ID"] = "other";
}
if (!isset($gadget["TOTALLY_FIXED"]) || !$gadget["TOTALLY_FIXED"]) {
if (!is_array($gadget["GROUP"]["ID"])) {
$arGroups[$gadget["GROUP"]["ID"]]["GADGETS"][] = $gadget["ID"];
} else {
foreach ($gadget["GROUP"]["ID"] as $group_id) {
if (in_array($arParams["MODE"], array("SU", "SG")) && $group_id != "sonet" || !in_array($arParams["MODE"], array("SU", "SG")) && $group_id == "sonet" || $arParams["MODE"] == "AI" && $group_id != "admin" || $arParams["MODE"] != "AI" && $group_id == "admin") {
continue;
}
$arGroups[$group_id]["GADGETS"][] = $gadget["ID"];
}
示例8: AddEventHandler
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
/**
* @var array $arParams
* @var array $arResult
* @var CMain $APPLICATION
* @var CUser $USER
*/
$rights = "N";
if (\CSocNetUser::IsCurrentUserModuleAdmin() || $APPLICATION->GetGroupRight("blog") >= "W") {
$rights = "ALL";
} else {
if (IsModuleInstalled("intranet") && $USER->IsAuthorized()) {
$rights = "OWN";
} else {
if (!IsModuleInstalled("intranet")) {
$rights = $arResult["Perm"] < BLOG_PERMS_FULL ? "OWNLAST" : "ALL";
}
}
}
$eventHandlerID = AddEventHandler('main', 'system.field.view.file', array('CBlogTools', 'blogUFfileShow'));
$arResult["OUTPUT_LIST"] = $APPLICATION->IncludeComponent("bitrix:main.post.list", "", array("TEMPLATE_ID" => 'BLOG_COMMENT_BG_', "RATING_TYPE_ID" => $arParams["SHOW_RATING"] == "Y" ? "BLOG_COMMENT" : "", "ENTITY_XML_ID" => $arParams["ENTITY_XML_ID"], "RECORDS" => $arResult["RECORDS"], "NAV_STRING" => $arResult["NAV_STRING"], "NAV_RESULT" => $arResult["NAV_RESULT"], "PREORDER" => "N", "RIGHTS" => array("MODERATE" => $arResult["Perm"] >= BLOG_PERMS_MODERATE ? "Y" : "N", "EDIT" => $rights, "DELETE" => $rights), "VISIBLE_RECORDS_COUNT" => $arResult["newCount"], "ERROR_MESSAGE" => $arResult["ERROR_MESSAGE"] ?: $arResult["COMMENT_ERROR"], "OK_MESSAGE" => $arResult["MESSAGE"], "RESULT" => $arResult["ajax_comment"] ?: $_GET["commentId"], "PUSH&PULL" => $arResult["PUSH&PULL"], "VIEW_URL" => str_replace("#comment_id#", "#ID#", $arResult["urlMobileToComment"]), "EDIT_URL" => str_replace("#comment_id#", "#ID#", $arResult["urlMobileToComment"]), "MODERATE_URL" => str_replace(array("hide_comment_id=", "#comment_id#"), array("#action#_comment_id=", "#ID#"), $arResult["urlMobileToHide"]), "DELETE_URL" => str_replace("#comment_id#", "#ID#", $arResult["urlMobileToDelete"]), "AUTHOR_URL" => "/mobile/users/?user_id=#user_id#", "AVATAR_SIZE" => $arParams["AVATAR_SIZE_COMMENT"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams['SHOW_LOGIN'], "DATE_TIME_FORMAT" => $arParams["DATE_TIME_FORMAT"], "LAZYLOAD" => $arParams["LAZYLOAD"], "NOTIFY_TAG" => $arParams["bFromList"] ? "BLOG|COMMENT" : "", "NOTIFY_TEXT" => $arParams["bFromList"] ? TruncateText(str_replace(array("\r\n", "\n"), " ", $arParams["POST_DATA"]["~TITLE"]), 100) : "", "SHOW_MINIMIZED" => "Y", "SHOW_POST_FORM" => $arResult["CanUserComment"] ? "Y" : "N", "IMAGE_SIZE" => $arParams["IMAGE_SIZE"], "mfi" => $arParams["mfi"], "FORM" => array("ID" => $this->__component->__name, "URL" => $APPLICATION->GetCurPageParam("", array("sessid", "comment_post_id", "act", "post", "comment", "decode", "ACTION", "ENTITY_TYPE_ID", "ENTITY_ID", "empty_get_form", "empty_get_comments")))), $this->__component);
if ($eventHandlerID > 0) {
RemoveEventHandler('main', 'system.field.view.file', $eventHandlerID);
}
if ($arResult["CanUserComment"] == "Y") {
ob_start();
include_once __DIR__ . "/script.php";
示例9: define
<?php
define("STOP_STATISTICS", true);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
require_once "functions.php";
CModule::IncludeModule('socialnetwork');
if (!$USER->IsAuthorized()) {
die;
}
$SITE_ID = isset($_GET["SITE_ID"]) ? $_GET["SITE_ID"] : SITE_ID;
if ($_REQUEST["mode"] == "search") {
CUtil::decodeURIComponent($_GET);
$APPLICATION->RestartBuffer();
CSocNetTools::InitGlobalExtranetArrays($SITE_ID);
$arFilter = array("SITE_ID" => $SITE_ID, "%NAME" => $_GET["query"]);
if (!CSocNetUser::IsCurrentUserModuleAdmin($SITE_ID)) {
$arFilter["CHECK_PERMISSIONS"] = $USER->GetID();
}
$rsGroups = CSocNetGroup::GetList(array("NAME" => "ASC"), $arFilter);
$arGroups = array();
while ($arGroup = $rsGroups->Fetch()) {
if (isset($GLOBALS["arExtranetGroupID"]) && is_array($GLOBALS["arExtranetGroupID"]) && in_array($arGroup["ID"], $GLOBALS["arExtranetGroupID"])) {
$arGroup["IS_EXTRANET"] = "Y";
}
$arGroups[] = group2JSItem($arGroup);
}
if (isset($_REQUEST["features_perms"]) && sizeof($_REQUEST["features_perms"]) == 2) {
filterByFeaturePerms($arGroups, $_REQUEST["features_perms"]);
}
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
echo CUtil::PhpToJsObject($arGroups);
示例10: array
$arResult["Urls"]["Microblog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_MICROBLOG"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Photo"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_PHOTO"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Forum"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_FORUM"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Calendar"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_CALENDAR"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Tasks"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_TASKS"], array("user_id" => $arResult["User"]["ID"]));
$arResult["Urls"]["Files"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_FILES"], array("user_id" => $arResult["User"]["ID"], "path" => ""));
$arResult["Urls"]["content_search"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_CONTENT_SEARCH"], array("user_id" => $arResult["User"]["ID"]));
$arResult["ActiveFeatures"] = CSocNetFeatures::GetActiveFeaturesNames(SONET_ENTITY_USER, $arResult["User"]["ID"]);
$arResult["CanView"]["files"] = array_key_exists("files", $arResult["ActiveFeatures"]) && (CSocNetUser::IsCurrentUserModuleAdmin() || CModule::IncludeModule('webdav') && CIBlockWebdavSocnet::CanAccessFiles($arParams["FILES_USER_IBLOCK_ID"], 'user', $arResult["User"]["ID"]));
$arResult["CanView"]["tasks"] = array_key_exists("tasks", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "tasks", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["calendar"] = array_key_exists("calendar", $arResult["ActiveFeatures"]);
$arResult["CanView"]["microblog"] = array_key_exists("microblog", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "blog", "view_post", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["blog"] = array_key_exists("blog", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "blog", "view_post", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["photo"] = array_key_exists("photo", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "photo", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["forum"] = array_key_exists("forum", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "forum", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["CanView"]["content_search"] = array_key_exists("search", $arResult["ActiveFeatures"]) && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $arResult["User"]["ID"], "search", "view", CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["Title"]["blog"] = array_key_exists("blog", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["blog"]) > 0 ? $arResult["ActiveFeatures"]["blog"] : GetMessage("SONET_UM_BLOG");
$arResult["Title"]["microblog"] = array_key_exists("microblog", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["microblog"]) > 0 ? $arResult["ActiveFeatures"]["microblog"] : GetMessage("SONET_UM_MICROBLOG");
$arResult["Title"]["photo"] = array_key_exists("photo", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["photo"]) > 0 ? $arResult["ActiveFeatures"]["photo"] : GetMessage("SONET_UM_PHOTO");
$arResult["Title"]["forum"] = array_key_exists("forum", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["forum"]) > 0 ? $arResult["ActiveFeatures"]["forum"] : GetMessage("SONET_UM_FORUM");
$arResult["Title"]["calendar"] = array_key_exists("calendar", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["calendar"]) > 0 ? $arResult["ActiveFeatures"]["calendar"] : GetMessage("SONET_UM_CALENDAR");
$arResult["Title"]["tasks"] = array_key_exists("tasks", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["tasks"]) > 0 ? $arResult["ActiveFeatures"]["tasks"] : GetMessage("SONET_UM_TASKS");
$arResult["Title"]["files"] = array_key_exists("files", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["files"]) > 0 ? $arResult["ActiveFeatures"]["files"] : GetMessage("SONET_UM_FILES");
$arResult["Title"]["content_search"] = array_key_exists("search", $arResult["ActiveFeatures"]) && StrLen($arResult["ActiveFeatures"]["search"]) > 0 ? $arResult["ActiveFeatures"]["search"] : GetMessage("SONET_UM_SEARCH");
$a = array_keys($arResult["Urls"]);
foreach ($a as $v) {
$arResult["Urls"][strtolower($v)] = $arResult["Urls"][$v];
}
$events = GetModuleEvents("socialnetwork", "OnFillSocNetMenu");
while ($arEvent = $events->Fetch()) {
ExecuteModuleEventEx($arEvent, array(&$arResult));
示例11: GetMessage
$arResult["NEED_AUTH"] = "Y";
} else {
$arGroup = CSocNetGroup::GetByID($arParams["GROUP_ID"]);
if (!$arGroup || !is_array($arGroup) || $arGroup["ACTIVE"] != "Y") {
$arResult["FatalError"] = GetMessage("SONET_P_USER_NO_GROUP") . ". ";
} else {
$arGroupSites = array();
$rsGroupSite = CSocNetGroup::GetSite($arGroup["ID"]);
while ($arGroupSite = $rsGroupSite->Fetch()) {
$arGroupSites[] = $arGroupSite["LID"];
}
if (!in_array(SITE_ID, $arGroupSites)) {
$arResult["FatalError"] = GetMessage("SONET_P_USER_NO_GROUP");
} else {
$arResult["Group"] = $arGroup;
$arResult["CurrentUserPerms"] = CSocNetUserToGroup::InitUserPerms($GLOBALS["USER"]->GetID(), $arResult["Group"], CSocNetUser::IsCurrentUserModuleAdmin());
$arResult["Urls"]["User"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $GLOBALS["USER"]->GetID()));
$arResult["Urls"]["Group"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP"], array("group_id" => $arResult["Group"]["ID"]));
if ($arParams["SET_TITLE"] == "Y") {
$APPLICATION->SetTitle(GetMessage("SONET_C37_PAGE_TITLE"));
}
if ($arParams["SET_NAV_CHAIN"] != "N") {
$APPLICATION->AddChainItem($arResult["Group"]["NAME"], $arResult["Urls"]["Group"]);
$APPLICATION->AddChainItem(GetMessage("SONET_C37_PAGE_TITLE"));
}
if ($arResult["CurrentUserPerms"]["UserIsOwner"]) {
$arResult["FatalError"] = GetMessage("SONET_C37_IS_OWNER") . ". ";
} elseif (!$arResult["CurrentUserPerms"]["UserIsMember"]) {
$arResult["FatalError"] = GetMessage("SONET_C37_NOT_MEMBER") . ". ";
} else {
if ($arParams["SET_TITLE"] == "Y") {
示例12: GetFormHtml
public function GetFormHtml($arParams = false)
{
global $USER;
if (is_array($arParams["socnetgroups"]) && $arParams["socnetgroups"]["disabled"] == "true") {
return false;
}
$currElements = '';
if (is_array($arParams[$this->id]) && ($group_id = intval($arParams[$this->id]["group_id"])) > 0) {
$arFinderParams = array("PROVIDER" => $this->id, "TYPE" => 4);
$arFilter = array("ID" => $group_id, "ACTIVE" => "Y");
if (!CSocNetUser::IsCurrentUserModuleAdmin($arParams["SITE_ID"])) {
$arFilter["CHECK_PERMISSIONS"] = $USER->GetID();
}
$rsGroups = CSocNetGroup::GetList(array(), $arFilter);
if ($arGroup = $rsGroups->Fetch()) {
$arItem = array("ID" => "SG" . $arGroup['ID'], "AVATAR" => '/bitrix/js/main/core/images/access/avatar-user-everyone.png', "NAME" => $arGroup['NAME'], "DESC" => $arGroup['DESCRIPTION'], "OPEN" => "Y", "CHECKBOX" => array("#ID#_A" => GetMessage("authprov_sg_a"), "#ID#_E" => GetMessage("authprov_sg_e"), "#ID#_K" => GetMessage("authprov_sg_k")));
if ($arGroup["IMAGE_ID"]) {
$imageFile = CFile::GetFileArray($arGroup["IMAGE_ID"]);
if ($imageFile !== false) {
$arFileTmp = CFile::ResizeImageGet($imageFile, array("width" => 30, "height" => 30), BX_RESIZE_IMAGE_PROPORTIONAL, false);
$arItem["AVATAR"] = $arFileTmp["src"];
}
}
$currElements .= CFinder::GetFinderItem($arFinderParams, $arItem);
}
}
$elements = "";
$arFinderParams = array("PROVIDER" => $this->id, "TYPE" => 3);
$arLRU = CAccess::GetLastRecentlyUsed($this->id);
if (!empty($arLRU)) {
$arLast = array();
$arLastID = array();
$arElements = array();
foreach ($arLRU as $val) {
if (preg_match('/^SG([0-9]+)_([A-Z])/', $val, $match)) {
$arLast[$match[2]][$match[1]] = $match[1];
$arLastID[$match[1]] = $match[1];
}
}
if (!empty($arLastID)) {
$arFilter = array("ID" => $arLastID, "ACTIVE" => "Y");
if ($arParams["SITE_ID"] != '') {
$arFilter["SITE_ID"] = $arParams["SITE_ID"];
}
if (!CSocNetUser::IsCurrentUserModuleAdmin($arParams["SITE_ID"])) {
$arFilter["CHECK_PERMISSIONS"] = $USER->GetID();
}
$rsGroups = CSocNetGroup::GetList(array("NAME" => "ASC"), $arFilter);
while ($arGroup = $rsGroups->Fetch()) {
$arItem = array("ID" => $arGroup['ID'], "AVATAR" => '/bitrix/js/main/core/images/access/avatar-user-everyone.png', "NAME" => $arGroup['NAME'], "DESC" => $arGroup['DESCRIPTION']);
if ($arGroup["IMAGE_ID"]) {
$imageFile = CFile::GetFileArray($arGroup["IMAGE_ID"]);
if ($imageFile !== false) {
$arFileTmp = CFile::ResizeImageGet($imageFile, array("width" => 30, "height" => 30), BX_RESIZE_IMAGE_PROPORTIONAL, false);
$arItem["AVATAR"] = $arFileTmp["src"];
}
}
$arElements[$arItem['ID']] = $arItem;
}
foreach ($arLRU as $val) {
if (preg_match('/^SG([0-9]+)_([A-Z])/', $val, $match)) {
$arItem = $arElements[$match[1]];
if ($match[2] == 'K') {
$arItem['ID'] = 'SG' . $arElements[$match[1]]['ID'] . '_K';
$arItem['NAME'] = $arElements[$match[1]]['NAME'] . ': ' . GetMessage("authprov_sg_k");
} else {
if ($match[2] == 'E') {
$arItem['ID'] = 'SG' . $arElements[$match[1]]['ID'] . '_E';
$arItem['NAME'] = $arElements[$match[1]]['NAME'] . ': ' . GetMessage("authprov_sg_e");
} else {
if ($match[2] == 'A') {
$arItem['ID'] = 'SG' . $arElements[$match[1]]['ID'] . '_A';
$arItem['NAME'] = $arElements[$match[1]]['NAME'] . ': ' . GetMessage("authprov_sg_a");
}
}
}
$elements .= CFinder::GetFinderItem($arFinderParams, $arItem);
}
}
}
}
$arFinderParams = array("PROVIDER" => $this->id, "TYPE" => 4);
$arFilter = array("USER_ID" => $USER->GetID(), "<=ROLE" => SONET_ROLES_USER, "GROUP_ACTIVE" => "Y");
if ($arParams["SITE_ID"] != '') {
$arFilter["GROUP_SITE_ID"] = $arParams["SITE_ID"];
}
$rsGroups = CSocNetUserToGroup::GetList(array("GROUP_NAME" => "ASC"), $arFilter, false, array(), array("ID", "GROUP_ID", "GROUP_NAME", "GROUP_DESCRIPTION", "GROUP_IMAGE_ID"));
$myElements = '';
while ($arGroup = $rsGroups->Fetch()) {
$arItem = array("ID" => "SG" . $arGroup['GROUP_ID'], "AVATAR" => $arGroup['GROUP_IMAGE_ID'], "NAME" => $arGroup['GROUP_NAME'], "DESC" => $arGroup['GROUP_DESCRIPTION'], "CHECKBOX" => array("#ID#_A" => GetMessage("authprov_sg_a"), "#ID#_E" => GetMessage("authprov_sg_e"), "#ID#_K" => GetMessage("authprov_sg_k")));
if ($arGroup["GROUP_IMAGE_ID"]) {
$imageFile = CFile::GetFileArray($arGroup["GROUP_IMAGE_ID"]);
if ($imageFile !== false) {
$arFileTmp = CFile::ResizeImageGet($imageFile, array("width" => 30, "height" => 30), BX_RESIZE_IMAGE_PROPORTIONAL, false);
$arItem["AVATAR"] = $arFileTmp["src"];
}
}
$myElements .= CFinder::GetFinderItem($arFinderParams, $arItem);
}
$arPanels = array();
//.........这里部分代码省略.........
示例13: elseif
$APPLICATION->AddChainItem(GetMessage("SONET_C36_PAGE_TITLE"));
} elseif ($arParams["PAGE"] == "user_groups") {
$APPLICATION->AddChainItem($strTitleFormatted, CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arResult["User"]["ID"])));
$APPLICATION->AddChainItem(GetMessage("SONET_C36_PAGE_TITLE1"));
} else {
if ($arResult["filter_my"] == "Y") {
$APPLICATION->AddChainItem(GetMessage("SONET_C36_PAGE_TITLE2_1"));
} elseif ($arResult["filter_archive"] == "Y") {
$APPLICATION->AddChainItem(GetMessage("SONET_C36_PAGE_TITLE2_2"));
} elseif ($arResult["filter_extranet"] == "Y") {
$APPLICATION->AddChainItem(GetMessage("SONET_C36_PAGE_TITLE2_3"));
} else {
$APPLICATION->AddChainItem(GetMessage("SONET_C36_PAGE_TITLE2"));
}
}
}
}
if (CSocNetUser::IsCurrentUserModuleAdmin() && CModule::IncludeModule('intranet')) {
global $INTRANET_TOOLBAR;
$INTRANET_TOOLBAR->AddButton(array('HREF' => "/bitrix/admin/socnet_subject.php?lang=" . LANGUAGE_ID, "TEXT" => GetMessage('SONET_C36_EDIT_ENTRIES'), 'ICON' => 'settings', "SORT" => 1000));
}
}
$this->IncludeComponentTemplate();
?>
示例14: GetUserMaxPermission
public function GetUserMaxPermission($ownerType, $ownerId, $userId, $iblockId)
{
$arParameters = array("PERMISSION" => "D", "CHECK_CREATOR" => "N");
$ownerId = intVal($ownerId);
$userId = intVal($userId);
$iblockId = intval($iblockId);
if (!in_array($ownerType, array("user", "group")) || $ownerId <= 0 || $iblockId <= 0) {
return $arParameters;
} elseif ($GLOBALS["USER"]->IsAuthorized() && $GLOBALS["USER"]->GetID() == $userId && CSocNetUser::IsCurrentUserModuleAdmin()) {
$arParameters["PERMISSION"] = "X";
return $arParameters;
}
$bBizproc = false;
if (CModule::IncludeModule("bizproc") && CIBlock::GetArrayByID($iblockId, "BIZPROC") != "N") {
$bBizproc = true;
}
$arParameters["PERMISSION"] = "X";
/*
if ($ownerType == "user"):
if ($userId == $ownerId):
$arParameters["PERMISSION"] = "X";
elseif (CSocNetFeaturesPerms::CanPerformOperation(
$userId,
SONET_ENTITY_USER,
$ownerId,
"files",
"write",
CSocNetUser::IsCurrentUserModuleAdmin())):
$arParameters["PERMISSION"] = "W";
elseif ($bBizproc && CSocNetFeaturesPerms::CanPerformOperation(
$userId,
SONET_ENTITY_USER,
$ownerId,
"files",
"bizproc",
CSocNetUser::IsCurrentUserModuleAdmin())):
$arParameters["PERMISSION"] = "U";
elseif (CSocNetFeaturesPerms::CanPerformOperation(
$userId,
SONET_ENTITY_USER,
$ownerId,
"files",
"write_limited",
CSocNetUser::IsCurrentUserModuleAdmin())):
$arParameters["PERMISSION"] = "W";
$arParameters["CHECK_CREATOR"] = "Y";
elseif (CSocNetFeaturesPerms::CanPerformOperation(
$userId,
SONET_ENTITY_USER,
$ownerId,
"files",
"view",
CSocNetUser::IsCurrentUserModuleAdmin())):
$arParameters["PERMISSION"] = "R";
endif;
elseif ($ownerType == "group"):
if (CSocNetUserToGroup::GetUserRole($userId, $ownerId) == SONET_ROLES_OWNER):
$arParameters["PERMISSION"] = "X";
elseif (CSocNetFeaturesPerms::CanPerformOperation(
$userId,
SONET_ENTITY_GROUP,
$ownerId,
"files",
"write",
CSocNetUser::IsCurrentUserModuleAdmin())):
$arParameters["PERMISSION"] = "W";
elseif ($bBizproc && CSocNetFeaturesPerms::CanPerformOperation(
$userId,
SONET_ENTITY_GROUP,
$ownerId,
"files",
"bizproc",
CSocNetUser::IsCurrentUserModuleAdmin())):
$arParameters["PERMISSION"] = "U";
elseif (CSocNetFeaturesPerms::CanPerformOperation(
$userId,
SONET_ENTITY_GROUP,
$ownerId,
"files",
"write_limited",
CSocNetUser::IsCurrentUserModuleAdmin())):
$arParameters["PERMISSION"] = "W";
$arParameters["CHECK_CREATOR"] = "Y";
elseif (CSocNetFeaturesPerms::CanPerformOperation(
$userId,
SONET_ENTITY_GROUP,
$ownerId,
"files",
"view",
CSocNetUser::IsCurrentUserModuleAdmin())):
$arParameters["PERMISSION"] = "R";
endif;
endif;
*/
return $arParameters;
}
示例15: GetMessage
if (strlen($arParams["NAME_TEMPLATE"]) <= 0) {
$arParams["NAME_TEMPLATE"] = CSite::GetNameFormat();
}
$bUseLogin = $arParams['SHOW_LOGIN'] != "N" ? true : false;
if (!CSocNetUser::IsFriendsAllowed()) {
$arResult["FatalError"] = GetMessage("SONET_C35_NO_FR_FUNC") . ". ";
} else {
if (!$GLOBALS["USER"]->IsAuthorized()) {
$arResult["NEED_AUTH"] = "Y";
} else {
$dbUser = CUser::GetByID($arParams["ID"]);
$arResult["User"] = $dbUser->GetNext();
if (!is_array($arResult["User"])) {
$arResult["FatalError"] = GetMessage("SONET_P_USER_NO_USER") . ". ";
} else {
$arResult["CurrentUserPerms"] = CSocNetUserPerms::InitUserPerms($GLOBALS["USER"]->GetID(), $arResult["User"]["ID"], CSocNetUser::IsCurrentUserModuleAdmin());
if (!$arResult["CurrentUserPerms"]["IsCurrentUser"]) {
$arResult["CurrentUserRelation"] = CSocNetUserRelations::GetRelation($GLOBALS["USER"]->GetID(), $arResult["User"]["ID"]);
}
$arResult["Urls"]["User"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arResult["User"]["ID"]));
$arResult["User"]["NAME_FORMATTED"] = CUser::FormatName($arParams['NAME_TEMPLATE'], $arResult["User"], $bUseLogin);
if ($arParams["SET_TITLE"] == "Y" || $arParams["SET_NAV_CHAIN"] != "N") {
$arParams["TITLE_NAME_TEMPLATE"] = str_replace(array("#NOBR#", "#/NOBR#"), array("", ""), $arParams["NAME_TEMPLATE"]);
$strTitleFormatted = CUser::FormatName($arParams['TITLE_NAME_TEMPLATE'], $arResult["User"], $bUseLogin);
}
if ($arParams["SET_TITLE"] == "Y") {
$APPLICATION->SetTitle($strTitleFormatted . ": " . GetMessage("SONET_C35_PAGE_TITLE"));
}
if ($arParams["SET_NAV_CHAIN"] != "N") {
$APPLICATION->AddChainItem($strTitleFormatted, $arResult["Urls"]["User"]);
$APPLICATION->AddChainItem(GetMessage("SONET_C35_PAGE_TITLE"));