当前位置: 首页>>代码示例>>PHP>>正文


PHP CExtranet::GetMyGroupsUsersSimple方法代码示例

本文整理汇总了PHP中CExtranet::GetMyGroupsUsersSimple方法的典型用法代码示例。如果您正苦于以下问题:PHP CExtranet::GetMyGroupsUsersSimple方法的具体用法?PHP CExtranet::GetMyGroupsUsersSimple怎么用?PHP CExtranet::GetMyGroupsUsersSimple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CExtranet的用法示例。


在下文中一共展示了CExtranet::GetMyGroupsUsersSimple方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 $arResult["CanComment"] = $GLOBALS["USER"]->IsAuthorized();
 $arResult["dest_users"] = array();
 foreach ($arResult["Post"]["SPERM"] as $key => $value) {
     foreach ($value as $kk => $vv) {
         $arResult["PostSrc"]["SPERM"][$key][] = $kk;
         if ($key == "U") {
             $arResult["dest_users"][] = $kk;
         }
     }
 }
 $arResult["PostSrc"]["HAVE_ALL_IN_ADR"] = $arResult["Post"]["HAVE_ALL_IN_ADR"];
 if ($arParams["CHECK_PERMISSIONS_DEST"] == "N" && !CSocNetUser::IsCurrentUserModuleAdmin() && is_object($GLOBALS["USER"])) {
     $arResult["Post"]["SPERM_HIDDEN"] = 0;
     $arGroupID = CSocNetLogTools::GetAvailableGroups($arResult["bExtranetUser"] ? "Y" : "N", $arResult["bExtranetSite"] ? "Y" : "N");
     if (!$arResult["bExtranetUser"] && CModule::IncludeModule("extranet")) {
         $arAvailableExtranetUserID = CExtranet::GetMyGroupsUsersSimple(CExtranet::GetExtranetSiteID());
     }
     foreach ($arResult["Post"]["SPERM"] as $group_code => $arBlogSPerm) {
         foreach ($arBlogSPerm as $entity_id => $arBlogSPermDesc) {
             if ($group_code == "SG" && !in_array($entity_id, $arGroupID) || $group_code == "DR" && $arResult["bExtranetUser"] || $group_code == "U" && isset($arUserIdVisible) && is_array($arUserIdVisible) && !in_array($entity_id, $arUserIdVisible) || $group_code == "U" && isset($arBlogSPermDesc["IS_EXTRANET"]) && $arBlogSPermDesc["IS_EXTRANET"] == "Y" && isset($arAvailableExtranetUserID) && is_array($arAvailableExtranetUserID) && !in_array($entity_id, $arAvailableExtranetUserID)) {
                 unset($arResult["Post"]["SPERM"][$group_code][$entity_id]);
                 $arResult["Post"]["SPERM_HIDDEN"]++;
                 $arResult["PostSrc"]["SPERM_HIDDEN"][] = $group_code . $entity_id;
             }
         }
     }
 }
 $arResult["PostSrc"]["SPERM_NAME"] = $arResult["Post"]["SPERM"];
 if ($arResult["PostPerm"] > BLOG_PERMS_MODERATE || $arResult["PostPerm"] >= BLOG_PERMS_WRITE && $arPost["AUTHOR_ID"] == $arResult["USER_ID"]) {
     $arResult["urlToEdit"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST_EDIT"], array("post_id" => $arPost["ID"], "user_id" => $arPost["AUTHOR_ID"]));
     if (in_array($arParams["TYPE"], array("DRAFT", "MODERATION"))) {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例2: __SLEGetLogRecord

 function __SLEGetLogRecord($logID, $arParams, $arCurrentUserSubscribe, $current_page_date)
 {
     static $isExtranetInstalled, $isExtranetSite, $isExtranetUser, $arUserIdVisible, $arAvailableExtranetUserID, $isExtranetAdmin, $bCurrentUserIsAdmin, $arSocNetFeaturesSettings;
     if (!$isExtranetInstalled) {
         $isExtranetInstalled = CModule::IncludeModule("extranet") ? "Y" : "N";
         $isExtranetSite = $isExtranetInstalled == "Y" && CExtranet::IsExtranetSite() ? "Y" : "N";
         $isExtranetUser = $isExtranetInstalled == "Y" && !CExtranet::IsIntranetUser() ? "Y" : "N";
         $isExtranetAdmin = $isExtranetInstalled == "Y" && CExtranet::IsExtranetAdmin() ? "Y" : "N";
         $bCurrentUserIsAdmin = CSocNetUser::IsCurrentUserModuleAdmin();
         $arSocNetFeaturesSettings = CSocNetAllowed::GetAllowedFeatures();
         if ($isExtranetUser == "Y") {
             $arUserIdVisible = CExtranet::GetMyGroupsUsersSimple(SITE_ID);
         } elseif ($isExtranetInstalled == "Y" && $isExtranetUser != "Y") {
             if ($isExtranetAdmin == "Y" && $bCurrentUserIsAdmin) {
                 $arAvailableExtranetUserID = CExtranet::GetMyGroupsUsers(SITE_ID);
             } else {
                 $arAvailableExtranetUserID = CExtranet::GetMyGroupsUsersSimple(CExtranet::GetExtranetSiteID());
             }
         }
     }
     $cache_time = 31536000;
     $arEvent = array();
     $cache = new CPHPCache();
     $arCacheID = array();
     $arKeys = array("AVATAR_SIZE", "DESTINATION_LIMIT", "CHECK_PERMISSIONS_DEST", "NAME_TEMPLATE", "NAME_TEMPLATE_WO_NOBR", "SHOW_LOGIN", "DATE_TIME_FORMAT", "PATH_TO_USER", "PATH_TO_GROUP", "PATH_TO_CONPANY_DEPARTMENT");
     foreach ($arKeys as $param_key) {
         if (array_key_exists($param_key, $arParams)) {
             $arCacheID[$param_key] = $arParams[$param_key];
         } else {
             $arCacheID[$param_key] = false;
         }
     }
     $cache_id = "log_post_" . $logID . "_" . md5(serialize($arCacheID)) . "_" . SITE_TEMPLATE_ID . "_" . SITE_ID . "_" . LANGUAGE_ID . "_" . FORMAT_DATETIME . "_" . CTimeZone::GetOffset();
     $cache_path = "/sonet/log/" . intval(intval($logID) / 1000) . "/" . $logID . "/entry/";
     if (is_object($cache) && $cache->InitCache($cache_time, $cache_id, $cache_path)) {
         $arCacheVars = $cache->GetVars();
         $arEvent["FIELDS_FORMATTED"] = $arCacheVars["FIELDS_FORMATTED"];
         if (array_key_exists("CACHED_CSS_PATH", $arEvent["FIELDS_FORMATTED"])) {
             if (!is_array($arEvent["FIELDS_FORMATTED"]["CACHED_CSS_PATH"]) && strlen($arEvent["FIELDS_FORMATTED"]["CACHED_CSS_PATH"]) > 0) {
                 $GLOBALS['APPLICATION']->SetAdditionalCSS($arEvent["FIELDS_FORMATTED"]["CACHED_CSS_PATH"]);
             } elseif (is_array($arEvent["FIELDS_FORMATTED"]["CACHED_CSS_PATH"])) {
                 foreach ($arEvent["FIELDS_FORMATTED"]["CACHED_CSS_PATH"] as $css_path) {
                     $GLOBALS['APPLICATION']->SetAdditionalCSS($css_path);
                 }
             }
         }
         if (array_key_exists("CACHED_JS_PATH", $arEvent["FIELDS_FORMATTED"])) {
             if (!is_array($arEvent["FIELDS_FORMATTED"]["CACHED_JS_PATH"]) && $arEvent["FIELDS_FORMATTED"]["CACHED_JS_PATH"] !== '') {
                 $GLOBALS['APPLICATION']->AddHeadScript($arEvent["FIELDS_FORMATTED"]["CACHED_JS_PATH"]);
             } elseif (is_array($arEvent["FIELDS_FORMATTED"]["CACHED_JS_PATH"])) {
                 foreach ($arEvent["FIELDS_FORMATTED"]["CACHED_JS_PATH"] as $js_path) {
                     $GLOBALS['APPLICATION']->AddHeadScript($js_path);
                 }
             }
         }
     } else {
         if (is_object($cache)) {
             $cache->StartDataCache($cache_time, $cache_id, $cache_path);
         }
         $arFilter = array("ID" => $logID);
         $arListParams = array("CHECK_RIGHTS" => "N", "USE_FOLLOW" => "N", "USE_SUBSCRIBE" => "N");
         $arSelect = array("ID", "TMP_ID", "ENTITY_TYPE", "ENTITY_ID", "USER_ID", "EVENT_ID", "LOG_DATE", "LOG_UPDATE", "TITLE_TEMPLATE", "TITLE", "MESSAGE", "TEXT_MESSAGE", "URL", "MODULE_ID", "CALLBACK_FUNC", "EXTERNAL_ID", "SITE_ID", "PARAMS", "COMMENTS_COUNT", "ENABLE_COMMENTS", "SOURCE_ID", "GROUP_NAME", "GROUP_OWNER_ID", "GROUP_INITIATE_PERMS", "GROUP_VISIBLE", "GROUP_OPENED", "GROUP_IMAGE_ID", "USER_NAME", "USER_LAST_NAME", "USER_SECOND_NAME", "USER_LOGIN", "USER_PERSONAL_PHOTO", "USER_PERSONAL_GENDER", "CREATED_BY_NAME", "CREATED_BY_LAST_NAME", "CREATED_BY_SECOND_NAME", "CREATED_BY_LOGIN", "CREATED_BY_PERSONAL_PHOTO", "CREATED_BY_PERSONAL_GENDER", "RATING_TYPE_ID", "RATING_ENTITY_ID", "SOURCE_TYPE");
         $dbEvent = CSocNetLog::GetList(array(), $arFilter, false, false, $arSelect, $arListParams);
         if ($arEvent = $dbEvent->GetNext()) {
             if (defined("BX_COMP_MANAGED_CACHE")) {
                 $GLOBALS["CACHE_MANAGER"]->StartTagCache($cache_path);
                 $GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_NAME_" . intval($arEvent["USER_ID"]));
                 $GLOBALS["CACHE_MANAGER"]->RegisterTag("SONET_LOG_" . intval($arEvent["ID"]));
                 if ($arEvent["ENTITY_TYPE"] == SONET_ENTITY_GROUP) {
                     $GLOBALS["CACHE_MANAGER"]->RegisterTag("sonet_group_" . $arEvent["ENTITY_ID"]);
                 }
             }
             $arEvent["EVENT_ID_FULLSET"] = CSocNetLogTools::FindFullSetEventIDByEventID($arEvent["EVENT_ID"]);
             if ($arEvent["ENTITY_TYPE"] == SONET_ENTITY_GROUP) {
                 static $arSiteWorkgroupsPage;
                 if (!$arSiteWorkgroupsPage && (IsModuleInstalled("extranet") || is_set($arEvent["URL"]) && strpos($arEvent["URL"], "#GROUPS_PATH#") !== false)) {
                     $rsSite = CSite::GetList($by = "sort", $order = "desc", array("ACTIVE" => "Y"));
                     while ($arSite = $rsSite->Fetch()) {
                         $arSiteWorkgroupsPage[$arSite["ID"]] = COption::GetOptionString("socialnetwork", "workgroups_page", $arSite["DIR"] . "workgroups/", $arSite["ID"]);
                     }
                 }
                 if (is_set($arEvent["URL"]) && isset($arSiteWorkgroupsPage[SITE_ID])) {
                     $arEvent["URL"] = str_replace("#GROUPS_PATH#", $arSiteWorkgroupsPage[SITE_ID], $arEvent["URL"]);
                 }
             }
             $arEventTmp = CSocNetLogTools::FindLogEventByID($arEvent["EVENT_ID"]);
             if ($arEventTmp && isset($arEventTmp["CLASS_FORMAT"]) && isset($arEventTmp["METHOD_FORMAT"])) {
                 $arEvent["UF"] = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("SONET_LOG", $arEvent["ID"], LANGUAGE_ID);
                 $arEvent["FIELDS_FORMATTED"] = call_user_func(array($arEventTmp["CLASS_FORMAT"], $arEventTmp["METHOD_FORMAT"]), $arEvent, $arParams);
                 if (is_array($arEvent["FIELDS_FORMATTED"])) {
                     if (isset($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && isset($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"])) {
                         if (in_array($arEvent["EVENT_ID"], array('calendar'))) {
                             $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsback($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"]);
                         } else {
                             $arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"] = CSocNetTextParser::closetags(htmlspecialcharsback($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"]));
                         }
                     }
                     if (isset($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && is_array($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"])) {
                         $arFields2Cache = array("URL", "STYLE", "DESTINATION", "DESTINATION_MORE", "TITLE_24", "TITLE_24_2", "TITLE_24_2_STYLE", "IS_IMPORTANT", "MESSAGE", "FOOTER_MESSAGE", "MESSAGE_TITLE_24", "DATETIME_FORMATTED", "LOG_DATE_FORMAT", "MENU", "COMMENT_URL");
                         foreach ($arEvent["FIELDS_FORMATTED"]["EVENT_FORMATTED"] as $field => $value) {
//.........这里部分代码省略.........
开发者ID:webgksupport,项目名称:alpina,代码行数:101,代码来源:include.php

示例3: SearchUsers

    public static function SearchUsers($search, $nameTemplate = "", $bSelf = true, $bEmployeesOnly = false, $bExtranetOnly = false, $departmentId = false)
    {
        CUtil::JSPostUnescape();
        $arUsers = array();
        $search = trim($search);
        if (strlen($search) <= 0 || !GetFilterQuery("TEST", $search)) {
            return $arUsers;
        }
        $bIntranetEnable = IsModuleInstalled('intranet');
        $bExtranetEnable = CModule::IncludeModule('extranet');
        $bBitrix24Enable = IsModuleInstalled('bitrix24');
        $bExtranetUser = $bExtranetEnable && !CExtranet::IsIntranetUser();
        $current_user_id = intval($GLOBALS["USER"]->GetID());
        if ($bExtranetEnable) {
            CSocNetTools::InitGlobalExtranetArrays();
        }
        $arSearchValue = preg_split('/\\s+/', trim(ToUpper($search)));
        array_walk($arSearchValue, array('CSocNetLogDestination', '__percent_walk'));
        $arFilter = array(array('LOGIC' => 'OR', 'NAME' => $arSearchValue, 'LAST_NAME' => $arSearchValue, '%=EMAIL' => $search, '%=LOGIN' => $search), 'ACTIVE' => 'Y');
        if ($bIntranetEnable || COption::GetOptionString("main", "new_user_registration_email_confirmation", "N") == "Y") {
            $arFilter["CONFIRM_CODE"] = false;
        }
        if ($bEmployeesOnly || $bBitrix24Enable && !$bExtranetEnable) {
            $arFilter["!UF_DEPARTMENT"] = false;
        } elseif ($bExtranetOnly) {
            $arFilter["UF_DEPARTMENT"] = false;
        }
        if ($bIntranetEnable && $bExtranetEnable && ($bExtranetUser || !$bEmployeesOnly)) {
            $arFilteredUserIDs = CExtranet::GetMyGroupsUsersSimple(CExtranet::GetExtranetSiteID());
            if ($bExtranetUser) {
                $arFilter["ID"] = array_merge(array($current_user_id), $arFilteredUserIDs);
            } else {
                $arFilter[] = array('LOGIC' => 'OR', '!UF_DEPARTMENT' => false, 'ID' => array_merge(array($current_user_id), $arFilteredUserIDs));
            }
        }
        $arSelect = array("ID", "NAME", "LAST_NAME", "SECOND_NAME", "EMAIL", "LOGIN", "WORK_POSITION", "PERSONAL_PROFESSION", "PERSONAL_PHOTO", "PERSONAL_GENDER", new \Bitrix\Main\Entity\ExpressionField('MAX_LAST_USE_DATE', 'MAX(%s)', array('\\Bitrix\\Main\\FinderDest:CODE_USER_CURRENT.LAST_USE_DATE')));
        //		$arFilter["\Bitrix\Main\FinderDest:CODE_USER_CURRENT.USER_ID"] = array(false, intval($GLOBALS["USER"]->GetID()));
        $helper = \Bitrix\Main\Application::getConnection()->getSqlHelper();
        $connection = \Bitrix\Main\Application::getConnection();
        $castType = $connection instanceof \Bitrix\Main\DB\MysqlCommonConnection ? 'UNSIGNED' : 'INT';
        $arFilter["@ID"] = new \Bitrix\Main\DB\SqlExpression('
(SELECT
    CAST(' . $helper->quote("MAIN_USER_TMP20258") . '.' . $helper->quote("ID") . ' AS ' . $castType . ') AS ' . $helper->quote("ID") . '
    FROM b_user ' . $helper->quote("MAIN_USER_TMP20258") . '
    LEFT JOIN
    	b_finder_dest ' . $helper->quote("TALIAS_1_TMP20258") . '
    	ON
    		' . $helper->quote("TALIAS_1_TMP20258") . '.' . $helper->quote("CODE_USER_ID") . ' = ' . $helper->quote("MAIN_USER_TMP20258") . '.' . $helper->quote("ID") . '
    		AND ' . $helper->quote("TALIAS_1_TMP20258") . '.' . $helper->quote("USER_ID") . ' = ' . intval($GLOBALS["USER"]->GetID()) . '
    WHERE (
        ' . $helper->quote("TALIAS_1_TMP20258") . '.' . $helper->quote("USER_ID") . ' IS NULL
        or ' . $helper->quote("TALIAS_1_TMP20258") . '.' . $helper->quote("USER_ID") . ' in (0, ' . intval($GLOBALS["USER"]->GetID()) . ')
	)
)');
        $rsUser = \Bitrix\Main\UserTable::getList(array('order' => array("\\Bitrix\\Main\\FinderDest:CODE_USER_CURRENT.LAST_USE_DATE" => 'DESC', 'LAST_NAME' => 'ASC'), 'filter' => $arFilter, 'select' => $arSelect, 'limit' => 50, 'data_doubling' => false));
        while ($arUser = $rsUser->fetch()) {
            if (!$bSelf && $current_user_id == $arUser['ID']) {
                continue;
            }
            if (intval($departmentId) > 0) {
                $arUserGroupCode = CAccess::GetUserCodesArray($arUser["ID"]);
                if (!in_array("DR" . intval($departmentId), $arUserGroupCode)) {
                    continue;
                }
            }
            $sName = CUser::FormatName(empty($nameTemplate) ? CSite::GetNameFormat(false) : $nameTemplate, $arUser, true, true);
            $arFileTmp = CFile::ResizeImageGet($arUser["PERSONAL_PHOTO"], array('width' => 32, 'height' => 32), BX_RESIZE_IMAGE_EXACT, false);
            $arUsers['U' . $arUser["ID"]] = array('id' => 'U' . $arUser["ID"], 'entityId' => $arUser["ID"], 'name' => $sName, 'avatar' => empty($arFileTmp['src']) ? '' : $arFileTmp['src'], 'desc' => $arUser['WORK_POSITION'] ? $arUser['WORK_POSITION'] : ($arUser['PERSONAL_PROFESSION'] ? $arUser['PERSONAL_PROFESSION'] : '&nbsp;'), 'isExtranet' => isset($GLOBALS["arExtranetUserID"]) && is_array($GLOBALS["arExtranetUserID"]) && in_array($arUser["ID"], $GLOBALS["arExtranetUserID"]) ? "Y" : "N");
            $checksum = md5(serialize($arUsers['U' . $arUser["ID"]]));
            $arUsers['U' . $arUser["ID"]]['checksum'] = $checksum;
        }
        return $arUsers;
    }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:73,代码来源:log_destination.php

示例4: SearchUsers

 public static function SearchUsers($search, $nameTemplate = "", $bSelf = true, $bEmployeesOnly = false, $bExtranetOnly = false, $departmentId = false)
 {
     CUtil::JSPostUnescape();
     $arUsers = array();
     $search = trim($search);
     if (strlen($search) <= 0 || !GetFilterQuery("TEST", $search)) {
         return $arUsers;
     }
     $bIntranetEnable = IsModuleInstalled('intranet');
     $bExtranetEnable = CModule::IncludeModule('extranet');
     $bBitrix24Enable = IsModuleInstalled('bitrix24');
     $bExtranetUser = $bExtranetEnable && !CExtranet::IsIntranetUser();
     $current_user_id = intval($GLOBALS["USER"]->GetID());
     if ($bExtranetEnable) {
         CSocNetTools::InitGlobalExtranetArrays();
     }
     $arSearchValue = preg_split('/\\s+/', trim($search));
     array_walk($arSearchValue, array('CSocNetLogDestination', '__percent_walk'));
     $arFilter = array(array('LOGIC' => 'OR', '%=NAME' => $arSearchValue, '%=LAST_NAME' => $arSearchValue, '%=EMAIL' => $search, '%=LOGIN' => $search), 'ACTIVE' => 'Y');
     if ($bIntranetEnable || COption::GetOptionString("main", "new_user_registration_email_confirmation", "N") == "Y") {
         $arFilter["CONFIRM_CODE"] = false;
     }
     if ($bEmployeesOnly || $bBitrix24Enable && !$bExtranetEnable) {
         $arFilter["!UF_DEPARTMENT"] = false;
     } elseif ($bExtranetOnly) {
         $arFilter["UF_DEPARTMENT"] = false;
     }
     if ($bIntranetEnable && $bExtranetEnable && ($bExtranetUser || !$bEmployeesOnly)) {
         $arFilteredUserIDs = CExtranet::GetMyGroupsUsersSimple(CExtranet::GetExtranetSiteID());
         if ($bExtranetUser) {
             $arFilter["ID"] = array_merge(array($current_user_id), $arFilteredUserIDs);
         } else {
             $arFilter[] = array('LOGIC' => 'OR', '!UF_DEPARTMENT' => false, 'ID' => array_merge(array($current_user_id), $arFilteredUserIDs));
         }
     }
     $arSelect = array("ID", "NAME", "LAST_NAME", "SECOND_NAME", "EMAIL", "LOGIN", "WORK_POSITION", "PERSONAL_PROFESSION", "PERSONAL_PHOTO", "PERSONAL_GENDER");
     if ($bIntranetEnable) {
         $arSelect[] = 'UF_DEPARTMENT';
     }
     if (intval($departmentId) > 0) {
         $acc = new CAccess();
     }
     $rsUser = \Bitrix\Main\UserTable::getList(array('order' => array('LAST_NAME' => 'ASC'), 'filter' => $arFilter, 'select' => $arSelect, 'limit' => 20, 'data_doubling' => false));
     while ($arUser = $rsUser->fetch()) {
         if (!$bSelf && $current_user_id == $arUser['ID']) {
             continue;
         }
         if (is_object($acc)) {
             $acc->UpdateCodes(array("USER_ID" => $arUser["ID"]));
             $arUserGroupCode = CAccess::GetUserCodesArray($arUser["ID"], array("PROVIDER_ID" => "intranet"));
             if (!in_array("DR" . intval($departmentId), $arUserGroupCode)) {
                 continue;
             }
         }
         $sName = CUser::FormatName(empty($nameTemplate) ? CSite::GetNameFormat(false) : $nameTemplate, $arUser, true, true);
         $arFileTmp = CFile::ResizeImageGet($arUser["PERSONAL_PHOTO"], array('width' => 32, 'height' => 32), BX_RESIZE_IMAGE_EXACT, false);
         $arUsers['U' . $arUser["ID"]] = array('id' => 'U' . $arUser["ID"], 'entityId' => $arUser["ID"], 'name' => $sName, 'avatar' => empty($arFileTmp['src']) ? '' : $arFileTmp['src'], 'desc' => $arUser['WORK_POSITION'] ? $arUser['WORK_POSITION'] : ($arUser['PERSONAL_PROFESSION'] ? $arUser['PERSONAL_PROFESSION'] : '&nbsp;'), 'isExtranet' => isset($GLOBALS["arExtranetUserID"]) && is_array($GLOBALS["arExtranetUserID"]) && in_array($arUser["ID"], $GLOBALS["arExtranetUserID"]) ? "Y" : "N");
         $checksum = md5(serialize($arUsers['U' . $arUser["ID"]]));
         $arUsers['U' . $arUser["ID"]]['checksum'] = $checksum;
     }
     return $arUsers;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:62,代码来源:log_destination.php

示例5: array

     $data = $cachedData["DATA"];
     $tableType = $cachedData["TYPE"];
 } else {
     $GLOBALS["CACHE_MANAGER"]->StartTagCache($cache_path);
     $GLOBALS["CACHE_MANAGER"]->RegisterTag("sonet_user2group_U" . $GLOBALS["USER"]->GetID());
     $GLOBALS["CACHE_MANAGER"]->RegisterTag("USER_CARD");
     $tmpData = array("NAME" => GetMessage("MD_EMPLOYEES_ALL"), "ID" => 0, "OUTSECTION" => true, "bubble_background_color" => "#A7F264", "bubble_text_color" => "#54901E");
     if (SITE_CHARSET != "utf-8") {
         $tmpData = $APPLICATION->ConvertCharsetArray($tmpData, SITE_CHARSET, "utf-8");
     }
     $data = array($tmpData);
     if (!CModule::IncludeModule('extranet') || CExtranet::IsIntranetUser()) {
         $filter = array("ACTIVE" => "Y", "!UF_DEPARTMENT" => false);
     } else {
         $filter = array("ACTIVE" => "Y");
         $arUserID = CExtranet::GetMyGroupsUsersSimple(SITE_ID);
         if (!empty($arUserID)) {
             $filter["ID"] = implode('|', $arUserID);
         } else {
             $filter = false;
         }
     }
     if ($filter) {
         $arParams = array("FIELDS" => array("NAME", "ID", "PERSONAL_PHOTO", "LAST_NAME", "WORK_POSITION", "LOGIN"));
         if ($withTags == "Y") {
             $iblockId = COption::GetOptionInt('intranet', 'iblock_structure', 0);
             $arDepartaments = array();
             $arSectionFilter = array('IBLOCK_ID' => $iblockId);
             CModule::IncludeModule("iblock");
             $dbRes = CIBlockSection::GetList(array('LEFT_MARGIN' => 'DESC'), $arSectionFilter, false, array('ID', 'NAME'));
             while ($arRes = $dbRes->Fetch()) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:users_groups.php

示例6: array

                    if (array_key_exists("USER_PERSONAL_PHOTO", $res)) {
                        $arFileTmp = CFile::ResizeImageGet($res["USER_PERSONAL_PHOTO"], array("width" => 21, "height" => 21), BX_RESIZE_IMAGE_EXACT, false);
                        $arUser["PHOTO"] = CFile::ShowImage($arFileTmp["src"], 21, 21, "border=0");
                    }
                    $arList["items"][] = $arUser;
                } while ($res = $db_res->Fetch());
            }
        }
        if ($arParams["CACHE_TIME"] > 0 && !empty($arList["items"])) {
            $cache->StartDataCache($arParams["CACHE_TIME"], $cache_id, $cache_path);
            $CACHE_MANAGER->StartTagCache($cache_path);
            $CACHE_MANAGER->RegisterTag($_REQUEST["name"] . $_REQUEST["post_id"]);
            $CACHE_MANAGER->EndTagCache();
            $cache->EndDataCache($arList);
        }
    }
    if (CModule::IncludeModule("socialnetwork") && !CSocNetUser::IsCurrentUserModuleAdmin() && CModule::IncludeModule("extranet")) {
        $arMyGroupsUserID = CExtranet::GetMyGroupsUsersSimple(CExtranet::GetExtranetSiteID());
        $arIntranetUsers = CExtranet::GetIntranetUsers();
        $bIntranetUser = CExtranet::IsIntranetUser();
        foreach ($arList["items"] as $key => $arUser) {
            if (is_array($arMyGroupsUserID) && is_array($arIntranetUsers) && ($bIntranetUser && !in_array($arUser["ID"], $arIntranetUsers) && !in_array($arUser["ID"], $arMyGroupsUserID) || !$bIntranetUser && !in_array($arUser["ID"], $arMyGroupsUserID))) {
                unset($arList["items"][$key]);
            }
        }
    }
}
$APPLICATION->RestartBuffer();
Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
echo CUtil::PhpToJsObject($arList);
die;
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:users.php

示例7: foreach

 $sqlHelper = \Bitrix\Main\Application::getConnection()->getSqlHelper();
 foreach ($arSearch as $word) {
     $word = str_replace('%', '%%', $word);
     $word = $sqlHelper->forSql($word);
     $sortExpr .= sprintf('+(CASE WHEN %s THEN 3 WHEN %s THEN 2 WHEN %s THEN 1 ELSE 0 END)', "(%1\$s LIKE '%%" . $word . "%%')", "(%2\$s LIKE '%%" . $word . "%%')", "(%3\$s LIKE '%%" . $word . "%%')");
 }
 $sortWeight = new \Bitrix\Main\Entity\ExpressionField('SORT_WEIGHT', $sortExpr, array('LAST_NAME', 'NAME', 'SECOND_NAME'));
 $arFilter = array(array('LOGIC' => 'OR', '%NAME' => $arSearch, '%LAST_NAME' => $arSearch, '%SECOND_NAME' => $arSearch, '%EMAIL' => $search, '%LOGIN' => $search));
 if ($showActiveUsers == 'Y') {
     $arFilter['ACTIVE'] = 'Y';
 }
 if (IsModuleInstalled("extranet") && $showExtranetUsers == SHOW_NONE || IsModuleInstalled("bitrix24") && !IsModuleInstalled("extranet") || is_array($arFilteredUserIDs) && empty($arFilteredUserIDs)) {
     $arFilter["!UF_DEPARTMENT"] = false;
 } elseif (IsModuleInstalled("extranet") && $showExtranetUsers != SHOW_ALL) {
     if ($showExtranetUsers == SHOW_FROM_MY_GROUPS && CModule::IncludeModule("extranet")) {
         $arFilteredUserIDs = CExtranet::GetMyGroupsUsersSimple(CExtranet::GetExtranetSiteID());
     } elseif ($showExtranetUsers == SHOW_FROM_EXACT_GROUP) {
         $arFilteredUserIDs = array();
         if (CModule::IncludeModule("socialnetwork")) {
             $dbUsers = CSocNetUserToGroup::GetList(array(), array("GROUP_ID" => array($exGroupID), "<=ROLE" => SONET_ROLES_USER, "USER_ACTIVE" => "Y"), false, false, array("ID", "USER_ID"));
             if ($dbUsers) {
                 while ($arUser = $dbUsers->GetNext()) {
                     $arFilteredUserIDs[] = $arUser["USER_ID"];
                 }
             }
         }
     }
     if (is_array($arFilteredUserIDs) && empty($arFilteredUserIDs)) {
         $arFilter["!UF_DEPARTMENT"] = false;
     } elseif (is_array($arFilteredUserIDs)) {
         $arFilter[] = array('LOGIC' => 'OR', '!UF_DEPARTMENT' => false, 'ID' => $arFilteredUserIDs);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php


注:本文中的CExtranet::GetMyGroupsUsersSimple方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。