All Data Structures Namespaces Files Functions Variables Pages
admin.php
Go to the documentation of this file.
<?php
define('CURSCRIPT', 'admin');
require './include/common.inc.php';
define('IN_ADMIN', TRUE);
require GAME_ROOT.'./gamedata/admincfg.php';
require GAME_ROOT.'./include/admin/admin.lang.php';
$admin_cmd_list = Array(
'configmng' => 9,
'systemmng' => 7,
'gamecfgmng' => 7,
'gmlist' => 9,
'urlist' => 6,
'banlistmng' => 6,
'gamecheck' => 2,
'pcmng' => 5,
'npcmng' => 5,
'gameinfomng' => 5,
'antiAFKmng' => 4,
);
if(!$cuser||!$cpass) { gexit($_ERROR['no_login'],__file__,__line__); }
$result = $db->query("SELECT * FROM {$tablepre}users WHERE username='$cuser'");
if(!$db->num_rows($result)) { gexit($_ERROR['login_check'],__file__,__line__); }
$udata = $db->fetch_array($result);
if($udata['password'] != $cpass) { gexit($_ERROR['wrong_pw'], __file__, __line__); }
elseif(($udata['groupid'] <= 1)&&($cuser!==$gamefounder)) { gexit($_ERROR['no_admin'], __file__, __line__); }
if($cuser===$gamefounder){$mygroup=10;}
else{$mygroup = $udata['groupid'];}
$showdata = $cmd_info = false;
if($mode == 'admin_menu' && in_array($command, array_keys($admin_cmd_list))) {//进入子菜单的指令
if($mygroup >= $admin_cmd_list[$command]){
include_once GAME_ROOT."./include/admin/{$command}.php";
$showdata = ob_get_contents();
}else{
$cmd_info = $_ERROR['no_power'];
}
} elseif(in_array($mode, array_keys($admin_cmd_list))) {//子菜单内指令
if($mygroup >= $admin_cmd_list[$mode]){
include_once GAME_ROOT."./include/admin/{$mode}.php";
$showdata = ob_get_contents();
}else{
$cmd_info = $_ERROR['no_power'];
}
} elseif(!empty($mode)) {
$cmd_info = $_ERROR['wrong_adcmd'];
}
ob_clean();
include template('admin');
ob_end_flush();
function adminlog($op,$an1='',$an2='',$an3=''){
global $now,$cuser;
$alfile = GAME_ROOT.'./gamedata/adminlog.php';
if($op){
$aldata = "$now,$cuser,$op,$an1,$an2,$an3,\n";
writeover($alfile,$aldata,'ab+');
}
return;
}
function getstart($start = 0,$mode = ''){
global $showlimit;
$start = (int)$start;
if($mode == 'up') {
$start -= $showlimit;
$start = $start <= 0 ? 0 : $start;
} elseif($mode == 'down') {
$start += $showlimit;
} elseif($mode == 'ref') {
$start = 0;
} else {
$start = $start ? $start : 0;
}
return $start;
}
function setconfig($string) {
if(!get_magic_quotes_gpc()) {
$string = str_replace('\'', '\\\'', $string);
} else {
$string = str_replace('\"', '"', $string);
}
return $string;
}
function astrfilter($str) {
if(is_array($str)) {
foreach($str as $key => $val) {
$str[$key] = astrfilter($val);
}
} else {
$str = str_replace(Array('eval',';',"'"),'',$str);//屏蔽会造成困扰的关键字;
}
return $str;
}
?>
$cmd_info
while($gm=$db->fetch_array($result)) $cmd_info
Definition: gmlist.php:10
getstart
getstart($start=0, $mode= '')
Definition: admin.php:67
writeover
writeover($filename, $data, $method="rb+", $iflock=1, $check=1, $chmod=1)
Definition: global.func.php:155
$admin_cmd_list
$admin_cmd_list
Definition: admin.php:10
setconfig
setconfig($string)
Definition: admin.php:82
$db
$db
Definition: clear.php:32
elseif
【生存者数：<?php echo $alivenum?> 人】< input type="button"value="显示全部幸存者"onClick="$('alivemode').value='all';$('gbmode').value='none';postCmd('alive','alive.php');"></p > if($gamblingon &&$gamestate >=20) elseif($gamblingon &&$gamestate<=10)
Definition: 1_alive.tpl.php:18
$gamefounder
$gamefounder
Definition: config.inc.php:43
GAME_ROOT
const GAME_ROOT
Definition: clear.php:6
$now
$now
Definition: clear.php:23
$_ERROR
$_ERROR
Definition: resources_1.php:1044
$showdata
$showdata
Definition: admin.php:34
gexit
gexit($message= '', $file= '', $line=0)
Definition: global.func.php:30
astrfilter
astrfilter($str)
Definition: admin.php:91
$udata
if(!$db->num_rows($result)) $udata
Definition: admin.php:27
$result
if(!$cuser||!$cpass) $result
Definition: admin.php:25
$cpass
$cpass
Definition: common.inc.php:207
adminlog
adminlog($op, $an1='', $an2='', $an3='')
Definition: admin.php:58
$start
$start
Definition: npcmng.php:12
$showlimit
$showlimit
Definition: admincfg.php:4