本文整理汇总了PHP中CommonFunctions::isSuperUser方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonFunctions::isSuperUser方法的具体用法?PHP CommonFunctions::isSuperUser怎么用?PHP CommonFunctions::isSuperUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonFunctions
的用法示例。
在下文中一共展示了CommonFunctions::isSuperUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isAdminUser
static function isAdminUser($name)
{
if (CommonFunctions::isSuperUser($name) || in_array($name, array('admin2', 'genband'))) {
return true;
} else {
return false;
}
}
示例2: array
<title><?php
echo CHtml::encode($this->pageTitle);
?>
</title>
</head>
<body>
<?php
// build groups list
$groups = Group::model()->findAll();
$group_menu = array();
foreach ($groups as $key => $value) {
$group_menu[] = array('label' => $value->name, 'url' => array('/site/changeGroup', 'group' => $value->id));
}
$this->widget('bootstrap.widgets.TbNavbar', array('type' => null, 'brand' => Yii::app()->name, 'brandUrl' => Yii::app()->request->baseUrl, 'collapse' => true, 'fixed' => false, 'items' => array(array('class' => 'bootstrap.widgets.TbMenu', 'items' => array(array('label' => 'Matches', 'url' => array('/event/listing'), 'active' => false), array('label' => 'Ranking', 'url' => array('/user/ranking'), 'active' => false), array('label' => 'My Bets', 'url' => array('/betOptionUser/index'), 'active' => false), array('label' => 'Settings', 'url' => '#', 'visible' => CommonFunctions::isAdminUser(Yii::app()->user->name), 'items' => array(array('label' => 'MATCHES'), array('label' => 'Create match', 'url' => array('/event/create')), array('label' => 'Manage matches', 'url' => array('/event/admin')), '---', array('label' => 'USERS'), array('label' => 'Create user', 'url' => array('/user/create')), array('label' => 'Manage users', 'url' => array('/user/admin')), '---', array('label' => 'GROUPS', 'visible' => CommonFunctions::isSuperUser(Yii::app()->user->name)), array('label' => 'Create group', 'url' => array('/group/create'), 'visible' => CommonFunctions::isSuperUser(Yii::app()->user->name)), array('label' => 'Manage groups', 'url' => array('/group/admin'), 'visible' => CommonFunctions::isSuperUser(Yii::app()->user->name)))), array('label' => 'Change Group', 'url' => '#', 'items' => $group_menu), array('label' => 'Login', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest, 'itemOptions' => array('style' => 'right:0;position:fixed;', 'class' => 'facebook')), array('label' => 'Logout (' . Yii::app()->user->name . ')' . '-' . (isset(Yii::app()->user->user) ? User::model()->findByPk(Yii::app()->user->id)->points : ''), 'url' => array('/site/logout'), 'visible' => !Yii::app()->user->isGuest, 'itemOptions' => array('id' => 'logout_link', 'style' => 'right:0;position:fixed;', 'class' => 'facebook')))))));
?>
<?php
echo $content;
?>
<div class="clear"></div>
<div id="footer">
Copyright © <?php
echo date('Y');
?>
by Minh Ha.<br/>
All Rights Reserved.<br/>
<?php