hxp
2024-10-31 402ed2e6a90a785d2fce3eca23cd324f350d54c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?php
include_once '/Common/ConfigReader.php';
include_once "/Common/Logging.php";
include_once "/Account/User.php";
include_once "/language/lang.php";
 
\CommFunc\SessionStart();
\Logging\CreateLogging("index.php");
\Logging\LogInfo("_SESSION: " . print_r($_SESSION, true));
 
$server_id = "";
$UserAccount = "";
 
if (!empty($_SESSION)) {
    $server_id = $_SESSION['server_id'];
    $UserAccount = $_SESSION['UserAccount'];
}
 
if (!$UserAccount) {
    \Logging\LogInfo("未登录,跳转登录!");
    header("location:/Account/login.php");
    return;
}
 
if (!$server_id) {
    \Logging\LogInfo("未选服,跳转选服!");
    header("location:/Account/Server/SelectServer.php");
    return;
}
 
// 加载用户配置
\Logging\LogInfo("加载用户信息.");
$user = new \User\User($UserAccount);
\Logging\LogInfo("用户账号: " . $UserAccount);
 
$permissions = $user->GetUserPermissions();
\Logging\LogInfo("权限表: " . print_r($permissions, true));
 
$gmtMenu = array(
    \Lang\gettext("报表") => array(
        array(\User\Permission::P_REP_AllView, "serverrep/allview.php", \Lang\gettext("全服总览")),
        array(\User\Permission::P_REP_DailyUser, "serverrep/dailyuser.php", \Lang\gettext("全服每日用户")),
        array(\User\Permission::P_REP_KeepLogin, "serverrep/keeplogin.php", \Lang\gettext("全服留存")),
        array(\User\Permission::P_REP_LTV, "serverrep/ltv.php", \Lang\gettext("全服LTV")),
    ),
 
    \Lang\gettext("服务器") => array(
        array(\User\Permission::P_Online, "serverinfo/online.php", \Lang\gettext("在线人数")),
        array(\User\Permission::P_PlayerLV, "serverinfo/playerlv.php", \Lang\gettext("等级分布")),
        array(\User\Permission::P_Chatmonitor, "serverinfo/chatmonitor.php", \Lang\gettext("聊天监控"), "_blank"),
        array(\User\Permission::P_BugReport, "serverinfo/BugReportMain.php", \Lang\gettext("Bug反馈")),
        array(\User\Permission::P_PayOverview, "serverinfo/payoverview.php", \Lang\gettext("充值总览")),
        array(\User\Permission::P_PayOrder, "serverinfo/payorderlist.php", \Lang\gettext("充值订单")),
        array(\User\Permission::P_PayRank, "serverinfo/payrank.php", \Lang\gettext("充值排行")),
        array(\User\Permission::P_CTGReportAll, "serverinfo/ctgreportall.php", \Lang\gettext("充值分析")),
        array(\User\Permission::P_PlayerList, "serverinfo/playerlist.php", \Lang\gettext("玩家列表")),
    ),
 
    \Lang\gettext("普通命令") => array(
        array(\User\Permission::P_BroadCast, "GMToolClient/sendSysMsg.php", \Lang\gettext("广播")),
        array(\User\Permission::P_BroadCastMulti, "GMToolClient/SendSysMsgByServerName.php", \Lang\gettext("多服广播")),
        array(\User\Permission::P_ClearTalkCache, "GMToolClient/ClearTalkCache.php", \Lang\gettext("清空聊天缓存")),
        array(\User\Permission::P_ForbidTalk, "GMToolClient/forbidTalk.php", \Lang\gettext("禁言/解禁")),
        array(\User\Permission::P_ForbidLogin, "GMToolClient/forbidLogin.php", \Lang\gettext("封号/解封")),
        array(\User\Permission::P_KickPlayer, "GMToolClient/kickPlayer.php", \Lang\gettext("踢下线")),
        array(\User\Permission::P_GetPlayerForbid, "GMToolClient/queryPunishInfo.php", \Lang\gettext("查询玩家封禁状态")),
        array(\User\Permission::P_GetForbidInfo, "GMToolClient/queryServerPunishInfo.php", \Lang\gettext("查询全服封禁名单")),
        array(\User\Permission::P_GetPlayerInfo, "GMToolClient/queryPlayerInfo.php", \Lang\gettext("查询玩家")),
        array(\User\Permission::P_GetFamilyInfo, "GMToolClient/queryFamilyInfo.php", \Lang\gettext("查询仙盟")),
        array(\User\Permission::P_FamilyTransfer, "GMToolClient/familyTransfer.php", \Lang\gettext("转让仙盟")),
        array(\User\Permission::P_FamilyDismiss, "GMToolClient/familyDismiss.php", \Lang\gettext("解散仙盟")),
        array(\User\Permission::P_QueryBillboard, "serverinfo/billboardhis.php", \Lang\gettext("查询历史排行榜")),
        array(\User\Permission::P_QueryBillboard, "GMToolClient/queryBillboard.php", \Lang\gettext("查询实时排行榜")),
        array(\User\Permission::P_QueryBillboardCross, "serverinfo/billboardhiscross.php", \Lang\gettext("查询跨服历史榜")),
        array(\User\Permission::P_QueryBillboardCross, "GMToolClient/queryBillboardCross.php", \Lang\gettext("查询跨服排行榜")),
        array(\User\Permission::P_MagicWeaponExp, "GMToolClient/magicWeaponExp.php", \Lang\gettext("法宝灵魂")),
    ),
 
    \Lang\gettext("高级命令") => array(
        array(\User\Permission::P_DREntry, "SuperGMToolClient/QueryEventData.php", \Lang\gettext("流向查询")),
        array(\User\Permission::P_CTGReq, "SuperGMToolClient/CTG.php", \Lang\gettext("CTG充值")),
        array(\User\Permission::P_ServerMailSend, "SuperGMToolClient/AddEntireCompensation.php", \Lang\gettext("全服邮件")),
        array(\User\Permission::P_ServerMailMgr, "SuperGMToolClient/CompensationQuery.php", \Lang\gettext("全服邮件管理")),
        array(\User\Permission::P_PersonalMailSend, "SuperGMToolClient/AddPersonalCompensation.php", \Lang\gettext("个人邮件")),
        array(\User\Permission::P_PersonalMailMgr, "SuperGMToolClient/CompensationQueryPersonal.php", \Lang\gettext("个人邮件管理")),
        array(\User\Permission::P_AddPayCoin, "SuperGMToolClient/AddPayCoin.php", \Lang\gettext("发放代币")),
        array(\User\Permission::P_DelPlayerMoney, "SuperGMToolClient/DelPlayerMoney.php", \Lang\gettext("扣除玩家货币")),
        array(\User\Permission::P_DelPlayerItem, "SuperGMToolClient/DelPlayerItem.php", \Lang\gettext("扣除玩家物品")),
        array(\User\Permission::P_Face, "SuperGMToolClient/Face.php", \Lang\gettext("头像管理")),
        array(\User\Permission::P_AddTitle, "SuperGMToolClient/AddTitle.php", \Lang\gettext("称号管理")),
        array(\User\Permission::P_Worship, "SuperGMToolClient/Worship.php", \Lang\gettext("膜拜管理")),
        array(\User\Permission::P_SetGMLevel, "SuperGMToolClient/SetGMLevel.php", \Lang\gettext("设置玩家GM")),
        array(\User\Permission::P_AddAuctionItem, "SuperGMToolClient/AddAuctionItem.php", \Lang\gettext("上架拍品")),
        array(\User\Permission::P_RefixWorldLV, "SuperGMToolClient/RefixWorldLV.php", \Lang\gettext("纠正世界等级")),
        // array(\User\Permission::GMT_FreshmanGuide, "SuperGMToolClient/freshmanGuide.html", \Lang\gettext("新手指导员")),
        array(\User\Permission::P_BourseOnOff, "SuperGMToolClient/BourseOnOff.php", \Lang\gettext("交易所开关")),
        array(\User\Permission::P_CrossActServerIDChange, "SuperGMToolClient/CrossActServerIDChange.php", \Lang\gettext("跨服活动区服ID修改")),
        array(\User\Permission::P_CrossBattleChampionSet, "SuperGMToolClient/CrossBattleChampionSet.php", \Lang\gettext("跨服战场冠军赛")),
        array(\User\Permission::P_Execfile, "SuperGMToolClient/Execfile.php", \Lang\gettext("执行命令")),
    ),
 
    "运维管理" => array(
        array(\User\Permission::P_OPSPackBranch, "serverops/packBranch.php", "打包分支管理"),
        array(\User\Permission::P_OPSGameVersion, "serverops/gameVersion.php", "内容版本管理"),
        array(\User\Permission::P_OPSServerList, "serverops/serverlist.php", "服务器列表"),
        array(\User\Permission::P_OPSServerStateMgr, "serverops/serverstatemgr.php", "服务器状态管理"),
        // array(\User\Permission::P_SetOpenServerTime, "SuperGMToolClient/SetOpenServerTime.php", \Lang\gettext("设置开服时间")),
        array(\User\Permission::P_CrossServerMaintain, "SuperGMToolClient/CrossServerMaintain.php", \Lang\gettext("跨服主服维护")),
        array(\User\Permission::P_CrossClientServerMaintain, "SuperGMToolClient/CrossClientServerMaintain.php", \Lang\gettext("跨服子服维护")),
    ),
 
    \Lang\gettext("账号权限") => array(
        array(\User\Permission::P_PermissionGroup, "Account/pergroup.php", \Lang\gettext("权限分组")),
        array(\User\Permission::P_UserMgr, "Account/userlist.php", \Lang\gettext("账号管理")),
    ),
 
    "系统" => array(
        array(\User\Permission::P_System, "db/struct.php", \Lang\gettext("刷新表")),
    )
);
 
$gameName = \CommFunc\GetGameName();
$serversArray = $user->GetServers();
?>
 
<html>
 
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title><?php echo \Lang\gettext("GM命令工具"); ?></title>
    <link rel="stylesheet" href="css/index.css" media="screen" type="text/css" />
    <link rel="stylesheet" href="css/menu.css" media="screen" type="text/css" />
</head>
 
<body>
    <table class="top">
        <tr>
            <td class="secondworld">
                第二世界
            </td>
            <td class="curserver">
                <?php
                echo "[" . $gameName . "." . $user->GetSPID() . "] " . $server_id;
                ?>
                <?php
                echo "<b><font color=\"#FF0000\">";
                if ($serversArray[$server_id]["MixServerStr"]) {
                    echo \Lang\gettext("已合服") . " [" . $serversArray[$server_id]["MixServerStr"] . "]";
                    if ($serversArray[$server_id]["MainServer"]) {
                        echo ", " . \Lang\gettext("所属主服") . ": " . $serversArray[$server_id]["MainServer"];
                    } else {
                        echo ", " . \Lang\gettext("本服为主服");
                    }
                } else {
                    echo " " . \Lang\gettext("未合服");
                }
                echo "</font></b>";
                echo "&nbsp;&nbsp;";
                ?>
                <a href="/Account/Server/SelectServer.php"><?php echo " " . \Lang\gettext("切换"); ?></a>
                <?php
                if (in_array(\User\Permission::P_UserLog, $permissions)) {
                    echo "&nbsp;&nbsp;";
                    echo "<a href=\"/Account/userlog.php\" target=\"iframe\">" . \Lang\gettext("操作动态") . "</a>";
                }
                ?>
            </td>
            <td class="user">
                <?php
                if ($user->GetAttr("UserLV") != \User\UserLV::COMM) {
                    echo "[", \User\UserLV::LVNameInfo()[$user->GetAttr("UserLV")], "]&nbsp;&nbsp;";
                }
                ?>
                <span title="<?php echo $user->GetAttr("Organization"); ?>"><?php echo $UserAccount; ?></span>
                |&nbsp;&nbsp;<a href="/Account/login.php"><?php echo \Lang\gettext("退出"); ?></a>
                &nbsp;&nbsp;<?php \Lang\showSelectLang(); ?>
            </td>
        </tr>
    </table>
    <div class="left">
        <div class="menucontainer">
            <ul>
                <?php
                foreach ($gmtMenu as $menuGroupName => $menuArray) {
                    $showGroupState = 0;
                    $havePermission = False;
                    foreach ($menuArray as $value) {
                        if (!in_array($value[0], $permissions)) {
                            continue;
                        }
                        $havePermission = True;
                        if ($showGroupState == 0) {
                            $showGroupState = 1;
                            echo "<li class=\"dropdown\">";
                            echo "<a href=\"\" data-toggle=\"dropdown\">" . $menuGroupName . " <i class=\"icon-arrow\"></i></a>";
                            echo "<ul class=\"dropdown-menu\">";
                        }
                        echo "<li><a href=\"" . $value[1] . "\" target=\"" . ($value[3] != "" ? $value[2] : "iframe") . "\">" . $value[2] . "</a></li>";
                    }
 
                    if ($havePermission) {
                        echo "</ul>";
                        echo "</li>";
                    }
                }
                ?>
            </ul>
        </div>
    </div>
    <div class="right">
        <iframe id="iframe" name="iframe" allowTransparency="true" frameborder="0"></iframe>
    </div>
 
    <script src="js/menu.js"></script>
</body>
 
</html>