📄 global.php
字号:
<?php
error_reporting(7);
if (isset($HTTP_GET_VARS['explain']) OR isset($HTTP_POST_VARS['explain'])) {
$showqueries = 1;
$explain = 1;
}
if (isset($HTTP_GET_VARS['showqueries']) OR isset($HTTP_POST_VARS['showqueries']) or isset($showqueries)) {
$showqueries = 1;
$pagestarttime = microtime();
} else {
$pagestarttime = 0;
}
$incp=1;
// allow script to work with registerglobals off
if ( function_exists('ini_get') ) {
$onoff = ini_get('register_globals');
} else {
$onoff = get_cfg_var('register_globals');
}
if ($onoff != 1) {
@extract($HTTP_SERVER_VARS, EXTR_SKIP);
@extract($HTTP_COOKIE_VARS, EXTR_SKIP);
@extract($HTTP_POST_FILES, EXTR_SKIP);
@extract($HTTP_POST_VARS, EXTR_SKIP);
@extract($HTTP_GET_VARS, EXTR_SKIP);
@extract($HTTP_ENV_VARS, EXTR_SKIP);
}
// get rid of slashes in get / post / cookie data
function stripslashesarray (&$arr) {
while (list($key,$val)=each($arr)) {
if ((strtoupper($key)!=$key or "".intval($key)=="$key") and $key!="templatesused" and $key!="argc" and $key!="argv") {
if (is_string($val)) {
$arr[$key]=stripslashes($val);
}
if (is_array($val)) {
$arr[$key]=stripslashesarray($val);
}
}
}
return $arr;
}
if (get_magic_quotes_gpc() and is_array($GLOBALS)) {
// variables created from attachments aren't escaped properly it seems...
if (isset($attachment)) $GLOBALS['attachment'] = addslashes($GLOBALS['attachment']);
if (isset($avatarfile)) $GLOBALS['avatarfile'] = addslashes($GLOBALS['avatarfile']);
if (isset($iconfile)) $GLOBALS['iconfile'] = addslashes($GLOBALS['iconfile']);
if (isset($smiliefile)) $GLOBALS['smiliefile'] = addslashes($GLOBALS['smiliefile']);
if (isset($stylefile)) $GLOBALS['stylefile'] = addslashes($GLOBALS['stylefile']);
$GLOBALS = stripslashesarray($GLOBALS);
}
set_magic_quotes_runtime(0);
// version numbers:
$codeversionnumber="1.2.0 Free";
$codeinfo="";
// initialise variables
unset($urlSearchArray);
unset($urlReplaceArray);
unset($emailSearchArray);
unset($emailReplaceArray);
unset($iforumcache);
unset($ipermcache);
unset($iaccesscache);
unset($usergroupdef);
unset($noperms);
unset($usergroupcache);
unset($vars);
unset($usercache);
unset($permscache);
if ($HTTP_GET_VARS['HTTP_POST_VARS']['action'] == $HTTP_POST_VARS['action']) {
unset($HTTP_POST_VARS['action']);
}
$HTTP_POST_VARS['action'] = trim($HTTP_POST_VARS['action']);
if ($HTTP_GET_VARS['HTTP_COOKIE_VARS']['bbadminon'] == $HTTP_COOKIE_VARS['bbadminon']) {
unset($HTTP_POST_VARS['action']);
}
// ###################### Start init #######################
unset($dbservertype);
//load config
require("./config.php");
// init db **********************
// load db class
$dbservertype = strtolower($dbservertype);
$dbclassname="./db_$dbservertype.php";
require($dbclassname);
$DB_site=new DB_Sql_vb;
$DB_site->appname='[足迹]音乐系统特别版';
$DB_site->appshortname='[足迹]音乐';
$DB_site->database=$dbname;
$DB_site->server=$servername;
$DB_site->user=$dbusername;
$DB_site->password=$dbpassword;
$DB_site->connect();
$dbpassword="";
$DB_site->password="";
// end init db
// ###################### Start functions #######################
require("./functions.php");
require("./adminfunctions.php");
// ###################### Start load options #######################
$optionstemp=$DB_site->query_first("SELECT template FROM ".$table["template"]." WHERE title='options'");
eval($optionstemp[template]);
// ###################### Start headers #######################
if ($nocacheheaders and !$noheader) {
// no caching
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); // always modified
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
}
// ###################### Start sessions #######################
require("./sessions.php");
$getperms=$DB_site->query_first("SELECT *
FROM ".$table["user"].",".$table["usergroup"]."
WHERE ".$table["user"].".usergroupid=".$table["usergroup"].".usergroupid
AND ".$table["user"].".userid='$bbuserinfo[userid]'");
if ($getperms[cancontrolpanel]!=1) {
$bbuserinfo[userid]=0;
}
if ($bbuserinfo[userid]!=0 and $loginusername and !$createanonsession) {
vbsetcookie('bbadminon', 1, 0);
$HTTP_COOKIE_VARS['bbadminon']=1;
} else {
if ($bbuserinfo[userid]==0) {
$HTTP_COOKIE_VARS['bbadminon']=0;
}
}
$checkpwd=1;
if ($HTTP_COOKIE_VARS['bbadminon']==0 and $checkpwd) {
$bbuserinfo[userid]=0;
} else {
if ($bbuserinfo['userid']!=0 and $loginusername and !$createanonsession) {
setcookie("bbadminon",1,0,'/');
$HTTP_COOKIE_VARS['bbadminon']=1;
}
}
if ($bbuserinfo[userid]==0 and $checkpwd) {
cpheader("<title>论坛管理</title>");
?><br><br><br>
<table cellpadding="1" cellspacing="0" border="0" class="tblborder" align="center" width="450"><tr><td>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<?php maketableheader("请登录:","login",0,1); ?>
<tr class="firstalt" id="submitrow"><td align="center" nowrap><p>你不是一个有效的管理员或者尚未登录.</p>
<form action="../admin/index.php" method="post" id="submitrow">
<input type="hidden" name="s" value="<?php echo $session[sessionhash]; ?>">
<input type="hidden" name="action" value="login">
<input type="hidden" name="redirect" value="<?php
if ($HTTP_SERVER_VARS['REQUEST_URI']!="") {
$url = $HTTP_SERVER_VARS['REQUEST_URI'];
} else {
if ($PATH_INFO) {
$url = $PATH_INFO;
} else {
$url = $PHP_SELF;
}
if ($QUERY_STRING) {
$url .= "?$QUERY_STRING";
}
}
$url=ereg_replace("sessionhash=[a-z0-9]{32}&","",$url);
$url=ereg_replace("\\?sessionhash=[a-z0-9]{32}","",$url);
$url=ereg_replace("s=[a-z0-9]{32}&","",$url);
$url=ereg_replace("\\?s=[a-z0-9]{32}","",$url);
echo htmlspecialchars($url);
?>">
<table cellpadding="0" cellspacing="1" border="0">
<tr>
<td><input type="text" name="loginusername"></td>
<td><input type="password" name="loginpassword"></td>
<td><input type="submit" value=" 登 录 " accesskey="s"></td>
</tr>
<tr>
<td><font size="1">用户名</font></td>
<td colspan="2"><font size="1">密码</font></td>
</tr>
</table>
</form>
</td></tr></table>
</td></tr></table>
<p align="center"><font size="1"><a href="http://www.zjstudio.org" target="_blank">[足迹]音乐系统特别版 v<?php echo $codeversionnumber ?></a> 管理员控制面板</font></p>
<?php
cpfooter();
exit;
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -