<?php
//a:9:{s:4:"lang";s:2:"zh";s:9:"auth_pass";s:32:"d41d8cd98f00b204e9800998ecf8427e";s:8:"quota_mb";i:0;s:17:"upload_ext_filter";a:0:{}s:19:"download_ext_filter";a:0:{}s:15:"error_reporting";i:1;s:7:"fm_root";s:0:"";s:17:"cookie_cache_time";i:2592000;s:7:"version";s:15:"0.9.8 汉化版";}
/*--------------------------------------------------
| PHP FILE MANAGER
+--------------------------------------------------
| php文件管理 0.9.8
| By Fabricio Seger Kolling
| Copyright (c) 2004-2013 Fabrício Seger Kolling
| E-mail: dulldusk@gmail.com
| URL: http://phpfm.sf.net
| Last Changed: 2013-10-15
+--------------------------------------------------
| OPEN SOURCE CONTRIBUTIONS
+--------------------------------------------------
| TAR/GZIP/BZIP2/ZIP ARCHIVE CLASSES 2.0
| By Devin Doucette
| Copyright (c) 2004 Devin Doucette
| E-mail: darksnoopy@shaw.ca
| URL: http://www.phpclasses.org
+--------------------------------------------------
| 中文贡献者:X.G(请多支持:464582835@qq.com)
| 作者请求保留以上信息
+--------------------------------------------------
| LICENSE
+--------------------------------------------------
| Licensed under the terms of any of the following licenses at your choice:
| - GNU General Public License Version 2 or later (the "GPL");
| - GNU Lesser General Public License Version 2.1 or later (the "LGPL");
| - Mozilla Public License Version 1.1 or later (the "MPL").
| You are not required to, but if you want to explicitly declare the license
| you have chosen to be bound to when using, reproducing, modifying and
| distributing this software, just include a text file titled "LEGAL" in your version
| of this software, indicating your license choice. In any case, your choice will not
| restrict any recipient of your version of this software to use, reproduce, modify
| and distribute this software under any of the above licenses.
+--------------------------------------------------
| CONFIGURATION AND INSTALATION NOTES
+--------------------------------------------------
| This program does not include any instalation or configuration
| notes because it simply does not require them.
| Just throw this file anywhere in your webserver and enjoy !!
+--------------------------------------------------
*/
// +--------------------------------------------------
// | Header and Globals
// +--------------------------------------------------
$charset = "UTF-8";
header("Pragma: no-cache");
header("Cache-Control: no-store");
header("Content-Type: text/html; charset=".$charset);
//@ini_set('default_charset', $charset);
if (@get_magic_quotes_gpc()) {
function stripslashes_deep($value){
return is_array($value)? array_map('stripslashes_deep', $value):$value;
}
$_POST = array_map('stripslashes_deep', $_POST);
$_GET = array_map('stripslashes_deep', $_GET);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
// Server Vars
function get_client_ip() {
$ipaddress = '';
if ($_SERVER['HTTP_CLIENT_IP']) $ipaddress = $_SERVER['HTTP_CLIENT_IP'];
else if($_SERVER['HTTP_X_FORWARDED_FOR']) $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];
else if($_SERVER['HTTP_X_FORWARDED']) $ipaddress = $_SERVER['HTTP_X_FORWARDED'];
else if($_SERVER['HTTP_FORWARDED_FOR']) $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];
else if($_SERVER['HTTP_FORWARDED']) $ipaddress = $_SERVER['HTTP_FORWARDED'];
else if($_SERVER['REMOTE_ADDR']) $ipaddress = $_SERVER['REMOTE_ADDR'];
// proxy transparente não esconde o IP local, colocando ele após o IP da rede, separado por vírgula
if (strpos($ipaddress, ',') !== false) {
$ips = explode(',', $ipaddress);
$ipaddress = trim($ips[0]);
}
if ($ipaddress == '::1') $ipaddress = '';
return $ipaddress;
}
$ip = get_client_ip();
$islinux = !(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN');
function getServerURL() {
$url = ($_SERVER["HTTPS"] == "on")?"https://":"http://";
$url .= $_SERVER["SERVER_NAME"]; // $_SERVER["HTTP_HOST"] is equivalent
if ($_SERVER["SERVER_PORT"] != "80") $url .= ":".$_SERVER["SERVER_PORT"];
return $url;
}
function getCompleteURL() {
return getServerURL().$_SERVER["REQUEST_URI"];
}
$url = getCompleteURL();
$url_info = parse_url($url);
if( !isset($_SERVER['DOCUMENT_ROOT']) ) {
if ( isset($_SERVER['SCRIPT_FILENAME']) ) $path = $_SERVER['SCRIPT_FILENAME'];
elseif ( isset($_SERVER['PATH_TRANSLATED']) ) $path = str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']);
$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($path, 0, 0-strlen($_SERVER['PHP_SELF'])));
}
$doc_root = str_replace('//','/',str_replace(DIRECTORY_SEPARATOR,'/',$_SERVER["DOCUMENT_ROOT"]));
$fm_self = $doc_root.$_SERVER["PHP_SELF"];
$path_info = pathinfo($fm_self);
// Register Globals
$blockKeys = array('_SERVER','_SESSION','_GET','_POST','_COOKIE','charset','ip','islinux','url','url_info','doc_root','fm_self','path_info');
foreach ($_GET as $key => $val) if (array_search($key,$blockKeys) === false) $$key=$val;
foreach ($_POST as $key => $val) if (array_search($key,$blockKeys) === false) $$key=$val;
foreach ($_COOKIE as $key => $val) if (array_search($key,$blockKeys) === false) $$key=$val;
// +--------------------------------------------------
// | Config
// +--------------------------------------------------
$cfg = new config();
$cfg->load();
switch ($error_reporting){
case 0: error_reporting(0); @ini_set("display_errors",0); break;
case 1: error_reporting(E_ERROR | E_PARSE | E_COMPILE_ERROR); @ini_set("display_errors",1); break;
case 2: error_reporting(E_ALL); @ini_set("display_errors",1); break;
}
if (!isset($current_dir)){
$current_dir = $path_info["dirname"]."/";
if (!$islinux) $current_dir = ucfirst($current_dir);
//@chmod($current_dir,0755);
} else $current_dir = format_path($current_dir);
// Auto Expand Local Path
if (!isset($expanded_dir_list)){
$expanded_dir_list = "";
$mat = explode("/",$path_info["dirname"]);
for ($x=0;$x<count($mat);$x++) $expanded_dir_list .= ":".$mat[$x];
setcookie("expanded_dir_list", $expanded_dir_list, 0, "/");
}
if (!isset($fm_current_root)){
if (strlen($fm_root)) $fm_current_root = $fm_root;
else {
if (!$islinux) $fm_current_root = ucfirst($path_info["dirname"]."/");
else $fm_current_root = $doc_root."/";
}
setcookie("fm_current_root", $fm_current_root, 0, "/");
} elseif (isset($set_fm_current_root)) {
if (!$islinux) $fm_current_root = ucfirst($set_fm_current_root);
setcookie("fm_current_root", $fm_current_root, 0, "/");
}
if (!isset($resolveIDs)){
setcookie("resolveIDs", 0, time()+$cookie_cache_time, "/");
} elseif (isset($set_resolveIDs)){
$resolveIDs=($resolveIDs)?0:1;
setcookie("resolveIDs", $resolveIDs, time()+$cookie_cache_time, "/");
}
if ($resolveIDs){
exec("cat /etc/passwd",$mat_passwd);
exec("cat /etc/group",$mat_group);
}
$fm_color['Bg'] = "EEEEEE";
$fm_color['Text'] = "000000";
$fm_color['Link'] = "0A77F7";
$fm_color['Entry'] = "FFFFFF";
$fm_color['Over'] = "C0EBFD";
$fm_color['Mark'] = "A7D2E4";
foreach($fm_color as $tag=>$color){
$fm_color[$tag]=strtolower($color);
}
// +--------------------------------------------------
// | File Manager Actions
// +--------------------------------------------------
if ($loggedon==$auth_pass){
switch ($frame){
case 1: break; // Empty Frame
case 2: frame2(); break;
case 3: frame3(); break;