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


PHP CAccess::GetNames方法代码示例

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


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

示例1: LocalRedirect

    Bitrix\Security\Mfa\Otp::setMandatoryUsing($_POST['otp_mandatory_using'] === 'Y');
    if (is_array($_POST['otp_mandatory_rights'])) {
        Bitrix\Security\Mfa\Otp::setMandatoryRights($_POST['otp_mandatory_rights']);
    }
    if ($_REQUEST["save"] != "" && $_GET["return_url"] != "") {
        LocalRedirect($_GET["return_url"]);
    } else {
        LocalRedirect("/bitrix/admin/security_otp.php?lang=" . LANGUAGE_ID . $returnUrl . "&" . $tabControl->ActiveTabParam());
    }
}
$availableTypes = \Bitrix\Security\Mfa\Otp::getAvailableTypes();
$availableTypesDescription = \Bitrix\Security\Mfa\Otp::getTypesDescription();
$defaultType = \Bitrix\Security\Mfa\Otp::getDefaultType();
$targetRights = \Bitrix\Security\Mfa\Otp::getMandatoryRights();
$access = new CAccess();
$targetRightsNames = $access->GetNames($targetRights);
CJSCore::Init(array('access'));
$APPLICATION->AddHeadScript('/bitrix/js/security/admin/page/otp.js');
$APPLICATION->SetTitle(GetMessage("SEC_OTP_NEW_TITLE"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
if (CSecurityUser::isActive()) {
    $messageType = "OK";
    $messageText = GetMessage("SEC_OTP_NEW_ON");
} else {
    $messageType = "ERROR";
    $messageText = GetMessage("SEC_OTP_NEW_OFF");
}
CAdminMessage::ShowMessage(array("MESSAGE" => $messageText, "TYPE" => $messageType, "HTML" => true));
?>

<form method="POST" action="security_otp.php?lang=<?php 
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:security_otp.php

示例2: GetAccessNames

 public static function GetAccessNames()
 {
     $arCodes = array();
     foreach (self::$accessNames as $code => $name) {
         if ($name === null) {
             $arCodes[] = $code;
         }
     }
     if ($arCodes) {
         $access = new CAccess();
         $arNames = $access->GetNames($arCodes);
         foreach ($arNames as $code => $name) {
             self::$accessNames[$code] = trim(htmlspecialcharsbx($name['provider'] . ' ' . $name['name']));
         }
     }
     return self::$accessNames;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:17,代码来源:calendar.php

示例3: InsertAccess

	$arAllOptions["main"][] = array('note'=>GetMessage("MAIN_OPT_TIME_ZONE_NOTE"));
}

$arAllOptions["main"][] = GetMessage("main_options_map");
$arAllOptions["main"][] = Array("map_top_menu_type", GetMessage("MAIN_TOP_MENU_TYPE"), "top", Array("text", 30));
$arAllOptions["main"][] = Array("map_left_menu_type", GetMessage("MAIN_LEFT_MENU_TYPE"), "left", Array("text", 30));

//show public panel for users
CJSCore::Init(array('access'));

$arCodes = unserialize(COption::GetOptionString("main", "show_panel_for_users"));
if(!is_array($arCodes))
	$arCodes = array();

$access = new CAccess();
$arNames = $access->GetNames($arCodes);

$arSel = array();
foreach($arCodes as $code)
	$arSel[$code] = true;

$panel = "
<script type=\"text/javascript\">

BX.Access.Init({
	other: {disabled:true}
});

BX.Access.SetSelected(".CUtil::PhpToJSObject($arSel).");

function InsertAccess(arRights)
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:options.php

示例4: LearningShowRights

    protected static function LearningShowRights($lessonId, $variable_name, $arBaseRights, $arPossibleRights, $arActualRights, $arSelected = array(), $arHighLight = array(), $readOnly)
    {
        $js_var_name = preg_replace("/[^a-zA-Z0-9_]/", "_", $variable_name);
        $html_var_name = htmlspecialcharsbx($variable_name);
        $sSelect = '<select name="' . $html_var_name . '[][TASK_ID]" style="vertical-align:middle">';
        foreach ($arPossibleRights as $taskId => $arRightsData) {
            $selected = '';
            if (strtoupper($arRightsData['name']) === 'LEARNING_LESSON_ACCESS_DENIED') {
                $selected = ' selected="selected" ';
            }
            $sSelect .= '<option value="' . (int) $taskId . '" ' . $selected . '>' . htmlspecialcharsex($arRightsData['name_human']) . '</option>';
        }
        $sSelect .= '</select>';
        $table_id = $variable_name . "_table";
        $href_id = $variable_name . "_href";
        CJSCore::Init(array('access'));
        ?>
		<tr>
			<td colspan="2" align="center">
				<input type="hidden" name="<?php 
        echo $variable_name . '_marker';
        ?>
" value='yeah!'>
				<script type="text/javascript">
					var obLearningJSRightsAccess_<?php 
        echo $js_var_name;
        ?>
 = new LearningJSRightsAccess(
						<?php 
        echo intval($lessonId);
        ?>
,
						<?php 
        echo CUtil::PhpToJsObject($arSelected);
        ?>
,
						'<?php 
        echo CUtil::JSEscape($variable_name);
        ?>
',
						'<?php 
        echo CUtil::JSEscape($table_id);
        ?>
',
						'<?php 
        echo CUtil::JSEscape($href_id);
        ?>
',
						'<?php 
        echo CUtil::JSEscape($sSelect);
        ?>
',
						<?php 
        echo CUtil::PhpToJsObject($arHighLight);
        ?>
					);
				</script>
				<h3><?php 
        echo GetMessage('LEARNING_RIGHTS_FOR_ADMINISTRATION');
        ?>
</h3>
				<table width="100%" cellpadding="0" cellspacing="10" border="0" id="<?php 
        echo htmlspecialcharsbx($table_id);
        ?>
" align="center">
				<?php 
        $access = new CAccess();
        // If rights are for lesson => show base rights
        if ($lessonId !== false) {
            $arBaseNames = $access->GetNames(array_keys($arBaseRights));
            foreach ($arBaseRights as $symbol => $taskId) {
                if ($taskId <= 0) {
                    continue;
                }
                ?>
					<tr valign="top">
						<td align="right"><?php 
                echo htmlspecialcharsex($arBaseNames[$symbol]['provider'] . ' ' . $arBaseNames[$symbol]['name']);
                ?>
:&nbsp;</td>
						<td align="left">
							<?php 
                echo htmlspecialcharsex(CLearnAccess::GetNameForTask($taskId));
                ?>
						</td>
					</tr>
					<?php 
            }
        }
        $arNames = $access->GetNames(array_keys($arActualRights));
        foreach ($arActualRights as $symbol => $taskId) {
            if ($taskId <= 0) {
                continue;
            }
            ?>
				<tr valign="top">
					<td align="right">
						<div style="padding-top:8px;">
						<span href="javascript:void(0);" 
							onclick="LearningJSRightsAccess.DeleteRow(
//.........这里部分代码省略.........
开发者ID:Satariall,项目名称:izurit,代码行数:101,代码来源:clearnrenderrightsedit.php

示例5: GetMessage

echo GetMessage("EDIT_ACCESS_USER_GROUP");
?>
</b></td>
		<td><b><?php 
echo GetMessage("EDIT_ACCESS_PERMISSION");
?>
</b> </td>
	</tr>
	<tr class="empty">
		<td colspan="2"></td>
	</tr>

<?
//names for access codes
$access = new CAccess();
$arNames = $access->GetNames($arUserGroupsID, true);

//Javascript variables
$jsTaskArray = "window.BXTaskArray = {'0':'".CUtil::JSEscape(GetMessage("EDIT_ACCESS_SET_INHERIT"))."'";
foreach ($arPermTypes as $taskID => $taskTitle)
	$jsTaskArray .= ",'".$taskID."':'".CUtil::JSEscape($taskTitle)."'";
$jsTaskArray .= "};";

$jsInheritPerm = "";
$jsInheritPermID = "var jsInheritPermIDs = [";
$bWasCurrentPerm = false;

foreach($arNames as $access_code => $dummy):
	if(!in_array($access_code, $arUserGroupsID))
		continue;
开发者ID:nProfessor,项目名称:Mytb,代码行数:30,代码来源:access_edit.php

示例6: unserialize

									}, toAllCheckBox));
								}
							</script>
							<?
						}
					?></td>
				</tr><?
			}
			elseif ($Option[0] == "livefeed_toall_rights")
			{
				$arToAllRights = unserialize($val);
				if (!$arToAllRights)
					$arToAllRights = unserialize($Option[2]);

				$access = new CAccess();
				$arNames = $access->GetNames($arToAllRights);

				?><tr id="RIGHTS_all" style="display: <?php 
echo COption::GetOptionString("socialnetwork", "allow_livefeed_toall", "Y") == "Y" ? "table-row" : "none";
?>
;"><td>&nbsp;</td><td><?
				?><script>
				
					var rightsCont = BX('RIGHTS_all');
					if (toAllCheckBox && rightsCont)
					{
						BX.bind(toAllCheckBox, 'click', BX.delegate(function(e) {
							rightsCont.style.display = (this.checked ? "" : "none");
						}, toAllCheckBox));
					}
				
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:30,代码来源:options.php

示例7: IBlockShowRights


//.........这里部分代码省略.........
    ?>
',
					<?php 
    echo CUtil::PhpToJsObject($arHighLight);
    ?>
				);
			</script>
			<table width="100%" class="internal" id="<?php 
    echo htmlspecialcharsbx($table_id);
    ?>
" align="center">
			<?php 
    if ($section_title != "") {
        ?>
			<tr id="<?php 
        echo $html_var_name;
        ?>
_heading" class="heading">
				<td colspan="2">
					<?php 
        echo $section_title;
        ?>
				</td>
			</tr>
			<?php 
    }
    ?>
			<?php 
    $arNames = array();
    foreach ($arActualRights as $arRightSet) {
        $arNames[] = $arRightSet["GROUP_CODE"];
    }
    $access = new CAccess();
    $arNames = $access->GetNames($arNames);
    foreach ($arActualRights as $RIGHT_ID => $arRightSet) {
        if ($bForceInherited || $arRightSet["IS_INHERITED"] == "Y") {
            ?>
					<tr class="<?php 
            echo $html_var_name;
            ?>
_row_for_<?php 
            echo htmlspecialcharsbx($arRightSet["GROUP_CODE"]);
            if ($arRightSet["IS_OVERWRITED"] == "Y") {
                echo " iblock-strike-out";
            }
            ?>
">
						<td style="width:40%!important; text-align:right"><?php 
            echo htmlspecialcharsex($arNames[$arRightSet["GROUP_CODE"]]["provider"] . " " . $arNames[$arRightSet["GROUP_CODE"]]["name"]);
            ?>
:</td>
						<td align="left">
							<?php 
            if ($arRightSet["IS_OVERWRITED"] != "Y") {
                ?>
							<input type="hidden" name="<?php 
                echo $html_var_name;
                ?>
[][RIGHT_ID]" value="<?php 
                echo htmlspecialcharsbx($RIGHT_ID);
                ?>
">
							<input type="hidden" name="<?php 
                echo $html_var_name;
                ?>
[][GROUP_CODE]" value="<?php 
开发者ID:rasuldev,项目名称:torino,代码行数:67,代码来源:admin_tools.php

示例8: unset

 }
 if (isset($arTaskLetters['T'])) {
     unset($arTasks[$arTaskLetters['T']]);
 }
 $arResult['PERMISSIONS'] = $arTasks;
 if (!$bCreate) {
     $arRightParams = array("count_overwrited" => true);
     if (!empty($arResult['ENTITY_PARENTS'])) {
         $arRightParams['parents'] = $arResult['ENTITY_PARENTS'];
     }
     $arCurrent = $obIBlockRights->GetRights($arRightParams);
     foreach ($arCurrent as $arRightSet) {
         $arNames[] = $arRightSet["GROUP_CODE"];
     }
     $access = new CAccess();
     $arSubjs = $access->GetNames($arNames);
     if (!empty($arParams['SOCNET_TYPE']) && !$USER->CanDoOperation('webdav_change_settings') && intval($arParams['SOCNET_ID']) > 0) {
         foreach ($arCurrent as $rightID => &$arRight) {
             if ($arRight['GROUP_CODE'] === 'G1' && $arRight['IS_INHERITED'] === 'Y' && $arRight['TASK_ID'] === $arTaskLetters['X'] || $arRight['GROUP_CODE'] === 'G2' && $arRight['IS_INHERITED'] === 'Y' && $arRight['TASK_ID'] === $arTaskLetters['D']) {
                 unset($arCurrent[$rightID]);
                 // commont rights
                 continue;
             }
             if ($arParams['SOCNET_TYPE'] == 'group') {
                 if ($arRight['GROUP_CODE'] === 'SG' . $arParams['SOCNET_ID'] . '_A' && $arRight['TASK_ID'] === $arTaskLetters['X']) {
                     $arRight['IS_INHERITED'] = 'Y';
                 }
                 // group admin
             } elseif ($arParams['SOCNET_TYPE'] == 'user') {
                 if ($arRight['GROUP_CODE'] === 'U' . $arParams['SOCNET_ID'] && $arRight['TASK_ID'] === $arTaskLetters['X']) {
                     $arRight['IS_INHERITED'] = 'Y';
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例9: PushAccessNames

 public static function PushAccessNames($arCodes = array())
 {
     foreach ($arCodes as $code) {
         if (empty(self::$accessNames[$code])) {
             $access = new CAccess();
             $arNames = $access->GetNames($arCodes);
             foreach ($arNames as $c => $val) {
                 self::$accessNames[$c] = trim(htmlspecialcharsbx($val['provider'] . ' ' . $val['name']));
             }
             break;
         }
     }
 }
开发者ID:rasuldev,项目名称:torino,代码行数:13,代码来源:calendar.php

示例10: array

while ($arRole = $obRes->Fetch()) {
    $arRole['PATH_TO_EDIT'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_ROLE_EDIT'], array('role_id' => $arRole['ID']));
    $arRole['PATH_TO_DELETE'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_ROLE_EDIT'], array('role_id' => $arRole['ID'])), array('delete' => '1', 'sessid' => bitrix_sessid()));
    $arRole['NAME'] = htmlspecialcharsbx($arRole['NAME']);
    $arResult['ROLE'][$arRole['ID']] = $arRole;
}
// get role relation
$arResult['RELATION'] = array();
$arResult['RELATION_ENTITY'] = array();
$obRes = CCrmRole::GetRelation();
while ($arRelation = $obRes->Fetch()) {
    $arResult['RELATION'][$arRelation['RELATION']] = $arRelation;
    $arResult['RELATION_ENTITY'][$arRelation['RELATION']] = true;
}
$CAccess = new CAccess();
$arNames = $CAccess->GetNames(array_keys($arResult['RELATION_ENTITY']));
foreach ($arResult['RELATION'] as &$arRelation) {
    //Issue #43598
    $arRelation['NAME'] = htmlspecialcharsbx($arNames[$arRelation['RELATION']]['name']);
    $providerName = $arNames[$arRelation['RELATION']]['provider'];
    if (!empty($providerName)) {
        $arRelation['NAME'] = '<b>' . htmlspecialcharsbx($providerName) . ':</b> ' . $arRelation['NAME'];
    }
}
unset($arRelation);
//Issue #38744
/*if(IsModuleInstalled('bitrix24'))
{
	$arResult['DISABLED_PROVIDERS'] = array('group');
}*/
$this->IncludeComponentTemplate();
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php


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