Exemplo n.º 1
0
 public function handle_request()
 {
     //当前菜单
     $itemCode = $this->get_item_code();
     $userId = $this->get_user_id();
     //检查登录者信息是否保存,不保存则保存值数据库中
     $this->_check_user_info($userId);
     $params = $this->getParam();
     //城市设置
     $this->_check_city_set($params);
     $this->setAttribute("itemCode_" . $userId, $itemCode);
     //当前登录者名称
     $userName = $this->get_user_name();
     $this->setAttribute("userName_" . $userId, $userName);
     if (!$this->enable_anonymous()) {
         //需要验证权限
         if (!$this->_check_authority($itemCode, $selfMenuArr, $userlevel)) {
             //无权限访问
             //return 'Error_HTTP404';
             return $this->handle_request_internel();
         }
     } else {
         //不需要验证权限,一般用于ajax处理或者无页面返回或者一些针对所有人开放的功能
         $userinfo = $this->_userInfo;
         $this->userlevel = $userlevel = $userinfo['level'];
         $selfMenuArr = Bll_Authority::get_all_menus_by_group_id($userinfo['group_id']);
         $selfMenu = Bll_Menus::init_menus_arr($selfMenuArr);
         $isSupperMan = intval($userlevel) == Const_Cms::CMS_USER_LEVEL_SUPPER ? true : false;
         //标记系统设置是否需要展示
         if ($isSupperMan || in_array('G004', $selfMenu)) {
             $this->setAttribute('system_show_' . $this->get_user_id(), true);
         }
     }
     $siJiMenusId = $deepth = 0;
     //当前账号菜单信息
     if ($this->open_left_menus() && $itemCode) {
         //加了左侧菜单
         $menusInfo = Bll_Menus::init_user_menus($itemCode, $selfMenuArr, $userlevel, $siJiMenusId, $deepth, $this->current_item, $this->total_item);
         $this->setAttribute("menusInfo_" . $userId, $menusInfo);
     }
     $this->setAttribute("open_left_menus_" . $userId, $this->open_left_menus());
     $this->setAttribute("open_top_menus_" . $userId, $this->open_top_menus());
     //更新用户最近使用菜单
     Bll_UserUsedLog::replace_user_menus_log($userId, $siJiMenusId, $deepth, $this->nowTime);
     //记录用户菜单使用日志
     Bll_UserMenusUsedLog::insert_user_used_menus_info($userId, $userName, $siJiMenusId, $deepth, $this->request->get_client_ip(), $this->nowTime);
     return $this->handle_request_internel();
 }