Esempio n. 1
0
 static function isAdminUser($name)
 {
     if (CommonFunctions::isSuperUser($name) || in_array($name, array('admin2', 'genband'))) {
         return true;
     } else {
         return false;
     }
 }
Esempio n. 2
0
	<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