Beispiel #1
0
 /**
  * 后台日志记录
  * @param  $intro
  */
 public static function _create(array $arr = array())
 {
     $session = new XSession();
     $admini = $session->get('_admini');
     $model = new AdminLogger();
     $model->attributes = $arr;
     !isset($arr['user_id']) && ($model->user_id = intval($admini['userId']));
     $model->url = Yii::app()->request->getRequestUri();
     $model->ip = XUtils::getClientIP();
     $model->save();
 }
Beispiel #2
0
 /**
  * 后台菜单过滤
  *
  */
 public static function filterMenu($append = ',home,home_index')
 {
     $session = new XSession();
     $admini = $session->get('_admini');
     $groupId = $admini['groupId'];
     if ($groupId != 1) {
         $aclModel = AdminGroup::model()->findByPk($groupId);
         $acl = $aclModel->acl . $append;
         $aclArr = explode(',', $acl);
         foreach (self::$aclList as $k => $r) {
             if (!in_array($r['acl'], $aclArr)) {
                 unset(self::$aclList[$k]);
             } else {
                 self::$aclList[$k]['url'] = self::_parentRouter($k, $aclArr);
                 foreach ($r['action'] as $kk => $rr) {
                     if (!in_array($rr['acl'], explode(',', $acl))) {
                         unset(self::$aclList[$k]['action'][$kk]);
                     }
                 }
             }
         }
     }
     return self::$aclList;
 }