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


PHP CExtranet::GetExtranetUserGroupID方法代码示例

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


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

示例1: addUser

 /**
  * Add new user to b_user table.
  * Returns its identifier or false on failure.
  *
  * @param array $params
  *
  * @return integer|false
  */
 public function addUser($params)
 {
     if (!$this->isEnabled()) {
         $this->errorCollection[] = new Error(Loc::getMessage('B24NET_NETWORK_IN_NOT_ENABLED'), self::ERROR_NETWORK_IN_NOT_ENABLED);
         return false;
     }
     $password = md5($params['XML_ID'] . '|' . $params['CLIENT_DOMAIN'] . '|' . rand(1000, 9999) . '|' . time() . '|' . uniqid());
     $photo = \CFile::MakeFileArray($params['PERSONAL_PHOTO_ORIGINAL']);
     $groups = array();
     if (Loader::includeModule('extranet')) {
         $groups[] = \CExtranet::GetExtranetUserGroupID();
     }
     $addParams = array('LOGIN' => $params['NETWORK_USER_ID'] . '@' . $params['CLIENT_DOMAIN'], 'NAME' => $params['NAME'], 'EMAIL' => $params['EMAIL'], 'LAST_NAME' => $params['LAST_NAME'], 'SECOND_NAME' => $params['SECOND_NAME'], 'PERSONAL_GENDER' => $params['PERSONAL_GENDER'], 'PERSONAL_PHOTO' => $photo, 'WORK_POSITION' => $params['CLIENT_DOMAIN'], 'XML_ID' => $params['XML_ID'], 'EXTERNAL_AUTH_ID' => self::EXTERNAL_AUTH_ID, "ACTIVE" => "Y", "PASSWORD" => $password, "CONFIRM_PASSWORD" => $password, "GROUP_ID" => $groups);
     if (isset($params['EMAIL'])) {
         $addParams['EMAIL'] = $params['EMAIL'];
     }
     $user = new \CUser();
     $userId = $user->Add($addParams);
     if (intval($userId) <= 0) {
         $this->errorCollection[] = new Error($user->LAST_ERROR, self::ERROR_REGISTER_USER);
         return false;
     }
     $event = new Event("socialservices", "OnAfterRegisterUserByNetwork", array($userId, $params['NETWORK_USER_ID'], $params['CLIENT_DOMAIN']));
     $event->send();
     return $userId;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:34,代码来源:network.php

示例2: array

					false,
					false,
					array("ID")
				);
				while($arGroupTmp = $dbGroupTmp->Fetch())
				{
					$GLOBALS["arExtranetGroupID"][] = $arGroupTmp["ID"];
					if (defined("BX_COMP_MANAGED_CACHE"))
						$CACHE_MANAGER->RegisterTag('sonet_group_'.$arGroupTmp["ID"]);
				}

				$rsUsers = CUser::GetList(
					($by="ID"),
					($order="asc"),
					array(
						"GROUPS_ID" => array(CExtranet::GetExtranetUserGroupID()),
						"UF_DEPARTMENT" => false
					)
				);
				while($arUser = $rsUsers->Fetch())
				{
					$GLOBALS["arExtranetUserID"][] = $arUser["ID"];
					if (defined("BX_COMP_MANAGED_CACHE"))
						$CACHE_MANAGER->RegisterTag('sonet_user2group_U'.$arUser["ID"]);
				}

				if (defined("BX_COMP_MANAGED_CACHE"))
					$CACHE_MANAGER->EndTagCache();

				if($obCache->StartDataCache())
					$obCache->EndDataCache(array(
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:31,代码来源:ajax.php

示例3: getExtranetUsers

 public static function getExtranetUsers($id)
 {
     static $cache = array();
     static $groupId = null;
     if (method_exists('CExtranet', 'GetExtranetUserGroupID')) {
         if ($groupId === null) {
             $groupId = CExtranet::GetExtranetUserGroupID();
         }
         if ($groupId !== false) {
             $filterExtranetUsers = array('ID' => $id, 'GROUPS_ID' => (array) (int) $groupId);
             // Prevent using users, that doesn't activate it's account
             // http://jabber.bx/view.php?id=29118
             if (IsModuleInstalled('bitrix24')) {
                 $filterExtranetUsers['CONFIRM_CODE'] = false;
             }
             $cacheKey = md5(serialize($filterExtranetUsers));
             if (!array_key_exists($cacheKey, $cache)) {
                 $cache[$cacheKey] = array();
                 $dbRes = CUser::GetList($by = 'last_name', $order = 'asc', $filterExtranetUsers, array('SELECT' => array('UF_DEPARTMENT')));
                 while ($row = $dbRes->getNext()) {
                     $cache[$cacheKey][] = $row;
                 }
             }
             return $cache[$cacheKey];
         }
     }
     return array();
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:28,代码来源:functions.php

示例4: array

 $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["Subjects"] = array();
     $dbSubjects = CSocNetGroupSubject::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array("SITE_ID" => SITE_ID), false, false, array("ID", "NAME"));
     while ($arSubject = $dbSubjects->GetNext()) {
         $arResult["Subjects"][$arSubject["ID"]] = $arSubject["NAME"];
     }
     if (CModule::IncludeModule("extranet")) {
         $arExtranetUserID = array();
         $arFilter = array("GROUPS_ID" => array(CExtranet::GetExtranetUserGroupID()), "UF_DEPARTMENT" => false);
         $rsUsers = CUser::GetList($by = "ID", $order = "asc", $arFilter);
         while ($arUser = $rsUsers->Fetch()) {
             $arExtranetUserID[] = $arUser["ID"];
         }
     }
     $arResult["Group"] = $arGroup;
     if ($arResult["Group"]["CLOSED"] == "Y" && COption::GetOptionString("socialnetwork", "work_with_closed_groups", "N") != "Y") {
         $arResult["HideArchiveLinks"] = true;
     }
     $arResult["CurrentUserPerms"] = CSocNetUserToGroup::InitUserPerms($GLOBALS["USER"]->GetID(), $arResult["Group"], CSocNetUser::IsCurrentUserModuleAdmin());
     if (in_array($arResult["CurrentUserPerms"]["UserRole"], array(SONET_ROLES_OWNER, SONET_ROLES_MODERATOR, SONET_ROLES_USER))) {
         $arResult["bSubscribed"] = CSocNetSubscription::IsUserSubscribed($GLOBALS["USER"]->GetID(), "SG" . $arParams["GROUP_ID"]);
     } else {
         $arResult["bSubscribed"] = false;
     }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例5: array

     }
     $dbUsers = $obUser->GetList($sort_by = 'last_name', $sort_dir = 'asc', $arFilter, $arListParams);
 }
 $arDepartments = array();
 $strUserIDs = '';
 while ($arUser = $dbUsers->Fetch()) {
     $arResult['USERS'][$arUser['ID']] = $arUser;
     $strUserIDs .= ($strUserIDs == '' ? '' : '|') . $arUser['ID'];
 }
 //head
 $dbRes = CIBlockSection::GetList(array(), array('UF_HEAD' => array_keys($arResult['USERS']), 'IBLOCK_ID' => COption::GetOptionInt('intranet', 'iblock_structure')), false, array('ID', 'NAME', 'UF_HEAD'));
 while ($arSection = $dbRes->Fetch()) {
     $arResult['USERS'][$arSection['UF_HEAD']]["DEP_HEAD"][$arSection["ID"]] = $arSection["NAME"];
 }
 if (CModule::IncludeModule('extranet')) {
     $extranetGroupID = CExtranet::GetExtranetUserGroupID();
 }
 $arAdmins = array();
 $rsUsers = CUser::GetList($o, $b, array("GROUPS_ID" => array(1)), array("SELECT" => array("ID")));
 while ($ar = $rsUsers->Fetch()) {
     $arAdmins[$ar["ID"]] = $ar["ID"];
 }
 $extranetUsers = array();
 if (isset($extranetGroupID)) {
     $rsUsers = CUser::GetList($o, $b, array("GROUPS_ID" => array($extranetGroupID)), array("SELECT" => array("ID")));
     while ($ar = $rsUsers->Fetch()) {
         $extranetUsers[$ar["ID"]] = $ar["ID"];
     }
 }
 foreach ($arResult['USERS'] as $key => $arUser) {
     if ($arParams['bCache']) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例6: CUser

                }
            }
        }
        $arResult["SUBORDINATE"] = $subordinate_users;
    }
    // user activity status
    if ($arResult["User"]["ACTIVE"] == "Y") {
        $arResult["User"]["ACTIVITY_STATUS"] = "active";
    }
    $obUser = new CUser();
    $arGroups = $obUser->GetUserGroup($arResult["User"]['ID']);
    if (in_array(1, $arGroups)) {
        $arResult["User"]["ACTIVITY_STATUS"] = "admin";
    }
    $arGroups = CUser::GetUserGroup($arResult["User"]['ID']);
    if (CModule::IncludeModule('extranet') && in_array(CExtranet::GetExtranetUserGroupID(), $arGroups) && (!is_array($arResult["User"]['UF_DEPARTMENT']) || empty($arResult["User"]['UF_DEPARTMENT'][0]))) {
        $arResult["User"]["ACTIVITY_STATUS"] = "extranet";
        $arResult["User"]["IS_EXTRANET"] = true;
    } else {
        $arResult["User"]["IS_EXTRANET"] = false;
    }
    if ($arResult["User"]["ACTIVE"] == "N") {
        $arResult["User"]["ACTIVITY_STATUS"] = "fired";
    }
    if ($arResult["User"]["ACTIVE"] == "Y" && !empty($arResult["User"]["CONFIRM_CODE"])) {
        $arResult["User"]["ACTIVITY_STATUS"] = "invited";
    }
    if ($arResult["User"]["ID"] == $GLOBALS["USER"]->GetID() && CSocNetUser::IsCurrentUserModuleAdmin(SITE_ID, false) && !isset($_SESSION["SONET_ADMIN"])) {
        $arResult["SHOW_SONET_ADMIN"] = true;
    }
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:result_modifier.php

示例7: randString

             $res = $user->Update($userID, $arFields);
             $checkword = $arFields["CHECKWORD"];
         }
     } else {
         $arIntranetUsersEmails[] = $email["EMAIL"];
         continue;
     }
 } else {
     //creating user with specified e-mail
     $password = randString($password_min_length, $password_chars);
     $checkword = randString(8);
     $name = $last_name = "";
     if (strlen($email["NAME"]) > 0) {
         list($name, $last_name) = explode(" ", $email["NAME"]);
     }
     $arFields = array("EMAIL" => $email["EMAIL"], "LOGIN" => $email["EMAIL"], "NAME" => $name, "LAST_NAME" => $last_name, "ACTIVE" => "Y", "GROUP_ID" => CExtranet::GetExtranetUserGroupID() > 0 ? array(2, CExtranet::GetExtranetUserGroupID()) : array(2), "PASSWORD" => $password, "CONFIRM_PASSWORD" => $password, "CHECKWORD" => $checkword, "LID" => SITE_ID);
     $user = new CUser();
     $NEW_USER_ID = $user->Add($arFields);
     if (intval($NEW_USER_ID) > 0) {
         $arUserIDs[] = $userID = $NEW_USER_ID;
     } else {
         $strError = $user->LAST_ERROR;
         if ($GLOBALS["APPLICATION"]->GetException()) {
             $err = $GLOBALS["APPLICATION"]->GetException();
             $strError .= $err->GetString();
             $GLOBALS["APPLICATION"]->ResetException();
         }
         $warningMessage .= str_replace("#EMAIL#", HtmlSpecialCharsEx($email["EMAIL"]), GetMessage("SONET_GCE_CANNOT_USER_ADD") . $strError);
     }
 }
 //sending invitation to new user ($userID) with this e-mail
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例8: SendEvent


//.........这里部分代码省略.........
             }
             $intranet_site_id = CSite::GetDefSite();
         }
         $arIntranetUsers = CExtranet::GetIntranetUsers();
         $extranet_site_id = CExtranet::GetExtranetSiteID();
     }
     $dbSubscribers = CSocNetLogEvents::GetList(array("TRANSPORT" => "DESC"), array("USER_ACTIVE" => "Y", "SITE_ID" => array_merge($arLogSites, array(false))), false, false, array("USER_ID", "ENTITY_TYPE", "ENTITY_ID", "ENTITY_CB", "ENTITY_MY", "USER_NAME", "USER_LAST_NAME", "USER_LOGIN", "USER_LID", "USER_EMAIL", "TRANSPORT"), $arListParams);
     $arListParams = array("USE_SUBSCRIBE" => "Y", "ENTITY_TYPE" => $arLogComment["ENTITY_TYPE"], "ENTITY_ID" => $arLogComment["ENTITY_ID"], "EVENT_ID" => $arLogComment["EVENT_ID"], "USER_ID" => $arLogComment["USER_ID"], "OF_ENTITIES" => $arOfEntities, "TRANSPORT" => "N");
     $dbUnSubscribers = CSocNetLogEvents::GetList(array("TRANSPORT" => "DESC"), array("USER_ACTIVE" => "Y", "SITE_ID" => array_merge($arLogSites, array(false))), false, false, array("USER_ID", "SITE_ID", "ENTITY_TYPE", "ENTITY_ID", "ENTITY_CB", "ENTITY_MY", "TRANSPORT", "EVENT_ID"), $arListParams);
     $arUnSubscribers = array();
     while ($arUnSubscriber = $dbUnSubscribers->Fetch()) {
         $arUnSubscribers[] = $arUnSubscriber["USER_ID"] . "_" . $arUnSubscriber["ENTITY_TYPE"] . "_" . $arUnSubscriber["ENTITY_ID"] . "_" . $arUnSubscriber["ENTITY_MY"] . "_" . $arUnSubscriber["ENTITY_CB"] . "_" . $arUnSubscriber["EVENT_ID"];
     }
     $bHasAccessAll = CSocNetLogRights::CheckForUserAll($arLog["ID"] ? $arLog["ID"] : $arLogComment["LOG_ID"]);
     $arSentUserID = array("M" => array(), "X" => array());
     while ($arSubscriber = $dbSubscribers->Fetch()) {
         if (is_array($arIntranetUsers) && !in_array($arSubscriber["USER_ID"], $arIntranetUsers) && !in_array($extranet_site_id, $arLogSites)) {
             continue;
         }
         if (array_key_exists($arSubscriber["TRANSPORT"], $arSentUserID) && in_array($arSubscriber["USER_ID"], $arSentUserID[$arSubscriber["TRANSPORT"]])) {
             continue;
         }
         if (intval($arSubscriber["ENTITY_ID"]) != 0 && $arSubscriber["EVENT_ID"] == "all" && (in_array($arSubscriber["USER_ID"] . "_" . $arSubscriber["ENTITY_TYPE"] . "_" . $arSubscriber["ENTITY_ID"] . "_N_" . $arSubscriber["ENTITY_CB"] . "_" . $arLogComment["EVENT_ID"], $arUnSubscribers) || in_array($arSubscriber["USER_ID"] . "_" . $arSubscriber["ENTITY_TYPE"] . "_" . $arSubscriber["ENTITY_ID"] . "_Y_" . $arSubscriber["ENTITY_CB"] . "_" . $arLogComment["EVENT_ID"], $arUnSubscribers))) {
             continue;
         } elseif (intval($arSubscriber["ENTITY_ID"]) == 0 && $arSubscriber["ENTITY_CB"] == "N" && $arSubscriber["EVENT_ID"] != "all" && (in_array($arSubscriber["USER_ID"] . "_" . $arSubscriber["ENTITY_TYPE"] . "_" . $arLogComment["ENTITY_ID"] . "_Y_N_all", $arUnSubscribers) || in_array($arSubscriber["USER_ID"] . "_" . $arSubscriber["ENTITY_TYPE"] . "_" . $arLogComment["ENTITY_ID"] . "_N_N_all", $arUnSubscribers) || in_array($arSubscriber["USER_ID"] . "_" . $arSubscriber["ENTITY_TYPE"] . "_" . $arLogComment["ENTITY_ID"] . "_Y_N_" . $arLogComment["EVENT_ID"], $arUnSubscribers) || in_array($arSubscriber["USER_ID"] . "_" . $arSubscriber["ENTITY_TYPE"] . "_" . $arLogComment["ENTITY_ID"] . "_N_N_" . $arLogComment["EVENT_ID"], $arUnSubscribers))) {
             continue;
         }
         $arSentUserID[$arSubscriber["TRANSPORT"]][] = $arSubscriber["USER_ID"];
         if (!$bHasAccessAll) {
             $bHasAccess = CSocNetLogRights::CheckForUserOnly($arLog["ID"] ? $arLog["ID"] : $arLogComment["LOG_ID"], $arSubscriber["USER_ID"]);
             if (!$bHasAccess) {
                 continue;
             }
         }
         if ($arLogComment["ENTITY_TYPE"] == SONET_ENTITY_GROUP && is_array($arIntranetUsers) && CModule::IncludeModule("extranet")) {
             $server_name = $arSites[!in_array($arSubscriber["USER_ID"], $arIntranetUsers) && $extranet_site_id ? $extranet_site_id : $intranet_site_id]["SERVER_NAME"];
             $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL_TO_SEND"] = str_replace(array("#SERVER_NAME#", "#GROUPS_PATH#"), array($server_name, COption::GetOptionString("socialnetwork", "workgroups_page", false, !in_array($arSubscriber["USER_ID"], $arIntranetUsers) && $extranet_site_id ? $extranet_site_id : $intranet_site_id)), $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL"]);
         } else {
             $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL_TO_SEND"] = $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL"];
         }
         switch ($arSubscriber["TRANSPORT"]) {
             case "X":
                 if (array_key_exists("URL_TO_SEND", $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && strlen($arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL_TO_SEND"]) > 0) {
                     $link = GetMessage("SONET_GLC_SEND_EVENT_LINK") . $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL_TO_SEND"];
                 } else {
                     $link = "";
                 }
                 $arMessageFields = array("FROM_USER_ID" => intval($arLogComment["USER_ID"]) > 0 ? $arLogComment["USER_ID"] : 1, "TO_USER_ID" => $arSubscriber["USER_ID"], "MESSAGE" => $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["TITLE"] . " #BR# " . $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"] . (strlen($link) > 0 ? "#BR# " . $link : ""), "=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "MESSAGE_TYPE" => SONET_MESSAGE_SYSTEM, "IS_LOG" => "Y");
                 CSocNetMessages::Add($arMessageFields);
                 break;
             case "M":
                 $arFields["SUBSCRIBER_ID"] = $arSubscriber["USER_ID"];
                 $arFields["SUBSCRIBER_NAME"] = $arSubscriber["USER_NAME"];
                 $arFields["SUBSCRIBER_LAST_NAME"] = $arSubscriber["USER_LAST_NAME"];
                 $arFields["SUBSCRIBER_LOGIN"] = $arSubscriber["USER_LOGIN"];
                 $arFields["SUBSCRIBER_EMAIL"] = $arSubscriber["USER_EMAIL"];
                 $arFields["EMAIL_TO"] = $arSubscriber["USER_EMAIL"];
                 $arFields["TITLE"] = str_replace("#BR#", "\n", $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["TITLE"]);
                 $arFields["MESSAGE"] = str_replace("#BR#", "\n", $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["MESSAGE"]);
                 $arFields["ENTITY"] = $arLogComment["FIELDS_FORMATTED"]["ENTITY"]["FORMATTED"];
                 $arFields["ENTITY_TYPE"] = $arLogComment["FIELDS_FORMATTED"]["ENTITY"]["TYPE_MAIL"];
                 if (array_key_exists("URL_TO_SEND", $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]) && strlen($arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL_TO_SEND"]) > 0) {
                     $arFields["URL"] = $arLogComment["FIELDS_FORMATTED"]["EVENT_FORMATTED"]["URL_TO_SEND"];
                 } else {
                     $arFields["URL"] = $arLogComment["URL"];
                 }
                 if (CModule::IncludeModule("extranet")) {
                     $arUserGroup = CUser::GetUserGroup($arSubscriber["USER_ID"]);
                 }
                 foreach ($arLogSites as $site_id_tmp) {
                     if (IsModuleInstalled("extranet")) {
                         if (CExtranet::IsExtranetSite($site_id_tmp) && in_array(CExtranet::GetExtranetUserGroupID(), $arUserGroup) || !CExtranet::IsExtranetSite($site_id_tmp) && !in_array(CExtranet::GetExtranetUserGroupID(), $arUserGroup)) {
                             $siteID = $site_id_tmp;
                             break;
                         } else {
                             continue;
                         }
                     } else {
                         $siteID = $site_id_tmp;
                         break;
                     }
                 }
                 if (!$siteID) {
                     $siteID = defined("SITE_ID") ? SITE_ID : $arSubscriber["SITE_ID"];
                 }
                 if (StrLen($siteID) <= 0) {
                     $siteID = $arSubscriber["USER_LID"];
                 }
                 if (StrLen($siteID) <= 0) {
                     continue;
                 }
                 $event = new CEvent();
                 $event->Send($mailTemplate, $siteID, $arFields, "N");
                 break;
             default:
         }
     }
     CUserCounter::IncrementWithSelect(CSocNetLogCounter::GetSubSelect($arLog["ID"], $arLog["ENTITY_TYPE"], $arLog["ENTITY_ID"], $arLogComment["EVENT_ID"], $arLogComment["USER_ID"], $arOfEntities, false, false, "Y", "LC"));
     return true;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:101,代码来源:log_comments.php

示例9: InitGlobalExtranetArrays

	public static function InitGlobalExtranetArrays($SITE_ID = SITE_ID)
	{
		if (
			!isset($GLOBALS["arExtranetGroupID"])
			|| !isset($GLOBALS["arExtranetUserID"])
		)
		{
			$GLOBALS["arExtranetGroupID"] = array();
			$GLOBALS["arExtranetUserID"] = array();

			if($GLOBALS["USER"]->IsAuthorized())
			{
				$ttl = (defined("BX_COMP_MANAGED_CACHE") ? 2592000 : 600);
				$cache_id = 'sonet_ex_gr_'.$SITE_ID;
				$obCache = new CPHPCache;
				$cache_dir = '/bitrix/sonet_log_sg';

				if($obCache->InitCache($ttl, $cache_id, $cache_dir))
				{
					$tmpVal = $obCache->GetVars();
					$GLOBALS["arExtranetGroupID"] = $tmpVal['EX_GROUP_ID'];
					$GLOBALS["arExtranetUserID"] = $tmpVal['EX_USER_ID'];
					unset($tmpVal);
				}
				elseif (CModule::IncludeModule("extranet"))
				{
					global $CACHE_MANAGER;
					if (defined("BX_COMP_MANAGED_CACHE"))
					{
						$CACHE_MANAGER->StartTagCache($cache_dir);
					}

					if (!CExtranet::IsExtranetSite())
					{
						$dbGroupTmp = CSocNetGroup::GetList(
							array(),
							array(
								"SITE_ID" => CExtranet::GetExtranetSiteID()
							),
							false,
							false,
							array("ID")
						);
						while($arGroupTmp = $dbGroupTmp->Fetch())
						{
							$GLOBALS["arExtranetGroupID"][] = $arGroupTmp["ID"];
							if (defined("BX_COMP_MANAGED_CACHE"))
							{
								$CACHE_MANAGER->RegisterTag('sonet_group_'.$arGroupTmp["ID"]);
							}
						}
					}

					$rsUsers = CUser::GetList(
						($by="ID"),
						($order="asc"),
						array(
							"GROUPS_ID" => array(CExtranet::GetExtranetUserGroupID()),
							"UF_DEPARTMENT" => false
						),
						array("FIELDS" => array("ID"))
					);
					while($arUser = $rsUsers->Fetch())
					{
						$GLOBALS["arExtranetUserID"][] = $arUser["ID"];
						if (defined("BX_COMP_MANAGED_CACHE"))
						{
							$CACHE_MANAGER->RegisterTag('sonet_user2group');
						}
					}

					if (defined("BX_COMP_MANAGED_CACHE"))
					{
						$CACHE_MANAGER->EndTagCache();
					}

					if($obCache->StartDataCache())
					{
						$obCache->EndDataCache(array(
							'EX_GROUP_ID' => $GLOBALS["arExtranetGroupID"],
							'EX_USER_ID' => $GLOBALS["arExtranetUserID"]
						));
					}
				}
			}
		}
	}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:87,代码来源:functions.php

示例10: array

$arResult["CURRENT_USERS"] = array();
if (sizeof($arParams["VALUE"])) {
    $arListedUsers = array();
    $arFilter['!UF_DEPARTMENT'] = false;
    $arFilter['ID'] = implode('|', $arParams['VALUE']);
    // Prevent using users, that doesn't activate it's account
    // http://jabber.bx/view.php?id=29118
    if (IsModuleInstalled('bitrix24')) {
        $arFilter['!LAST_LOGIN'] = false;
    }
    $dbRes = CUser::GetList($by = 'last_name', $order = 'asc', $arFilter, array('SELECT' => array('UF_DEPARTMENT')));
    while ($arRes = $dbRes->GetNext()) {
        $arListedUsers[] = $arRes;
    }
    if (CModule::IncludeModule('extranet') && method_exists('CExtranet', 'GetExtranetUserGroupID')) {
        $rc = CExtranet::GetExtranetUserGroupID();
        if ($rc !== false) {
            $arExtranetGroups = array((int) $rc);
            $arFilterExtranetUsers = array('ID' => $arFilter['ID'], 'GROUPS_ID' => $arExtranetGroups);
            // Prevent using users, that doesn't activate it's account
            // http://jabber.bx/view.php?id=29118
            if (IsModuleInstalled('bitrix24')) {
                $arFilterExtranetUsers['!LAST_LOGIN'] = false;
            }
            $dbRes = CUser::GetList($by = 'last_name', $order = 'asc', $arFilterExtranetUsers, array('SELECT' => array('UF_DEPARTMENT')));
            while ($arRes = $dbRes->GetNext()) {
                $arListedUsers[] = $arRes;
            }
        }
    }
    $arListedUniqueUsers = array();
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例11: CUser

                $subordinate_users[$arRes["ID"]] = $arRes;
            }
        }
    }
    $arResult["SUBORDINATE"] = $subordinate_users;
}
// user activity status
if ($arResult["User"]["ACTIVE"] == "Y") {
    $arResult["User"]["ACTIVITY_STATUS"] = "active";
}
$obUser = new CUser();
$arGroups = $obUser->GetUserGroup($arResult["User"]['ID']);
if (in_array(1, $arGroups)) {
    $arResult["User"]["ACTIVITY_STATUS"] = "admin";
}
$arGroups = CUser::GetUserGroup($arResult["User"]['ID']);
if (CModule::IncludeModule('extranet') && in_array(CExtranet::GetExtranetUserGroupID(), $arGroups) && count($arResult["User"]['UF_DEPARTMENT']) <= 0) {
    $arResult["User"]["ACTIVITY_STATUS"] = "extranet";
    $arResult["User"]["IS_EXTRANET"] = true;
} else {
    $arResult["User"]["IS_EXTRANET"] = false;
}
if ($arResult["User"]["ACTIVE"] == "N") {
    $arResult["User"]["ACTIVITY_STATUS"] = "fired";
}
if (IsModuleInstalled("bitrix24") && $arResult["User"]["ACTIVE"] == "Y" && empty($arResult["User"]["LAST_ACTIVITY_DATE"])) {
    $arResult["User"]["ACTIVITY_STATUS"] = "invited";
}
if ($arResult["User"]["ID"] == $GLOBALS["USER"]->GetID() && CSocNetUser::IsCurrentUserModuleAdmin(SITE_ID, false) && !isset($_SESSION["SONET_ADMIN"])) {
    $arResult["SHOW_SONET_ADMIN"] = true;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:result_modifier.php

示例12: array

     $password_min_length = 6;
 }
 $password_chars = array("abcdefghijklnmopqrstuvwxyz", "ABCDEFGHIJKLNMOPQRSTUVWXYZ", "0123456789");
 if ($arPolicy["PASSWORD_PUNCTUATION"] === "Y") {
     $password_chars[] = ",.<>/?;:'\"[]{}\\|`~!@#\$%^&*()-_+=";
 }
 $password = randString($password_min_length, $password_chars);
 $checkword = randString(8);
 $user = new CUser();
 $name = $last_name = "";
 if (strlen($email["NAME"]) > 0) {
     list($name, $last_name) = explode(" ", $email["NAME"]);
 }
 $arFields = array("EMAIL" => $email["EMAIL"], "LOGIN" => $email["EMAIL"], "NAME" => $name, "LAST_NAME" => $last_name, "ACTIVE" => "Y", "GROUP_ID" => array(2), "PASSWORD" => $password, "CONFIRM_PASSWORD" => $password, "CHECKWORD" => $checkword, "LID" => SITE_ID);
 if (CExtranet::GetExtranetUserGroupID() > 0) {
     $arFields["GROUP_ID"] = array(2, CExtranet::GetExtranetUserGroupID());
 }
 $NEW_USER_ID = $user->Add($arFields);
 if (intval($NEW_USER_ID) > 0) {
     $arUserToRequest[] = array("NAME" => (strlen($email["NAME"]) > 0 ? $email["NAME"] . " " : "") . "&lt;" . $email["EMAIL"] . "&gt;", "ID" => $NEW_USER_ID);
     $event = new CEvent();
     $arFields = array("USER_ID" => $NEW_USER_ID, "CHECKWORD" => $checkword, "EMAIL" => $email["EMAIL"]);
     $event->Send("EXTRANET_INVITATION", SITE_ID, $arFields);
 } else {
     $strError = $user->LAST_ERROR;
     if ($GLOBALS['APPLICATION']->GetException()) {
         $err = $GLOBALS['APPLICATION']->GetException();
         $strError .= $err->GetString();
         $GLOBALS['APPLICATION']->ResetException();
     }
     $warningMessage .= Str_Replace("#EMAIL#", HtmlSpecialCharsEx($email["EMAIL"]), GetMessage("SONET_C33_CANNOT_USER_ADD") . $strError);
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例13: GetPublicUsers

 function GetPublicUsers($full = false)
 {
     global $USER;
     $arPublicUsers = array();
     $arFilter = array(COption::GetOptionString("extranet", "extranet_public_uf_code", "UF_PUBLIC") => "1", "ID" => "~" . $USER->GetID(), "!UF_DEPARTMENT" => false, "GROUPS_ID" => array(CExtranet::GetExtranetUserGroupID()));
     $rsUsers = CUser::GetList($by = "ID", $order = "asc", $arFilter);
     while ($arUser = $rsUsers->GetNext()) {
         if ($full) {
             $arPublicUsers[] = $arUser;
         } else {
             $arPublicUsers[] = $arUser["ID"];
         }
     }
     return $arPublicUsers;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:15,代码来源:extranet.php

示例14: CPHPCache

         $obCache = new CPHPCache();
         $cache_dir = '/bitrix/sonet_log_sg';
         if ($obCache->InitCache($ttl, $cache_id, $cache_dir)) {
             $tmpVal = $obCache->GetVars();
             $GLOBALS["arExtranetGroupID"] = $tmpVal['EX_GROUP_ID'];
             $GLOBALS["arExtranetUserID"] = $tmpVal['EX_USER_ID'];
             unset($tmpVal);
         } elseif (CModule::IncludeModule("extranet") && !CExtranet::IsExtranetSite()) {
             global $CACHE_MANAGER;
             $CACHE_MANAGER->StartTagCache($cache_dir);
             $dbGroupTmp = CSocNetGroup::GetList(array(), array("SITE_ID" => CExtranet::GetExtranetSiteID()), false, false, array("ID"));
             while ($arGroupTmp = $dbGroupTmp->Fetch()) {
                 $GLOBALS["arExtranetGroupID"][] = $arGroupTmp["ID"];
                 $CACHE_MANAGER->RegisterTag('sonet_group_' . $arGroupTmp["ID"]);
             }
             $rsUsers = CUser::GetList($by = "ID", $order = "asc", array("GROUPS_ID" => array(CExtranet::GetExtranetUserGroupID()), "UF_DEPARTMENT" => false));
             while ($arUser = $rsUsers->Fetch()) {
                 $GLOBALS["arExtranetUserID"][] = $arUser["ID"];
                 $CACHE_MANAGER->RegisterTag('sonet_user2group_U' . $arUser["ID"]);
             }
             $CACHE_MANAGER->EndTagCache();
             if ($obCache->StartDataCache()) {
                 $obCache->EndDataCache(array('EX_GROUP_ID' => $GLOBALS["arExtranetGroupID"], 'EX_USER_ID' => $GLOBALS["arExtranetUserID"]));
             }
         }
         unset($obCache);
     }
 }
 if (!$GLOBALS["USER"]->IsAuthorized()) {
     $arResult[0] = "*";
 } elseif (!check_bitrix_sessid()) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:ajax.php

示例15: getUserGroups

 public static function getUserGroups($SITE_ID, $bExtranetUser = false)
 {
     $arGroups = array();
     if ($bExtranetUser && CModule::IncludeModule("extranet")) {
         $extranetGroupID = CExtranet::GetExtranetUserGroupID();
         if (intval($extranetGroupID) > 0) {
             $arGroups[] = $extranetGroupID;
         }
     } else {
         $rsGroups = CGroup::GetList($o = "", $b = "", array("STRING_ID" => "EMPLOYEES_" . $SITE_ID));
         while ($arGroup = $rsGroups->Fetch()) {
             $arGroups[] = $arGroup["ID"];
         }
     }
     return $arGroups;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:16,代码来源:invite_dialog.php


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