Account/User.php
@@ -19,6 +19,18 @@
   if (!isset($PermissionModules)) {
      $PermissionModules = array(
         array(
            "ModuleID" => "ServerRep",
            "Name" => \Lang\gettext("全服报表"),
            "PList" => array(
               Permission::P_REP_AllView => array("Name" => \Lang\gettext("全服总览")),
               Permission::P_REP_DailyUser => array("Name" => \Lang\gettext("全服每日用户")),
               Permission::P_REP_KeepLogin => array("Name" => \Lang\gettext("全服留存")),
               Permission::P_REP_LTV => array("Name" => \Lang\gettext("全服LTV")),
               Permission::P_REP_FirstLoginFirstPayCnt => array("Name" => \Lang\gettext("首登首充人数")),
               Permission::P_REP_XPayPaycnt => array("Name" => \Lang\gettext("购买X礼包再付人数")),
            )
         ),
         array(
            "ModuleID" => "ServerInfo",
            "Name" => \Lang\gettext("服务器"),
            "PList" => array(
@@ -26,6 +38,7 @@
               Permission::P_PlayerLV => array("Name" => \Lang\gettext("等级分布")),
               Permission::P_Chatmonitor => array("Name" => \Lang\gettext("聊天监控")),
               Permission::P_BugReport => array("Name" => \Lang\gettext("Bug反馈")),
               Permission::P_Serverview => array("Name" => \Lang\gettext("本服总览")),
               Permission::P_PayOverview => array("Name" => \Lang\gettext("充值总览")),
               Permission::P_PayOrder => array("Name" => \Lang\gettext("充值订单")),
               Permission::P_PayRank => array("Name" => \Lang\gettext("充值排行")),
@@ -75,6 +88,7 @@
               Permission::P_DelPlayerMoney => array("Name" => \Lang\gettext("扣除玩家货币"), "GMTKey2" => array("GMT_DelPlayerMoney"), "Log" => array("GMT_DelPlayerMoney")),
               Permission::P_DelPlayerItem => array("Name" => \Lang\gettext("扣除玩家物品"), "GMTKey2" => array("GMT_DelPlayerItem"), "Log" => array("GMT_DelPlayerItem")),
               Permission::P_SetGMLevel => array("Name" => \Lang\gettext("设置玩家GM"), "GMTKey2" => array("GMT_SetGMLevel"), "Log" => array("GMT_SetGMLevel")),
               Permission::P_Face => array("Name" => \Lang\gettext("头像管理"), "GMTKey2" => array("GMT_Face"), "Log" => array("GMT_Face")),
               Permission::P_AddTitle => array("Name" => \Lang\gettext("称号管理"), "GMTKey2" => array("GMT_AddTitle"), "Log" => array("GMT_AddTitle")),
               Permission::P_Worship => array("Name" => \Lang\gettext("膜拜管理"), "GMTKey2" => array("GMT_Worship")),
               Permission::P_AddAuctionItem => array("Name" => \Lang\gettext("上架拍品"), "GMTKey2" => array("GMT_AddAuctionItem")),
@@ -145,6 +159,7 @@
            "Name" => \Lang\gettext("运维管理"),
            "PList" => array(
               Permission::P_OPSPackBranch => array("Name" => \Lang\gettext("打包分支管理")),
               Permission::P_OPSVersionState => array("Name" => \Lang\gettext("版本状态管理")),
               Permission::P_OPSGameVersion  => array("Name" => \Lang\gettext("内容版本管理")),
               Permission::P_OPSServerList  => array("Name" => \Lang\gettext("服务器列表")),
               Permission::P_OPSServerStateMgr  => array("Name" => \Lang\gettext("服务器状态管理"), "Log" => array("1")),
@@ -152,6 +167,7 @@
               Permission::P_SetOpenServerTime => array("Name" => \Lang\gettext("设置开服时间"), "GMTKey2" => array("GMT_SetOpenServerTime")),
               Permission::P_CrossServerMaintain => array("Name" => \Lang\gettext("跨服主服维护"), "GMTKey2" => array("GMT_CrossServerMaintain")),
               Permission::P_CrossClientServerMaintain => array("Name" => \Lang\gettext("跨服子服维护"), "GMTKey2" => array("GMT_CrossClientServerMaintain")),
               Permission::P_VersionLog  => array("Name" => \Lang\gettext("版本更新日志")),
            )
         ),
         array(
@@ -196,11 +212,20 @@
   const GroupAdmin = "admin";
   const P_System = "P_System";
   //全服报表
   const P_REP_AllView = "P_REP_AllView";
   const P_REP_DailyUser = "P_REP_DailyUser";
   const P_REP_KeepLogin = "P_REP_KeepLogin";
   const P_REP_LTV = "P_REP_LTV";
   const P_REP_FirstLoginFirstPayCnt = "P_REP_FirstLoginFirstPayCnt";
   const P_REP_XPayPaycnt = "P_REP_XPayPaycnt";
   //服务器
   const P_Online = "P_Online";
   const P_PlayerLV = "P_PlayerLV";
   const P_Chatmonitor = "P_Chatmonitor";
   const P_BugReport = "P_BugReport";
   const P_Serverview = "P_Serverview";
   const P_PayOverview = "P_PayOverview";
   const P_PayOrder = "P_PayOrder";
   const P_PayRank = "P_PayRank";
@@ -234,6 +259,7 @@
   const P_DelPlayerItem = "P_DelPlayerItem";
   const P_SetGMLevel = "P_SetGMLevel";
   const P_AddTitle = "P_AddTitle";
   const P_Face = "P_Face";
   const P_Worship = "P_Worship";
   const P_AddAuctionItem = "P_AddAuctionItem";
   const P_RefixWorldLV = "P_RefixWorldLV";
@@ -273,6 +299,7 @@
   //运维权限
   const P_OPSPackBranch = "P_OPSPackBranch";
   const P_OPSVersionState = "P_OPSVersionState";
   const P_OPSGameVersion = "P_OPSGameVersion";
   const P_OPSServerList = "P_OPSServerList";
   const P_OPSServerStateMgr = "P_OPSServerStateMgr";
@@ -280,6 +307,7 @@
   const P_SetOpenServerTime = "P_SetOpenServerTime";
   const P_CrossServerMaintain = "P_CrossServerMaintain";
   const P_CrossClientServerMaintain = "P_CrossClientServerMaintain";
   const P_VersionLog = "P_VersionLog";
   //===================== 账号管理权限 =======================
   /**权限分组 */
@@ -378,11 +406,30 @@
   }
   //根据指定的spid获取对应服务器列表配置
   public function GetServersCfg($spid)
   public function GetServersCfg($spid, $checkSpecial = true)
   {
      $ConfigFile = dirname(__FILE__) . "\Server\Server_" . $spid . ".ini";
      if (file_exists($ConfigFile)) {
         return parse_ini_file($ConfigFile, true);
         $serversCfg = parse_ini_file($ConfigFile, true);
         if (!$checkSpecial) {
            return $serversCfg;
         }
         $UserAccount = $this->userData["UserAccount"];
         \CommFunc\GetConfig("ServerInfo", "SpecialServerIDStart", $SpecialServerIDStart);
         \CommFunc\GetConfig("ServerInfo", "SpecialAccountList", $SpecialAccountList);
         $SpecialAccountList = explode(",", $SpecialAccountList);
         $SpecialServerIDStart = intval($SpecialServerIDStart);
         // 特殊账号,只能看指定服及以上
         if (in_array($UserAccount, $SpecialAccountList)) {
            foreach ($serversCfg as $key => $info) {
               $ServerID = intval($info["ServerID"]);
               if ($ServerID < $SpecialServerIDStart) {
                  unset($serversCfg[$key]);
               }
            }
            return $serversCfg;
         }
         return $serversCfg;
      }
      if ($spid) {
         echo "file is not exist: " . "Server_" . $spid . ".ini" . "<br/>";
@@ -403,11 +450,29 @@
         return $this->serversArray;
      }
      $spid = $this->GetSPID();
      $serversCfg = $this->GetServersCfg($spid);
      $serversCfg = $this->GetServersCfg($spid, false);
      if (!count($serversCfg)) {
         return $serversCfg;
      }
      $this->serversArray = $serversCfg;
      $UserAccount = $this->userData["UserAccount"];
      \CommFunc\GetConfig("ServerInfo", "SpecialServerIDStart", $SpecialServerIDStart);
      \CommFunc\GetConfig("ServerInfo", "SpecialAccountList", $SpecialAccountList);
      $SpecialAccountList = explode(",", $SpecialAccountList);
      $SpecialServerIDStart = intval($SpecialServerIDStart);
      $isSpecialUser = in_array($UserAccount, $SpecialAccountList);
      $specialServerID = 270; // 270服特殊处理,被合到270以前的服了
      $specialMainServerID = 0; // 特殊服所属主服
      if ($isSpecialUser) {
         foreach ($serversCfg as $info) {
            $ServerID = intval($info["ServerID"]);
            if ($ServerID == $specialServerID && $info["MainServer"]) {
               $specialMainServerID = intval($info["MainServer"]);
               break;
            }
         }
      }
      # 统计合服列表
      $mixServerArray = array();
@@ -423,6 +488,13 @@
            $mixServerArray[$mainServerID] = array("MixServerIDList" => array(), "MixServerStr" => "");
         }
         array_push($mixServerArray[$mainServerID]["MixServerIDList"], intval($serverInfo["ServerID"]));
      }
      if ($isSpecialUser) {
         if ($specialMainServerID) {
            // 特殊服只显示这两个服
            $mixServerArray[$specialMainServerID] = array("MixServerIDList" => array($specialMainServerID, $specialServerID), "MixServerStr" => "");
         }
      }
      # 翻译合服字符串信息
@@ -476,6 +548,16 @@
         $this->serversArray[$serverName]["MixServerIDList"] = $mixServerInfo["MixServerIDList"];
         $this->serversArray[$serverName]["MixServerStr"] = $mixServerInfo["MixServerStr"];
      }
      // 特殊账号,只能看指定服及以上
      if ($isSpecialUser) {
         foreach ($this->serversArray as $key => $info) {
            $serverID = intval($info["ServerID"]);
            if ($serverID < $SpecialServerIDStart && $serverID != $specialMainServerID) {
               unset($this->serversArray[$key]);
            }
         }
      }
      return $this->serversArray;
   }