本文整理匯總了PHP中CSite::InGroup方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSite::InGroup方法的具體用法?PHP CSite::InGroup怎麽用?PHP CSite::InGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CSite
的用法示例。
在下文中一共展示了CSite::InGroup方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _c
function _c()
{
$debugGroups = explode(",", COption::GetOptionString("scrollup.bxd", "SBXD_GROUPS", ""));
if (CSite::InGroup($debugGroups)) {
$_ = func_get_args();
return call_user_func_array(array('Cbxd', 'c'), $_);
}
}
示例2: empty
<ul class="nav nav-list">
<?
global $USER;
if ($USER->IsAuthorized()):?>
<?
$dbUser=CUser::GetByID($USER->GetID());
$arUser=$dbUser->Fetch();
?>
<li class="nav-header">
Вы вошли как: <?php
echo empty($arUser["NAME"]) ? $arUser["LOGIN"] : $arUser["NAME"];
?>
</li>
<li>
<a href="<?php
echo CSite::InGroup(array(GROUP_MANAGER)) ? "/kabinet-menedzhera/" : "/personal/";
?>
" title="Личный кабинет">Личный кабинет</a>
</li>
<li><a href="/auth/?logout=yes" title="Выход">Выход</a></li>
<? else: ?>
<li><a href="/auth/?register=yes" title="Регистрация">Регистрация</a><li>
<a href="/auth/" title="Войти">Вход</a><li>
<?endif;?>
</ul>
</td>
</tr>
</table>
示例3: LocalRedirect
<?php
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
global $USER;
if (!CSite::InGroup(array(14)) && !$USER->IsAdmin()) {
if ($USER->IsAuthorized()) {
LocalRedirect("/");
} else {
LocalRedirect("/?backurl=/QR/");
}
}
CModule::IncludeModule("iblock");
$NewElement = new CIBlockElement();
$arLoadProductArray_log = array("IBLOCK_ID" => 27, "NAME" => $USER->GetID() ? $USER->GetID() : 999);
$NewElement->Add($arLoadProductArray_log);
$APPLICATION->SetTitle("QR");
?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<style>
body {
background: #001022;
color: #fff;
}
.main {
width:350px;
margin:50px auto;
font-size:20px;
text-align: center;
}
a {
display: block;