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


PHP CommonFunctions::isSuperUser方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:vanminh0910,项目名称:shangri-la,代码行数:8,代码来源:CommonFunctions.php

示例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 &copy; <?php 
echo date('Y');
?>
 by Minh Ha.<br/>
    All Rights Reserved.<br/>
    <?php 
开发者ID:vanminh0910,项目名称:shangri-la,代码行数:31,代码来源:main.php


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