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


PHP CGroup::GetByID方法代码示例

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


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

示例1: SetUserGroups

 function SetUserGroups($arGroups)
 {
     if (!is_array($arGroups)) {
         return;
     }
     foreach ($arGroups as $groupID) {
         $groupID = intval($groupID);
         $rsGroup = CGroup::GetByID($groupID);
         if (!$rsGroup->Fetch()) {
             continue;
         }
         if (!is_array($this->userGroups)) {
             $this->userGroups = array();
         }
         $this->userGroups[] = $groupID;
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:17,代码来源:csv_user_import.php

示例2: strtolower

    die;
}
global $DBType;
require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/main/classes/" . strtolower($DBType) . "/favorites.php";
__IncludeLang(GetLangFileName(dirname(__FILE__) . "/lang/", "/" . basename(__FILE__)));
//Change site name
$obSite = new CSite();
$obSite->Update("s1", array("NAME" => COption::GetOptionString("main", "site_name", GetMessage("DEFAULT_SITE_NAME"))));
//Edit profile task
$editProfileTask = false;
$dbResult = CTask::GetList(array(), array("NAME" => "main_change_profile"));
if ($arTask = $dbResult->Fetch()) {
    $editProfileTask = $arTask["ID"];
}
//admin security policy
$z = CGroup::GetByID(1);
if ($res = $z->Fetch()) {
    if ($res["SECURITY_POLICY"] == "") {
        $group = new CGroup();
        $arGroupPolicy = array("SESSION_TIMEOUT" => 15, "SESSION_IP_MASK" => "255.255.255.255", "MAX_STORE_NUM" => 1, "STORE_IP_MASK" => "255.255.255.255", "STORE_TIMEOUT" => 60 * 24 * 3, "CHECKWORD_TIMEOUT" => 60, "PASSWORD_LENGTH" => 10, "PASSWORD_UPPERCASE" => "Y", "PASSWORD_LOWERCASE" => "Y", "PASSWORD_DIGITS" => "Y", "PASSWORD_PUNCTUATION" => "Y", "LOGIN_ATTEMPTS" => 3);
        $arFields = array("SECURITY_POLICY" => serialize($arGroupPolicy));
        $group->Update(1, $arFields);
    }
}
//Registered users group
$dbResult = CGroup::GetList($by, $order, array("STRING_ID" => "REGISTERED_USERS"));
if ($dbResult->Fetch()) {
    return;
}
$group = new CGroup();
$arFields = array("ACTIVE" => "Y", "C_SORT" => 3, "NAME" => GetMessage("REGISTERED_GROUP_NAME"), "STRING_ID" => "REGISTERED_USERS");
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:settings.php

示例3: InstallDB

 function InstallDB()
 {
     /** @global string $DBType */
     global $DB, $DBType, $DBHost, $DBLogin, $DBPassword, $DBName, $APPLICATION;
     if (!is_object($APPLICATION)) {
         $APPLICATION = new CMain();
     }
     $DB = new CDatabase();
     $DB->DebugToFile = false;
     $DB->debug = true;
     if (!defined("DBPersistent")) {
         define("DBPersistent", false);
     }
     if (!$DB->Connect($DBHost, $DBName, $DBLogin, $DBPassword)) {
         $APPLICATION->ThrowException(GetMessage("MAIN_INSTALL_DB_ERROR"));
         return false;
     }
     $result = $DB->Query("SELECT * FROM b_module WHERE ID='main'", true, "", array("fixed_connection" => true));
     $success = $result && $result->Fetch();
     if ($success) {
         return true;
     }
     if ($DBType == "mysql" && defined("MYSQL_TABLE_TYPE") && strlen(MYSQL_TABLE_TYPE) > 0) {
         $DB->Query("SET storage_engine = '" . MYSQL_TABLE_TYPE . "'", true);
     }
     $errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/install/" . $DBType . "/install.sql");
     if ($errors !== false) {
         $APPLICATION->ThrowException(implode("", $errors));
         return false;
     }
     $this->InstallTasks();
     $group = new CGroup();
     $arGroups = array(array("~ID" => 1, "ACTIVE" => "Y", "C_SORT" => 1, "NAME" => GetMessage("MAIN_ADMIN_GROUP_NAME"), "ANONYMOUS" => "N", "DESCRIPTION" => GetMessage("MAIN_ADMIN_GROUP_DESC")), array("~ID" => 2, "ACTIVE" => "Y", "C_SORT" => 2, "NAME" => GetMessage("MAIN_EVERYONE_GROUP_NAME"), "ANONYMOUS" => "Y", "DESCRIPTION" => GetMessage("MAIN_EVERYONE_GROUP_DESC")), array("~ID" => 3, "ACTIVE" => "Y", "C_SORT" => 3, "NAME" => GetMessage("MAIN_VOTE_RATING_GROUP_NAME"), "ANONYMOUS" => "N", "DESCRIPTION" => GetMessage("MAIN_VOTE_RATING_GROUP_DESC"), "STRING_ID" => "RATING_VOTE"), array("~ID" => 4, "ACTIVE" => "Y", "C_SORT" => 4, "NAME" => GetMessage("MAIN_VOTE_AUTHORITY_GROUP_NAME"), "ANONYMOUS" => "N", "DESCRIPTION" => GetMessage("MAIN_VOTE_AUTHORITY_GROUP_DESC"), "STRING_ID" => "RATING_VOTE_AUTHORITY"));
     foreach ($arGroups as $arGroup) {
         $rsGroup = CGroup::GetByID($arGroup["~ID"]);
         if ($rsGroup->Fetch()) {
             continue;
         }
         //mssql does not allow insert identity by default
         if (strtolower($DB->type) == "mssql") {
             unset($arGroup["~ID"]);
         }
         $success = (bool) $group->Add($arGroup);
         if (!$success) {
             $APPLICATION->ThrowException($group->LAST_ERROR);
             return false;
         }
     }
     self::InstallRatings();
     $arLanguages = array(array("LID" => LANGUAGE_ID, "ACTIVE" => "Y", "SORT" => 1, "DEF" => "Y", "NAME" => GetMessage("MAIN_DEFAULT_LANGUAGE_NAME"), "FORMAT_DATE" => GetMessage("MAIN_DEFAULT_LANGUAGE_FORMAT_DATE"), "FORMAT_DATETIME" => GetMessage("MAIN_DEFAULT_LANGUAGE_FORMAT_DATETIME"), "FORMAT_NAME" => GetMessage("MAIN_DEFAULT_LANGUAGE_FORMAT_NAME"), "CHARSET" => defined("BX_UTF") ? "UTF-8" : GetMessage("MAIN_DEFAULT_LANGUAGE_FORMAT_CHARSET")));
     if (LANGUAGE_ID != "en") {
         $arLanguages[] = array("LID" => "en", "ACTIVE" => "Y", "SORT" => 2, "DEF" => "N", "NAME" => "English", "FORMAT_DATE" => "MM/DD/YYYY", "FORMAT_DATETIME" => "MM/DD/YYYY H:MI:SS T", "FORMAT_NAME" => "#NAME# #LAST_NAME#", "CHARSET" => defined("BX_UTF") ? "UTF-8" : "iso-8859-1");
     }
     if (LANGUAGE_ID != "de" && file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/lang/de/install/index.php')) {
         $arLanguages[] = array("LID" => "de", "ACTIVE" => "Y", "SORT" => 3, "DEF" => "N", "NAME" => "German", "FORMAT_DATE" => "DD.MM.YYYY", "FORMAT_DATETIME" => "DD.MM.YYYY HH:MI:SS", "FORMAT_NAME" => "#NAME# #LAST_NAME#", "CHARSET" => defined("BX_UTF") ? "UTF-8" : "iso-8859-1");
     }
     if (LANGUAGE_ID != "ru" && file_exists($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/lang/ru/install/index.php')) {
         $arLanguages[] = array("LID" => "ru", "ACTIVE" => "Y", "SORT" => 3, "DEF" => "N", "NAME" => "Russian", "FORMAT_DATE" => "DD.MM.YYYY", "FORMAT_DATETIME" => "DD.MM.YYYY HH:MI:SS", "FORMAT_NAME" => "#NAME# #LAST_NAME#", "CHARSET" => defined("BX_UTF") ? "UTF-8" : "windows-1251");
     }
     $lang = new CLanguage();
     foreach ($arLanguages as $arLanguage) {
         $rsLang = CLanguage::GetByID($arLanguage["LID"]);
         if ($rsLang->Fetch()) {
             continue;
         }
         $success = (bool) $lang->Add($arLanguage);
         if (!$success) {
             $APPLICATION->ThrowException($lang->LAST_ERROR);
             return false;
         }
     }
     $arSite = array("LID" => "s1", "ACTIVE" => "Y", "SORT" => 1, "DEF" => "Y", "NAME" => GetMessage("MAIN_DEFAULT_SITE_NAME"), "DIR" => "/", "FORMAT_DATE" => GetMessage("MAIN_DEFAULT_SITE_FORMAT_DATE"), "FORMAT_DATETIME" => GetMessage("MAIN_DEFAULT_SITE_FORMAT_DATETIME"), "FORMAT_NAME" => GetMessage("MAIN_DEFAULT_SITE_FORMAT_NAME"), "CHARSET" => defined("BX_UTF") ? "UTF-8" : GetMessage("MAIN_DEFAULT_SITE_FORMAT_CHARSET"), "LANGUAGE_ID" => LANGUAGE_ID);
     $rsSites = CSite::GetByID($arSite["LID"]);
     if (!$rsSites->Fetch()) {
         $site = new CSite();
         $success = (bool) $site->Add($arSite);
         if (!$success) {
             $APPLICATION->ThrowException($site->LAST_ERROR);
             return false;
         }
     }
     RegisterModule("main");
     RegisterModuleDependences('iblock', 'OnIBlockPropertyBuildList', 'main', 'CIBlockPropertyUserID', 'GetUserTypeDescription', 100, '/modules/main/tools/prop_userid.php');
     RegisterModuleDependences('main', 'OnUserDelete', 'main', 'CFavorites', 'OnUserDelete', 100, "/modules/main/classes/" . strtolower($GLOBALS["DB"]->type) . "/favorites.php");
     RegisterModuleDependences('main', 'OnLanguageDelete', 'main', 'CFavorites', 'OnLanguageDelete', 100, "/modules/main/classes/" . strtolower($GLOBALS["DB"]->type) . "/favorites.php");
     RegisterModuleDependences('main', 'OnUserDelete', 'main', 'CUserOptions', 'OnUserDelete');
     RegisterModuleDependences('main', 'OnChangeFile', 'main', 'CMain', 'OnChangeFileComponent');
     RegisterModuleDependences('main', 'OnUserTypeRightsCheck', 'main', 'CUser', 'UserTypeRightsCheck');
     RegisterModuleDependences('main', 'OnUserLogin', 'main', 'UpdateTools', 'CheckUpdates');
     RegisterModuleDependences('main', 'OnModuleUpdate', 'main', 'UpdateTools', 'SetUpdateResult');
     RegisterModuleDependences('main', 'OnUpdateCheck', 'main', 'UpdateTools', 'SetUpdateError');
     RegisterModuleDependences('main', 'OnPanelCreate', 'main', 'CUndo', 'CheckNotifyMessage');
     RegisterModuleDependences('main', 'OnAfterAddRating', 'main', 'CRatingsComponentsMain', 'OnAfterAddRating');
     RegisterModuleDependences('main', 'OnAfterUpdateRating', 'main', 'CRatingsComponentsMain', 'OnAfterUpdateRating');
     RegisterModuleDependences('main', 'OnSetRatingsConfigs', 'main', 'CRatingsComponentsMain', 'OnSetRatingConfigs');
     RegisterModuleDependences('main', 'OnGetRatingsConfigs', 'main', 'CRatingsComponentsMain', 'OnGetRatingConfigs');
     RegisterModuleDependences('main', 'OnGetRatingsObjects', 'main', 'CRatingsComponentsMain', 'OnGetRatingObject');
     RegisterModuleDependences('main', 'OnGetRatingContentOwner', 'main', 'CRatingsComponentsMain', 'OnGetRatingContentOwner');
     RegisterModuleDependences('main', 'OnAfterAddRatingRule', 'main', 'CRatingRulesMain', 'OnAfterAddRatingRule');
     RegisterModuleDependences('main', 'OnAfterUpdateRatingRule', 'main', 'CRatingRulesMain', 'OnAfterUpdateRatingRule');
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:101,代码来源:index.php

示例4: __PrintRussian

         case "minute":
             $str .= __PrintRussian($f_RESPONSE_TIME, array(GetMessage("SUP_MINUTE_1"), GetMessage("SUP_MINUTE_3"), GetMessage("SUP_MINUTE_5")));
             break;
         case "day":
             $str .= __PrintRussian($f_RESPONSE_TIME, array(GetMessage("SUP_DAY_1"), GetMessage("SUP_DAY_3"), GetMessage("SUP_DAY_5")));
             break;
     }
 } else {
     $str .= "<nobr>" . GetMessage("SUP_NO_LIMITS") . "</nobr>";
 }
 $row->AddViewField("RESPONSE_TIME", $str);
 $str = "";
 $arG = CTicketSLA::GetGroupArray($f_ID);
 foreach ($arG as $gid) {
     if (!is_array($arGROUPS) || !in_array($gid, array_keys($arGROUPS))) {
         $rs = CGroup::GetByID($gid);
         if ($ar = $rs->Fetch()) {
             $arGROUPS[$gid] = $ar["NAME"];
         }
     }
     $str .= '[<a title="' . GetMessage("MAIN_ADMIN_MENU_EDIT") . '" href="/bitrix/admin/group_edit.php?ID=' . $gid . '&lang=' . LANG . '">' . $gid . '</a>] ' . htmlspecialcharsbx($arGROUPS[$gid]) . '<br>';
 }
 $row->AddViewField("GROUP_ID", $str);
 $str = "&nbsp;";
 if (intval($f_RESPONSIBLE_USER_ID) > 0) {
     Support_GetUserInfo($f_RESPONSIBLE_USER_ID, $f_RESPONSIBLE_LOGIN, $f_RESPONSIBLE_NAME);
     $str = '[<a title="' . GetMessage("SUP_USER_PROFILE") . '" href="/bitrix/admin/user_edit.php?lang=' . LANG . '&ID=' . $f_RESPONSIBLE_USER_ID . '">' . $f_RESPONSIBLE_USER_ID . '</a>] (' . $f_RESPONSIBLE_LOGIN . ') ' . $f_RESPONSIBLE_NAME;
 }
 $row->AddViewField("RESPONSIBLE_USER_ID", $str);
 $arActions = array();
 $arActions[] = array("ICON" => "edit", "DEFAULT" => "Y", "TEXT" => GetMessage("SUP_EDIT"), "ACTION" => $lAdmin->ActionRedirect($EDIT_URL . "?lang=" . LANGUAGE_ID . "&ID=" . $f_ID));
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:ticket_sla_list.php

示例5: fillFilterReferenceColumn

 public static function fillFilterReferenceColumn(&$filterElement, Entity\ReferenceField $field)
 {
     if ($field->getRefEntityName() == '\\Bitrix\\Main\\User') {
         // USER
         if ($filterElement['value']) {
             $res = CUser::GetByID($filterElement['value']);
             $user = $res->fetch();
             if ($user) {
                 $username = CUser::FormatName(CSite::GetNameFormat(null, self::getDefaultSiteId()), $user, true, false);
                 $filterElement['value'] = array('id' => $user['ID'], 'name' => $username);
             } else {
                 $filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('REPORT_USER_NOT_FOUND'));
             }
         } else {
             $filterElement['value'] = array('id' => '');
         }
     } else {
         if ($field->getRefEntityName() == '\\Bitrix\\Main\\Group') {
             // GROUP
             if ($filterElement['value']) {
                 $res = CGroup::GetByID($filterElement['value']);
                 $group = $res->fetch();
                 if ($group) {
                     $filterElement['value'] = array('id' => $group['ID'], 'name' => $group['NAME']);
                 } else {
                     $filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('SALE_REPORT_GROUP_NOT_FOUND'));
                 }
             } else {
                 $filterElement['value'] = array('id' => '');
             }
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:33,代码来源:sale_report_helper.php

示例6: strlen

 case "USER_GROUP_CHANGED":
     if (!array_key_exists($a_ITEM_ID, $arUsersCache)) {
         $rsUser = CUser::GetByID($a_ITEM_ID);
         if ($arUser = $rsUser->GetNext()) {
             $arUser["FULL_NAME"] = $arUser["NAME"] . (strlen($arUser["NAME"]) <= 0 || strlen($arUser["LAST_NAME"]) <= 0 ? "" : " ") . $arUser["LAST_NAME"];
         }
         $arUsersCache[$a_ITEM_ID] = $arUser;
     }
     if ($arUsersCache[$a_ITEM_ID]) {
         $row->AddViewField("ITEM_ID", '[<a href="user_edit.php?lang=' . LANG . '&amp;ID=' . $a_ITEM_ID . '">' . $a_ITEM_ID . '</a>] ' . $arUsersCache[$a_ITEM_ID]["FULL_NAME"]);
     }
     break;
 case "GROUP_POLICY_CHANGED":
 case "MODULE_RIGHTS_CHANGED":
     if (!array_key_exists($a_ITEM_ID, $arGroupsCache)) {
         $rsGroup = CGroup::GetByID($a_ITEM_ID);
         if ($arGroup = $rsGroup->GetNext()) {
             $arGroupsCache[$a_ITEM_ID] = $arGroup["NAME"];
         } else {
             $arGroupsCache[$a_ITEM_ID] = "";
         }
     }
     $row->AddViewField("ITEM_ID", '[<a href="group_edit.php?lang=' . LANG . '&amp;ID=' . $a_ITEM_ID . '">' . $a_ITEM_ID . '</a>] ' . $arGroupsCache[$a_ITEM_ID]);
     break;
 case "TASK_CHANGED":
     $rsTask = CTask::GetByID($a_ITEM_ID);
     if ($arTask = $rsTask->GetNext()) {
         $row->AddViewField("ITEM_ID", '[<a href="task_edit.php?lang=' . LANG . '&amp;ID=' . $a_ITEM_ID . '">' . $a_ITEM_ID . '</a>] ' . $arTask["NAME"]);
     }
     break;
 case "FORUM_MESSAGE_APPROVE":
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:event_log.php

示例7: getGroup

 public function getGroup($code)
 {
     $groupId = $this->getGroupId($code);
     return $groupId ? \CGroup::GetByID($groupId)->Fetch() : false;
 }
开发者ID:andreyryabin,项目名称:sprint.migration,代码行数:5,代码来源:UserGroupHelper.php

示例8: array

		$user = new CUser;
		$arFields = array(
			"EMAIL" => $newUserEmail,
			"LOGIN" => $newUserLogin,
			"ACTIVE" => "Y",
			"PASSWORD" => $newUserPass,
			"CONFIRM_PASSWORD" => $newUserConfirmPass,
		);

		$userID = $user->Add($arFields);
		if (intval($userID) > 1)
		{
			$arGroups = explode(",",COption::GetOptionString("intranet", "1C_USER_IMPORT_GROUP_PERMISSIONS", ""));
			foreach ($arGroups as $index => $groupID)
			{
				$dbGroup = CGroup::GetByID($groupID);
				$arGroup = $dbGroup->Fetch();
				if (!$arGroup || $arGroup["ID"] == 1)
					unset($arGroups[$index]);
			}

			if (empty($arGroups))
			{
				$dbGroup = CGroup::GetList($by="c_sort", $order="desc", array("STRING_ID" => "1C_USER_IMPORT_GROUP"));
				if ($arExistGroup = $dbGroup->Fetch())
				{
					$groupID = $arExistGroup["ID"];
				}
				else
				{
					$group = new CGroup;
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:user_import.php

示例9: ClearVars

<?php

require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
$saleModulePermissions = $APPLICATION->GetGroupRight("sale");
if ($saleModulePermissions < "W") {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
ClearVars("f_");
IncludeModuleLangFile(__FILE__);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/include.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/prolog.php";
$ID = IntVal($ID);
$z = CGroup::GetByID($ID);
if (!$z->ExtractFields("f_")) {
    LocalRedirect("sale_tax_exempt.php?lang=" . LANG . GetFilterParams("filter_", false));
}
$strError = "";
$bInitVars = false;
if ((strlen($save) > 0 || strlen($apply) > 0) && $REQUEST_METHOD == "POST" && $saleModulePermissions == "W" && check_bitrix_sessid()) {
    $arTAX = array();
    CSaleTax::DeleteExempt(array("GROUP_ID" => $ID));
    if (isset($TAX_ID) && is_array($TAX_ID) && count($TAX_ID) > 0) {
        for ($i = 0; $i < count($TAX_ID); $i++) {
            if (IntVal($TAX_ID[$i]) > 0) {
                CSaleTax::AddExempt(array("GROUP_ID" => $ID, "TAX_ID" => IntVal($TAX_ID[$i])));
            }
        }
    }
    if (strlen($strError) > 0) {
        $bInitVars = True;
    }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:tax_exempt_edit.php

示例10: FormatDestinationFromRights


//.........这里部分代码省略.........
     }
     $arRights = array_unique($arRights);
     usort($arRights, "__DestinationRightsSort");
     $cnt = 0;
     $bAll = false;
     $bJustCount = false;
     $arParams["DESTINATION_LIMIT"] = intval($arParams["DESTINATION_LIMIT"]) <= 0 ? 3 : $arParams["DESTINATION_LIMIT"];
     $arModuleEvents = array();
     $db_events = GetModuleEvents("socialnetwork", "OnSocNetLogFormatDestination");
     while ($arEvent = $db_events->Fetch()) {
         $arModuleEvents[] = $arEvent;
     }
     foreach ($arRights as $right_tmp) {
         if ($cnt >= $arParams["DESTINATION_LIMIT"]) {
             $bJustCount = true;
         }
         if (in_array($right_tmp, array("G1")) && count($arRights) > 1) {
             continue;
         } elseif (preg_match('/^US\\d+$/', $right_tmp, $matches) || in_array($right_tmp, array("G2", "AU"))) {
             if ($bAll) {
                 continue;
             }
             if (isset($arParams["USE_ALL_DESTINATION"]) && $arParams["USE_ALL_DESTINATION"] && in_array($right_tmp, array("G2", "AU"))) {
                 continue;
             }
             if (!$bJustCount) {
                 $arDestination[] = array("STYLE" => "all-users", "TITLE" => IsModuleInstalled("intranet") ? GetMessage("SONET_GL_DESTINATION_G2") : GetMessage("SONET_GL_DESTINATION_G2_BSM"));
             }
             $bAll = true;
             $cnt++;
         } elseif (preg_match('/^G(\\d+)$/', $right_tmp, $matches)) {
             $cnt++;
             if (!$bJustCount) {
                 $rsGroupTmp = CGroup::GetByID($matches[1]);
                 if ($arGroupTmp = $rsGroupTmp->Fetch()) {
                     $arDestination[] = array("TYPE" => "G", "ID" => $arGroupTmp["ID"], "STYLE" => "groups", "TITLE" => $arGroupTmp["NAME"], "URL" => "");
                 }
             }
         } elseif (preg_match('/^U(\\d+)$/', $right_tmp, $matches)) {
             if (array_key_exists("CREATED_BY", $arParams) && intval($arParams["CREATED_BY"]) > 0 && $arParams["CREATED_BY"] == $matches[1]) {
                 continue;
             }
             $cnt++;
             if (!$bJustCount) {
                 $rsUserTmp = CUser::GetByID($matches[1]);
                 if ($arUserTmp = $rsUserTmp->Fetch()) {
                     $arDestination[] = array("TYPE" => "U", "ID" => $arUserTmp["ID"], "STYLE" => "users", "TITLE" => CUser::FormatName($arParams["NAME_TEMPLATE"], $arUserTmp, $arParams["SHOW_LOGIN"] == "Y"), "URL" => str_replace("#user_id#", $arUserTmp["ID"], $arParams["PATH_TO_USER"]), "IS_EXTRANET" => is_array($GLOBALS["arExtranetUserID"]) && in_array($arUserTmp["ID"], $GLOBALS["arExtranetUserID"]) ? "Y" : "N");
                 }
             }
         } elseif ((preg_match('/^D(\\d+)$/', $right_tmp, $matches) || preg_match('/^DR(\\d+)$/', $right_tmp, $matches)) && CModule::IncludeModule("iblock")) {
             $cnt++;
             if (!$bJustCount) {
                 if (array_key_exists($matches[1], $arDepartments)) {
                     $arDepartmentTmp = $arDepartments[$matches[1]];
                 } else {
                     $rsDepartmentTmp = CIBlockSection::GetByID($matches[1]);
                     if ($arDepartmentTmp = $rsDepartmentTmp->GetNext()) {
                         $arDepartments[$matches[1]] = $arDepartmentTmp;
                     }
                 }
                 if ($arDepartmentTmp) {
                     $arDestination[] = array("TYPE" => "D", "ID" => $arDepartmentTmp["ID"], "STYLE" => "department", "TITLE" => $arDepartmentTmp["NAME"], "URL" => str_replace(array("#ID#", "#id#"), $arDepartmentTmp["ID"], $arParams["PATH_TO_CONPANY_DEPARTMENT"]));
                 }
             }
         } elseif (preg_match('/^SG(\\d+)_' . SONET_ROLES_USER . '$/', $right_tmp, $matches) || preg_match('/^SG(\\d+)$/', $right_tmp, $matches)) {
             if (array_key_exists($matches[1], $arSonetGroups) && is_array($arSonetGroups[$matches[1]]) && in_array(SONET_ROLES_USER, $arSonetGroups[$matches[1]])) {
开发者ID:Satariall,项目名称:izurit,代码行数:67,代码来源:log_tools.php

示例11: GetMessage

	<tr>
		<td><?php 
    echo GetMessage('LAST_UPDATE');
    ?>
</td>
		<td><?php 
    echo $str_TIMESTAMP_X;
    ?>
</td>
	</tr>
	<?php 
}
?>
	<?php 
if ($ID > 0 && $ID != 2 && $COPY_ID <= 0) {
    $dbGroupTmp = CGroup::GetByID($ID, "Y");
    if ($arGroupTmp = $dbGroupTmp->Fetch()) {
        ?>
			<tr>
				<td><?php 
        echo GetMessage('MAIN_TOTAL_USERS');
        ?>
</td>
				<td><a href="user_admin.php?lang=<?php 
        echo LANG;
        ?>
&find_group_id[]=<?php 
        echo $ID;
        ?>
&set_filter=Y" title="<?php 
        echo GetMessage("MAIN_VIEW_USER_GROUPS");
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:group_edit.php

示例12: prepareFieldsData


//.........这里部分代码省略.........
                     case self::FLD_T_FLOAT:
                         $arCheckResult[$fieldName]['FIELD_TYPE'] = 'FLD_T_FLOAT';
                         $arCheckResult[$fieldName]['FIELD_TYPE_MASK'] = self::FLD_T_FLOAT;
                         $bValueIsCorrect = $this->__checkNumericField(true, $fieldValue, $bUnsignedType, $bNotNull, $bNotZero);
                         break;
                     case self::FLD_T_IDENT:
                         $arCheckResult[$fieldName]['FIELD_TYPE'] = 'FLD_T_IDENT';
                         $arCheckResult[$fieldName]['FIELD_TYPE_MASK'] = self::FLD_T_IDENT;
                         $fieldValue = trim($fieldValue);
                         if (is_numeric($fieldValue) && ($fieldValue = intval($fieldValue)) > 0 || preg_match('~^[a-z0-9A-Z\\_]{1,255}$~', $fieldValue)) {
                             $bValueIsCorrect = true;
                         }
                         break;
                     case self::FLD_T_DATETIME:
                         $arCheckResult[$fieldName]['FIELD_TYPE'] = 'FLD_T_DATETIME';
                         $arCheckResult[$fieldName]['FIELD_TYPE'] = self::FLD_T_DATETIME;
                         $fieldValue = trim($fieldValue);
                         $bValueIsCorrect = true;
                         // TODO: Тут надо дописать обработку дат и времени
                         break;
                     case self::FLD_T_BX_LANG_ID:
                         $arCheckResult[$fieldName]['FIELD_TYPE'] = 'FLD_T_BX_LANG_ID';
                         $arCheckResult[$fieldName]['FIELD_TYPE_MASK'] = self::FLD_T_BX_LANG_ID;
                         $fieldValue = trim($fieldValue);
                         if (strlen($fieldValue) > 0 && preg_match('~^[a-zA-Z\\_][a-z0-9A-Z\\_]?$~', $fieldValue)) {
                             $bValueIsCorrect = true;
                         }
                         break;
                     case self::FLD_T_IBLOCK_ID:
                         $arCheckResult[$fieldName]['FIELD_TYPE'] = 'FLD_T_IBLOCK_ID';
                         $arCheckResult[$fieldName]['FIELD_TYPE_MASK'] = self::FLD_T_IBLOCK_ID;
                         $fieldValue = intval($fieldValue);
                         /** @noinspection PhpDynamicAsStaticMethodCallInspection */
                         $rs = \CIBlock::GetByID($fieldValue);
                         if ($arData = $rs->GetNext()) {
                             $arCheckResult[$fieldName]['CHECK_DATA'] = $arData;
                             $bValueIsCorrect = true;
                         }
                         break;
                     case self::FLD_T_IBLOCK_PROP_ID:
                         $arCheckResult[$fieldName]['FIELD_TYPE'] = 'FLD_T_IBLOCK_PROP_ID';
                         $arCheckResult[$fieldName]['FIELD_TYPE_MASK'] = self::FLD_T_IBLOCK_PROP_ID;
                         $rs = \CIBlockProperty::GetByID($fieldValue);
                         if ($arData = $rs->GetNext()) {
                             $arCheckResult[$fieldName]['CHECK_DATA'] = $arData;
                             $bValueIsCorrect = true;
                         }
                         break;
                     case self::FLD_T_IBLOCK_ELEMENT_ID:
                         $arCheckResult[$fieldName]['FIELD_TYPE'] = 'FLD_T_IBLOCK_ELEMENT_ID';
                         $arCheckResult[$fieldName]['FIELD_TYPE_MASK'] = self::FLD_T_IBLOCK_ELEMENT_ID;
                         $rs = \CIBlockElement::GetByID($fieldValue);
                         if ($arData = $rs->GetNext()) {
                             $arCheckResult[$fieldName]['CHECK_DATA'] = $arData;
                             $bValueIsCorrect = true;
                         }
                         break;
                     case self::FLD_T_IBLOCK_SECTION_ID:
                         $arCheckResult[$fieldName]['FIELD_TYPE'] = 'FLD_T_IBLOCK_SECTION_ID';
                         $arCheckResult[$fieldName]['FIELD_TYPE_MASK'] = self::FLD_T_IBLOCK_SECTION_ID;
                         $rs = \CIBlockSection::GetByID($fieldValue);
                         if ($arData = $rs->GetNext()) {
                             $arCheckResult[$fieldName]['CHECK_DATA'] = $arData;
                             $bValueIsCorrect = true;
                         }
                         break;
开发者ID:OpenBX,项目名称:obx.core,代码行数:67,代码来源:entity.php


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