<?php
header('Content-Type: text/html; charset=utf-8');
/**********************************/
/* */
/* 孤雨在线文件管理系统 V1.2 */
/* GIDC_FileManager V1.2 */
/* */
/* 原创作者:孤雨 */
/* http://www.gidc.me */
/* http://www.guyusoftware.com */
/* */
/* 汉化并优化程序内部结构 */
/* 修复目录下有文件无法删除的问题 */
/* 优化并修复出错的查看文件组件 */
/* 实现在线解压压缩Zip文件的功能 */
/* 实现从其他网址远程上传的功能 */
/* 实现自杀功能避免被第三方滥用 */
/* 实现全站打包的功能 */
/* 实现数据库本地备份功能 */
/* 实现远程上传到其他FTP的功能 */
/* 添加自杀功能 */
/* 优化用户体验 */
/* 源自:osfm Static */
/* */
/**********************************/
/**********************************/
/* 设置说明 */
/* */
/* $adminfile - 文件名. */
/* $sitetitle - 系统名称. */
/* $filefolder - 管理目录. */
/* $user - 用户名 */
/* $pass - 密码 */
/* $tbcolor1 - 未知 */
/* $tbcolor2 - 列表内容背景 */
/* $tbcolor3 - 列表头背景. */
/* $bgcolor1 - 页面背景. */
/* $bgcolor2 - 外框颜色. */
/* $bgcolor3 - 按钮和框内内容. */
/* $txtcolor1 - 文本与划过链接 */
/* $txtcolor2 - 链接. */
/**********************************/
$adminfile = $SCRIPT_NAME;
$tbcolor1 = "#bacaee";
$tbcolor2 = "#daeaff";
$tbcolor3 = "#7080dd";
$bgcolor1 = "#ffffff";
$bgcolor2 = "#a6a6a6";
$bgcolor3 = "#003399";
$txtcolor1 = "#000000";
$txtcolor2 = "#003399";
$filefolder = "./";
$sitetitle = '孤雨在线文件管理系统';
$user = 'admin';
$pass = 'admin';
$meurl = $_SERVER['PHP_SELF'];
$me = end(explode('/',$meurl));
$op = $_REQUEST['op'];
$folder = $_REQUEST['folder'];
while (preg_match('/\.\.\//',$folder)) $folder = preg_replace('/\.\.\//','/',$folder);
while (preg_match('/\/\//',$folder)) $folder = preg_replace('/\/\//','/',$folder);
if ($folder == '') {
$folder = $filefolder;
} elseif ($filefolder != '') {
if (!ereg($filefolder,$folder)) {
$folder = $filefolder;
}
}
/****************************************************************/
/* User identification */
/* */
/* Looks for cookies. Yum. */
/****************************************************************/
if ($_COOKIE['user'] != $user || $_COOKIE['pass'] != md5($pass)) {
if ($_REQUEST['user'] == $user && $_REQUEST['pass'] == $pass) {
setcookie('user',$user,time()+60*60*24*1);
setcookie('pass',md5($pass),time()+60*60*24*1);
} else {
if ($_REQUEST['user'] == $user || $_REQUEST['pass']) $er = true;
login($er);
}
}
/****************************************************************/
/* function maintop() */
/* */
/* Controls the style and look of the site. */
/* Recieves $title and displayes it in the title and top. */
/****************************************************************/
function maintop($title,$showtop = true) {
global $me,$sitetitle, $lastsess, $login, $viewing, $iftop, $bgcolor1, $bgcolor2, $bgcolor3, $txtcolor1, $txtcolor2, $user, $pass, $password, $debug, $issuper;
echo "<html>\n<head>\n"
."<title>$sitetitle :: $title</title>\n"
."</head>\n"
."<body bgcolor=\"#ffffff\">\n"
."<style>\n"
."td { font-size : 80%;font-family : tahoma;color: $txtcolor1;font-weight: 700;}\n"
."A:visited {color: \"$txtcolor2\";font-weight: bold;text-decoration: underline;}\n"
."A:hover {color: \"$txtcolor1\";font-weight: bold;text-decoration: underline;}\n"
."A:link {color: \"$txtcolor2\";font-weight: bold;text-decoration: underline;}\n"
."A:active {color: \"$bgcolor2\";font-weight: bold;text-decoration: underline;}\n"
."textarea {border: 1px solid $bgcolor3 ;color: black;background-color: white;}\n"
."input.button{border: 1px solid $bgcolor3;color: black;background-color: white;}\n"
."input.text{border: 1px solid $bgcolor3;color: black;background-color: white;}\n"
."BODY {color: $txtcolor1; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma, Verdana, Arial, Helvetica, sans-serif; scrollbar-base-color: $bgcolor2; MARGIN: 0px 0px 10px; BACKGROUND-COLOR: $bgcolor1}\n"
.".title {FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: #000000; TEXT-ALIGN: center; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif}\n"
.".copyright {FONT-SIZE: 8pt; COLOR: #000000; TEXT-ALIGN: left}\n"
.".error {FONT-SIZE: 10pt; COLOR: #AA2222; TEXT-ALIGN: left}\n"
."</style>\n\n";
if ($viewing == "") {
echo "<table cellpadding=10 cellspacing=10 bgcolor=$bgcolor1 align=center><tr><td>\n"
."<table cellpadding=1 cellspacing=1 bgcolor=$bgcolor2><tr><td>\n"
."<table cellpadding=5 cellspacing=5 bgcolor=$bgcolor1><tr><td>\n";
} else {
echo "<table cellpadding=7 cellspacing=7 bgcolor=$bgcolor1><tr><td>\n";
}
echo "<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\">\n"
."<tr><td align=\"left\"><font face=\"Arial\" color=\"black\" size=\"4\">$sitetitle</font><font size=\"3\" color=\"black\"> :: $title</font></td>\n"
."<tr><td width=650 style=\"height: 1px;\" bgcolor=\"black\"></td></tr>\n";
if ($showtop) {
echo "<tr><td><font size=\"2\">\n"
."<a href=\"".$adminfile."?op=home\" $iftop>主页</a>\n"
."<img src=pixel.gif width=7 height=1><a href=\"".$adminfile."?op=up\" $iftop>上传</a>\n"
."<img src=pixel.gif width=7 height=1><a href=\"".$adminfile."?op=cr\" $iftop>创建</a>\n"
."<img src=pixel.gif width=7 height=1><a href=\"".$adminfile."?op=allz\" $iftop>全站备份</a>\n"
."<img src=pixel.gif width=7 height=1><a href=\"".$adminfile."?op=sqlb\" $iftop>数据库备份</a>\n"
."<img src=pixel.gif width=7 height=1><a href=\"".$adminfile."?op=ftpa\" $iftop>FTP功能</a>\n"
."<img src=pixel.gif width=7 height=1><a href=\"".$adminfile."?op=killme&dename=".$me."&folder=./\">自杀</a>\n"
."<img src=pixel.gif width=7 height=1><a href=\"".$adminfile."?op=logout\" $iftop>退出</a>\n";
echo "<tr><td width=650 style=\"height: 1px;\" bgcolor=\"black\"></td></tr>\n";
}
echo "</table><br>\n";
}
/****************************************************************/
/* function login() */
/* */
/* Sets the cookies and alows user to log in. */
/* Recieves $pass as the user entered password. */
/****************************************************************/
function login($er=false) {
global $op;
setcookie("user","",time()-60*60*24*1);
setcookie("pass","",time()-60*60*24*1);
maintop("登录",false);
if ($er) {
echo "<font class=error>**错误: 不正确的登录信息.**</font><br><br>\n";
}
echo "<form action=\"".$adminfile."?op=".$op."\" method=\"post\">\n"
."<table><tr>\n"
."<td><font size=\"2\">用户名: </font>"
."<td><input type=\"text\" name=\"user\" size=\"18\" border=\"0\" class=\"text\" value=\"$user\">\n"
."<tr><td><font size=\"2\">密码: </font>\n"
."<td><input type=\"password\