mirror of https://github.com/xiaoqidun/phpcp.git
feat(首次发布): 添加项目文件
parent
09edb92e2a
commit
fdbb417665
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
require "config.php";
|
||||
xhtml_head("ERROR 404 !");
|
||||
echo "<div class=\"error\">你的请求无法找到 - ERROR 404 !</div>";
|
||||
xhtml_footer();
|
||||
?>
|
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
if (basename($_SERVER['SCRIPT_NAME']) != "auto.php") {
|
||||
if (!file_exists("admin.php")) {
|
||||
if (isset($_POST['username']) && isset($_POST['password']) && isset($_POST['password2'])) {
|
||||
if (strlen($u = trim($_POST['username'])) >= 5 && strlen($p = trim($_POST['password'])) >= 5 && $p === trim($_POST['password2'])) {
|
||||
$data = "<?php\ndefine(\"U\",\"$u\");\ndefine(\"P\",\"$p\");\n?>";
|
||||
if (file_put_contents("admin.php", $data)) {
|
||||
header("Location: {$_SERVER['SCRIPT_NAME']}?{$_SERVER['QUERY_STRING']}");
|
||||
exit;
|
||||
} else {
|
||||
$info = "没有权限写入配置文件!";
|
||||
}
|
||||
} else {
|
||||
$info = "没有正确输入配置信息!";
|
||||
}
|
||||
}
|
||||
require "xhtml.php";
|
||||
header("Content-Type:text/html;charset=UTF-8");
|
||||
xhtml_head("配置系统");
|
||||
echo "<div class=\"love\">\n";
|
||||
echo "<form action=\"{$_SERVER['SCRIPT_NAME']}?{$_SERVER['QUERY_STRING']}\" method=\"POST\">\n";
|
||||
echo "用户昵称:<br />\n<input type=\"text\" name=\"username\" /><br />\n";
|
||||
echo "用户密码:<br />\n<input type=\"text\" name=\"password\" /><br />\n";
|
||||
echo "重复密码:<br />\n<input type=\"password\" name=\"password2\" /><br />\n";
|
||||
echo "<input type=\"submit\" value=\"配置超级帐号\" />\n";
|
||||
echo "</form>\n";
|
||||
echo "</div>\n";
|
||||
if (isset($info)) {
|
||||
echo "<div class=\"like\">\n配置系统错误信息\n</div>\n";
|
||||
echo "<div class=\"love\">\n$info\n</div>\n";
|
||||
}
|
||||
xhtml_footer();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
?>
|
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
require "config.php";
|
||||
if (!isset($_GET['path'])) {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif (!is_file($path = trim($_GET['path']))) {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif (!is_readable($path)) {
|
||||
xhtml_head("压缩文件");
|
||||
echo "<div class=\"like\">\n";
|
||||
echo "<a href=\"./index.php?path=" . urlencode(dirname($path)) . "\"]>返回目录</a>错误提示\n";
|
||||
echo "</div>\n";
|
||||
echo "<div class=\"love\">\n";
|
||||
echo "此文件您没有读取权限!";
|
||||
echo "</div>\n";
|
||||
xhtml_footer();
|
||||
exit;
|
||||
}
|
||||
xhtml_head("压缩文件");
|
||||
echo "[<a href=\"./index.php?path=" . urlencode(dirname($path)) . "\">返回目录</a>]\n";
|
||||
if (isset($_GET['pk'])) {
|
||||
$pk = trim($_GET['pk']);
|
||||
if ($pk != "gz" && $pk != "bz2") {
|
||||
echo "无法支持你的压缩!";
|
||||
} elseif (file_exists("$path.$pk")) {
|
||||
echo "目标压缩已经存在!";
|
||||
} elseif (!($fp = fopen($path, "rb"))) {
|
||||
echo "无法打开您的文件!";
|
||||
} else {
|
||||
switch ($pk) {
|
||||
case "gz" :
|
||||
if (!function_exists("gzopen")) {
|
||||
echo "没有核心函数支持!";
|
||||
} elseif (!($gz = gzopen("$path.$pk", "w"))) {
|
||||
echo "无法打开目标文件!";
|
||||
} else {
|
||||
while (!feof($fp)) {
|
||||
gzwrite($gz, fread($fp, 4096));
|
||||
}
|
||||
gzclose($gz);
|
||||
echo "压缩文件已经创建!";
|
||||
}
|
||||
break;
|
||||
case "bz2" :
|
||||
if (!function_exists("bzopen")) {
|
||||
echo "没有核心函数支持!";
|
||||
} elseif (!($bz2 = bzopen("$path.$pk", "w"))) {
|
||||
echo "无法打开目标文件!";
|
||||
} else {
|
||||
while (!feof($fp)) {
|
||||
bzwrite($bz2, fread($fp, 4096));
|
||||
}
|
||||
bzclose($bz2);
|
||||
echo "压缩文件已经创建!";
|
||||
}
|
||||
break;
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
} else {
|
||||
echo "创建<a href=\"?pk=gz&path=" . urlencode($path) . "\">Gzip</a> <a href=\"?pk=bz2&path=" . urlencode($path) . "\">Bzip2</a>压缩!";
|
||||
}
|
||||
xhtml_footer();
|
||||
?>
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
require "config.php";
|
||||
if (!isset($_GET['path'])) {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif (($path = trim($_GET['path'])) == "") {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif (!is_file($path) || !is_readable($path)) {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} else {
|
||||
$myfs = new filesystem($path);
|
||||
$info = $myfs->getpath();
|
||||
if (isset($_GET['mime']) && strlen($mime = trim($_GET['mime'])) >= 3) {
|
||||
header("Content-Type: $mime");
|
||||
} else {
|
||||
___download($path);
|
||||
exit;
|
||||
}
|
||||
header("Accept-Ranges: bytes");
|
||||
header("Content-Length: " . $info['size']);
|
||||
$fp = fopen($path, "rb");
|
||||
while (!feof($fp)) {
|
||||
echo fread($fp, 4096);
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
?>
|
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
require "config.php";
|
||||
if (!isset($_GET['path'])) {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif (($path = trim($_GET['path'])) == "") {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif (!is_file($path)) {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif (!is_writable($path)) {
|
||||
xhtml_head("编辑文件");
|
||||
echo "<div class=\"like\">\n";
|
||||
echo "<a href=\"./index.php?path=" . urlencode(dirname($path)) . "\"]>返回目录</a>错误提示\n";
|
||||
echo "</div>\n";
|
||||
echo "<div class=\"love\">\n";
|
||||
echo "此文件您没有写入权限!";
|
||||
echo "</div>\n";
|
||||
xhtml_footer();
|
||||
} else {
|
||||
xhtml_head("编辑文件");
|
||||
echo "<div class=\"like\">\n";
|
||||
echo "<a href=\"./index.php?path=" . urlencode(dirname($path)) . "\"]>返回目录</a>选择编码\n";
|
||||
echo "</div>\n";
|
||||
echo "<div class=\"love\">";
|
||||
echo "<form action=\"\" method=\"GET\">\n";
|
||||
echo "<select name=\"charset\">\n";
|
||||
if (!function_exists("mb_convert_encoding")) {
|
||||
echo "<option>缺少模块</option>\n";
|
||||
} else {
|
||||
$sencode = mb_list_encodings();
|
||||
usort($sencode, "___sortcmp");
|
||||
foreach ($sencode as $encode) {
|
||||
if ($encode == "pass") {
|
||||
continue;
|
||||
}
|
||||
if (function_exists("mb_encoding_aliases")) {
|
||||
$alias = mb_encoding_aliases($encode);
|
||||
echo "\n<optgroup label=\"$encode\">\n";
|
||||
echo "<option value=\"$encode\">$encode</option>\n";
|
||||
if (is_array($alias)) if (count($alias) >= 1) {
|
||||
usort($alias, "___sortcmp");
|
||||
foreach ($alias as $encodealias) {
|
||||
if ($encodealias == $encode) {
|
||||
continue;
|
||||
}
|
||||
echo "<option value=\"$encode\">$encodealias</option>\n";
|
||||
}
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
} else {
|
||||
echo "<option value=\"$encode\">$encode</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</select>\n";
|
||||
echo "<input type=\"hidden\" name=\"path\" value=\"$path\" />";
|
||||
echo "<input type=\"submit\" value=\"设置编码\" />\n";
|
||||
echo "</form>\n";
|
||||
echo "</div>\n";
|
||||
if (isset($_POST['content'])) if (trim($_POST['content']) != "") {
|
||||
echo "<div class=\"like\">文件保存情况报告</div>\n";
|
||||
if (!get_magic_quotes_gpc()) {
|
||||
$fcontent = $_POST['content'];
|
||||
} else {
|
||||
$fcontent = stripslashes($_POST['content']);
|
||||
}
|
||||
if (isset($_POST['charset'])) if (trim($_POST['charset']) != "") {
|
||||
$fcontent = ___convert($fcontent, trim($_POST['charset']), "UTF-8");
|
||||
}
|
||||
echo "<div class=\"love\">\n";
|
||||
if (file_put_contents($path, $fcontent)) {
|
||||
echo "文件数据已经成功存储!\n";
|
||||
} else {
|
||||
echo "文件数据无法存入文件!\n";
|
||||
}
|
||||
echo "</div>\n";
|
||||
}
|
||||
$data = file_get_contents($path);
|
||||
if (!isset($_GET['charset'])) {
|
||||
$charset = null;
|
||||
$content = ___codepre($data, null);
|
||||
} elseif (($charset = trim($_GET['charset'])) == "") {
|
||||
$content = ___codepre($data, null);
|
||||
} else {
|
||||
$content = ___codepre(___convert($data, "UTF-8", $charset), null);
|
||||
}
|
||||
echo "<div class=\"like\">爱特文本编辑工具</div>\n";
|
||||
echo "<div class=\"love\">\n";
|
||||
echo "<form action=\"?path=" . urlencode($path) . "&charset={$charset}\" method=\"POST\">\n";
|
||||
echo "<input type=\"submit\" value=\"保存文件\" />\n";
|
||||
echo "<input type=\"reset\" value=\"重置文件\" />\n<br />\n";
|
||||
if (isset($_GET['charset'])) if ($charset != "") {
|
||||
echo "<input type=\"hidden\" name=\"charset\" value=\"$charset\" />\n";
|
||||
}
|
||||
echo "<textarea name=\"content\" style=\"width:99%;height:400px;\">$content</textarea>\n<br/>\n";
|
||||
echo "</form>\n";
|
||||
echo "</div>\n";
|
||||
xhtml_footer();
|
||||
}
|
||||
?>
|
@ -0,0 +1,172 @@
|
||||
<?php
|
||||
|
||||
class filesystem
|
||||
{
|
||||
private $path = null;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
if (func_num_args() > 0) $this->path = func_get_arg(0);
|
||||
}
|
||||
|
||||
function chmod()
|
||||
{
|
||||
if (!function_exists("chmod") || !file_exists("perms.php")) return false;
|
||||
if (func_num_args() == 3) {
|
||||
$path = $this->path;
|
||||
$dirperms = func_get_arg(0);
|
||||
$fileperms = func_get_arg(1);
|
||||
$recursive = func_get_arg(2);
|
||||
} elseif (func_num_args() == 4) {
|
||||
$path = func_get_arg(0);
|
||||
$dirperms = func_get_arg(1);
|
||||
$fileperms = func_get_arg(2);
|
||||
$recursive = func_get_arg(3);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
if (!file_exists($path)) return false;
|
||||
require "perms.php";
|
||||
if (!isset($perms["$dirperms"]) || !isset($perms["$fileperms"])) return false;
|
||||
if (!is_dir($path)) return chmod($path, $perms["$fileperms"]);
|
||||
if (!$recursive || !($dh = opendir($path))) return chmod($path, $perms["$dirperms"]);
|
||||
while (($entry = readdir($dh)) !== false) {
|
||||
if ($entry != "." && $entry != "..") {
|
||||
$this->chmod($path . "/" . $entry, $dirperms, $fileperms, $recursive);
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
return chmod($path, $perms["$dirperms"]);
|
||||
|
||||
}
|
||||
|
||||
function chpath()
|
||||
{
|
||||
if (func_num_args() < 1) {
|
||||
return false;
|
||||
} else {
|
||||
$this->path = func_get_arg(0);
|
||||
}
|
||||
}
|
||||
|
||||
function cppath()
|
||||
{
|
||||
if (func_num_args() == 1) {
|
||||
$path = $this->path;
|
||||
$topath = func_get_arg(0);
|
||||
} elseif (func_num_args() == 2) {
|
||||
$path = func_get_arg(1);
|
||||
$topath = func_get_arg(0);;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
if (!file_exists($path)) {
|
||||
return false;
|
||||
} elseif (!is_dir($path)) {
|
||||
return copy($path, $topath);
|
||||
} elseif (!mkdir($topath, 0755, true)) {
|
||||
return false;
|
||||
}
|
||||
if (!($dh = opendir($path))) return false;
|
||||
while (($entry = readdir($dh)) !== false) {
|
||||
if ($entry != "." && $entry != "..") {
|
||||
$this->cppath($topath . "/" . $entry, $path . "/" . $entry);
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
return true;
|
||||
}
|
||||
|
||||
function rmpath()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$path = func_get_arg(0);
|
||||
} else {
|
||||
$path = $this->path;
|
||||
}
|
||||
if (!file_exists($path) && !is_link($path)) {
|
||||
return true;
|
||||
} elseif (is_link($path)) {
|
||||
return unlink($path);
|
||||
} elseif (!is_dir($path)) {
|
||||
return unlink($path);
|
||||
}
|
||||
if (!($dh = opendir($path))) return false;
|
||||
while (($entry = readdir($dh)) !== false) {
|
||||
if ($entry != "." && $entry != "..") {
|
||||
$this->rmpath($path . "/" . $entry);
|
||||
}
|
||||
}
|
||||
return rmdir($path);
|
||||
}
|
||||
|
||||
function getpath()
|
||||
{
|
||||
if (func_num_args() > 0) {
|
||||
$path = func_get_arg(0);
|
||||
} else {
|
||||
$path = $this->path;
|
||||
}
|
||||
if (is_dir($path)) {
|
||||
$fs = array(array(), array(), array());
|
||||
if (!($dh = opendir($path))) return false;
|
||||
while (($entry = readdir($dh)) !== false) {
|
||||
if ($entry != "." && $entry != "..") {
|
||||
if (is_dir($entry = ___realpath($path . "/" . $entry))) {
|
||||
$fs[0][] = $entry;
|
||||
} elseif (is_file($entry)) {
|
||||
$fs[1][] = $entry;
|
||||
} else {
|
||||
if ($entry != "") {
|
||||
$fs[2][] = $entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
if ((count($fs, 1) - 3) < 1) return null;
|
||||
if (count($fs[0]) > 0) usort($fs[0], "___sortcmp");
|
||||
if (count($fs[1]) > 0) usort($fs[1], "___sortcmp");
|
||||
if (count($fs[2]) > 0) usort($fs[2], "___sortcmp");
|
||||
return $fs;
|
||||
} elseif (file_exists($path)) {
|
||||
if (!($fs = stat($path))) {
|
||||
return false;
|
||||
} else {
|
||||
return $fs;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function getfinfo()
|
||||
{
|
||||
if (!function_exists("finfo_open")) return false;
|
||||
$finfo = finfo_open();
|
||||
if (func_num_args() > 0) {
|
||||
return finfo_file($finfo, func_get_arg(0));
|
||||
}
|
||||
return finfo_file($finfo, $this->path);
|
||||
}
|
||||
|
||||
function getperms()
|
||||
{
|
||||
if (!function_exists("fileperms")) return false;
|
||||
if (func_num_args() > 0) {
|
||||
$path = func_get_arg(0);
|
||||
if (($perms = fileperms($path)) === false) {
|
||||
return false;
|
||||
} else {
|
||||
return substr(sprintf("%o", $perms), -4);
|
||||
}
|
||||
}
|
||||
if (($perms = fileperms($this->path)) === false) {
|
||||
return false;
|
||||
} else {
|
||||
return substr(sprintf("%o", $perms), -4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
require "config.php";
|
||||
if (!isset($_GET['path'])) {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif (!is_file($path = trim($_GET['path']))) {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} else {
|
||||
xhtml_head("文件编码转换");
|
||||
echo "<div class=\"like\">\n";
|
||||
echo "<a href=\"./index.php?path=" . urlencode(dirname($path)) . "\"]>返回目录</a>转换提示\n";
|
||||
echo "</div>\n";
|
||||
echo "<div class=\"love\">\n";
|
||||
if (!function_exists("mb_convert_encoding") || !function_exists("mb_list_encodings")) {
|
||||
echo "核心函数库没有被支持!\n";
|
||||
} elseif (!is_readable($path)) {
|
||||
echo "无法读取输入文件内容!\n";
|
||||
} elseif (!isset($_GET['ic']) || !isset($_GET['pc']) || !isset($_GET['save'])) {
|
||||
echo "编码转换参数没有设置!\n";
|
||||
} elseif (($ic = trim($_GET['ic'])) == "" || ($pc = trim($_GET['pc'])) == "" || ($save = trim($_GET['save'])) == "") {
|
||||
echo "编码转换参数不能为空!\n";
|
||||
} elseif ($ic == $pc) {
|
||||
echo "输入输出编码不能一致!\n";
|
||||
} elseif (!in_array($ic, mb_list_encodings()) || !in_array($pc, mb_list_encodings())) {
|
||||
echo "选择的编码格式不支持!\n";
|
||||
} else {
|
||||
if (!strstr($save, "/") && !strstr($save, "\\")) $save = (dirname($path) . "/" . $save);
|
||||
if ($save == $path) {
|
||||
echo "新路径应不同于老路径!\n";
|
||||
} elseif (!($data = file_get_contents($path))) {
|
||||
echo "读取失败或者文件为空!\n";
|
||||
} elseif (!file_put_contents($save, mb_convert_encoding($data, $pc, $ic))) {
|
||||
echo "无权限写入或写入错误!\n";
|
||||
file_exists($save) && unlink($save);
|
||||
} elseif (filesize($save) < 1) {
|
||||
unlink($save);
|
||||
echo "无法成功进行编码转换!\n";
|
||||
} else {
|
||||
echo "编码已转换并写入文件!\n";
|
||||
}
|
||||
}
|
||||
echo "</div>\n";
|
||||
xhtml_footer();
|
||||
}
|
||||
?>
|
@ -0,0 +1,215 @@
|
||||
<?php
|
||||
require "config.php";
|
||||
if (!isset($_REQUEST['type'])) {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif (($type = trim($_REQUEST['type'])) == "") {
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
}
|
||||
if (!isset($_GET['gopath'])) {
|
||||
$gopath = OPEN;
|
||||
} else {
|
||||
$gopath = ___realpath(trim($_GET['gopath']));
|
||||
}
|
||||
if (!isset($_GET['getcwd'])) {
|
||||
$getcwd = $gopath;
|
||||
} else {
|
||||
$getcwd = ___realpath(trim($_GET['getcwd']));
|
||||
}
|
||||
if ($type == "list") {
|
||||
header("Location: ./flist.php?getcwd=" . urlencode($getcwd));
|
||||
exit;
|
||||
} elseif ($type == "create") {
|
||||
header("Location: ./create.php?getcwd=" . urlencode($getcwd));
|
||||
exit;
|
||||
} elseif ($type == "upload") {
|
||||
header("Location: ./upload.php?getcwd=" . urlencode($getcwd));
|
||||
exit;
|
||||
} elseif ($type == "addlist") {
|
||||
if (isset($_POST['flist'])) if (count($_POST['flist']) > 0) {
|
||||
if (!isset($_SESSION['flist'])) $_SESSION['flist'] = array();
|
||||
$_SESSION['flist'] = array_filter(array_unique(array_merge($_SESSION['flist'], array_map('urldecode', $_POST['flist']))));
|
||||
usort($_SESSION['flist'], "___sortcmp");
|
||||
}
|
||||
header("Location: ./flist.php?getcwd=" . urlencode($getcwd));
|
||||
exit;
|
||||
} elseif ($type == "unzipdir") {
|
||||
if (isset($_SESSION['ffpath'])) if (!is_dir($_SESSION['ffpath'])) {
|
||||
header("Location: ./unzip.php?path=" . urlencode($_SESSION['ffpath']) . "&unzipdir=" . urlencode($getcwd));
|
||||
exit;
|
||||
}
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif ($type == "unpackdir") {
|
||||
if (isset($_SESSION['ffpath'])) if (!is_dir($_SESSION['ffpath'])) {
|
||||
header("Location: ./file.php?path=" . urlencode($_SESSION['ffpath']) . "&unpackdir=" . urlencode($getcwd));
|
||||
exit;
|
||||
}
|
||||
header("Location: ./404.php");
|
||||
exit;
|
||||
} elseif ($type == "shell_exec") {
|
||||
header("Location: ./shell.php?getcwd=" . urlencode($getcwd));
|
||||
exit;
|
||||
}
|
||||
if (isset($_POST['flist'])) {
|
||||
if (!is_array($_POST['flist'])) {
|
||||
$_SESSION['flist'] = array();
|
||||
} else {
|
||||
$_SESSION['flist'] = array_map('urldecode', $_POST['flist']);
|
||||
}
|
||||
} elseif (!isset($_SESSION['flist'])) {
|
||||
$_SESSION['flist'] = array();
|
||||
}
|
||||
switch ($type) {
|
||||
case "move" :
|
||||
xhtml_head("批量移动");
|
||||
if (count($_SESSION['flist']) < 1) {
|
||||
echo "<div class=\"error\">\n";
|
||||
echo "[<a href=\"./index.php?path=" . urlencode($getcwd) . "\">返回</a>]抱歉,没有文件列表!\n";
|
||||
echo "</div>\n";
|
||||
} else {
|
||||
echo "<div class=\"like\">\n";
|
||||
echo "<a href=\"./index.php?path=" . urlencode($getcwd) . "&multiple=$type\">选择路径</a>(目标目录)\n";
|
||||
echo "</div>\n";
|
||||
echo "<div class=\"love\">\n";
|
||||
echo "<form action=\"move.php\" method=\"GET\">\n";
|
||||
echo "<input type=\"text\" name=\"gopath\" value=\"$getcwd\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"getcwd\" value=\"$getcwd\" />\n";
|
||||
echo "<input type=\"submit\" value=\"GO\" />\n";
|
||||
echo "</form>\n";
|
||||
echo "</div>\n";
|
||||
echo "<div class=\"like\">文件清单(选择列表)</div>\n";
|
||||
for ($i = 0; $i < count($_SESSION['flist']); $i++) {
|
||||
echo "<div class=\"love\">[$i] - {$_SESSION['flist'][$i]}</div>\n";
|
||||
}
|
||||
}
|
||||
xhtml_footer();
|
||||
break;
|
||||
case "copy" :
|
||||
xhtml_head("批量复制");
|
||||
if (count($_SESSION['flist']) < 1) {
|
||||
echo "<div class=\"error\">\n";
|
||||
echo "[<a href=\"./index.php?path=" . urlencode($getcwd) . "\">返回</a>]抱歉,没有文件列表!\n";
|
||||
echo "</div>\n";
|
||||
} else {
|
||||
echo "<div class=\"like\">\n";
|
||||
echo "<a href=\"./index.php?path=" . urlencode($getcwd) . "&multiple=$type\">选择路径</a>(目标目录)\n";
|
||||
echo "</div>\n";
|
||||
echo "<div class=\"love\">\n";
|
||||
echo "<form action=\"copy.php\" method=\"GET\">\n";
|
||||
echo "<input type=\"text\" name=\"gopath\" value=\"$getcwd\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"getcwd\" value=\"$getcwd\" />\n";
|
||||
echo "<input type=\"submit\" value=\"GO\" />\n";
|
||||
echo "</form>\n";
|
||||
echo "</div>\n";
|
||||
echo "<div class=\"like\">文件清单(选择列表)</div>\n";
|
||||
for ($i = 0; $i < count($_SESSION['flist']); $i++) {
|
||||
echo "<div class=\"love\">[$i] - {$_SESSION['flist'][$i]}</div>\n";
|
||||
}
|
||||
}
|
||||
xhtml_footer();
|
||||
break;
|
||||
case "pkzip" :
|
||||
xhtml_head("压缩文件");
|
||||
if (count($_SESSION['flist']) < 1) {
|
||||
echo "<div class=\"error\">\n";
|
||||
echo "[<a href=\"./index.php?path=" . urlencode($getcwd) . "\">返回</a>]抱歉,没有文件列表!\n";
|
||||
echo "</div>\n";
|
||||
} else {
|
||||
if (($zpath = ___realpath($getcwd)) == "/") {
|
||||
$zpath = $zpath .= "archive.zip";
|
||||
} else {
|
||||
$zpath = $zpath .= "/archive.zip";
|
||||
}
|
||||
echo "<div class=\"like\">\n";
|
||||
echo "<a href=\"./index.php?path=" . urlencode($getcwd) . "&multiple=$type\">存放目录</a>(归档路径)\n";
|
||||
echo "</div>\n";
|
||||
echo "<div class=\"love\">\n";
|
||||
echo "<form action=\"pkzip.php\" method=\"GET\">\n";
|
||||
echo "<input type=\"text\" name=\"gopath\" value=\"$zpath\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"getcwd\" value=\"$getcwd\" />\n";
|
||||
echo "<input type=\"submit\" value=\"GO\" />\n";
|
||||
echo "</form>\n";
|
||||
echo "</div>\n";
|
||||
echo "<div class=\"like\">文件清单(选择列表)</div>\n";
|
||||
for ($i = 0; $i < count($_SESSION['flist']); $i++) {
|
||||
echo "<div class=\"love\">[$i] - {$_SESSION['flist'][$i]}</div>\n";
|
||||
}
|
||||
}
|
||||
xhtml_footer();
|
||||
break;
|
||||
case "chmod" :
|
||||
xhtml_head("批量改权");
|
||||
if (count($_SESSION['flist']) < 1) {
|
||||
echo "<div class=\"error\">\n";
|
||||
echo "[<a href=\"./index.php?path=" . urlencode($getcwd) . "\">返回</a>]抱歉,没有文件列表!\n";
|
||||
echo "</div>\n";
|
||||
} else {
|
||||
echo "<div class=\"like\">\n";
|
||||
echo "<a href=\"./index.php?path=" . urlencode($getcwd) . "\">文件列表</a>(返回浏览)\n";
|
||||
echo "</div>\n";
|
||||
echo "<div class=\"love\">\n";
|
||||
echo "<form action=\"chmod.php\" method=\"GET\">\n";
|
||||
echo "递归权限:<input type=\"radio\" name=\"recursive\" value=\"on\" checked />开启\n";
|
||||
echo "<input type=\"radio\" name=\"recursive\" value=\"off\" />关闭\n<br />\n";
|
||||
echo "目录权限:<input type=\"text\" name=\"dirperms\" value=\"0755\" />\n";
|
||||
echo "<br />\n文件权限:<input type=\"text\" name=\"fileperms\" value=\"0644\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"getcwd\" value=\"$getcwd\" />\n";
|
||||
echo "<br />\n<input type=\"submit\" value=\"GO\" />\n";
|
||||
echo "</form>\n";
|
||||
echo "</div>\n";
|
||||
echo "<d |