parent
af95284b4a
commit
32ed2070bd
17
ChangeLog.md
17
ChangeLog.md
|
@ -1,3 +1,20 @@
|
|||
### ver3.37 `2017/1/1`
|
||||
-----
|
||||
#### update:
|
||||
- 部分主机兼容:不支持相对路径问题;iconv系统库补全兼容处理(压缩时压缩失败);不兼容777权限问题优化;
|
||||
- 移动端优化;loading效果加入;移动端默认隐藏桌面;去掉title的hover效果
|
||||
- 桌面优化:自适应图标间隙高度;优化图标大小范围
|
||||
- 同名文件默认覆盖
|
||||
- 自定义公共目录名称:使用群组名称(如果name不等于public)
|
||||
|
||||
#### fix bug
|
||||
- 下载链接rewrite默认关闭;修复部分主机打不开pdf,office文档问题
|
||||
- 错误提示统一处理;超时时间优化;不再检测connected状态
|
||||
- 输出清空之前缓存(show_json,验证码,文件下载,显示模板)
|
||||
- 用户管理界面:用户名宽度加宽;授权版支持批量添加用户
|
||||
- 自动更新优化,更新失败相应处理
|
||||
|
||||
|
||||
### ver3.36 `2016/12/31`
|
||||
-----
|
||||
#### update:
|
||||
|
|
|
@ -25,7 +25,7 @@ if(GLOBAL_DEBUG){
|
|||
}
|
||||
|
||||
header("Content-type: text/html; charset=utf-8");
|
||||
header('HTTP/1.1 200 Ok');//兼容部分lightHttp服务器环境
|
||||
//header('HTTP/1.1 200 Ok');//兼容部分lightHttp服务器环境; php5.1以下会输出异常;暂屏蔽
|
||||
define('BASIC_PATH',str_replace('\\','/',dirname(dirname(__FILE__))).'/');
|
||||
define('TEMPLATE', BASIC_PATH .'template/'); //模版文件路径
|
||||
define('CONTROLLER_DIR',BASIC_PATH .'controller/'); //控制器目录
|
||||
|
@ -35,6 +35,7 @@ define('PLUGIN_DIR', LIB_DIR .'plugins/'); //插件目录
|
|||
define('FUNCTION_DIR', LIB_DIR .'function/'); //函数库目录
|
||||
define('CLASS_DIR', LIB_DIR .'class/'); //内目录
|
||||
define('CORER_DIR', LIB_DIR .'core/'); //核心目录
|
||||
define('DEFAULT_PERRMISSIONS',0755); //新建文件、解压文件默认权限,777 部分虚拟主机限制了777
|
||||
|
||||
/*
|
||||
* 可以数据目录;移到web目录之外,可以使程序更安全, 就不用限制用户的扩展名权限了;
|
||||
|
|
|
@ -11,7 +11,7 @@ $config['settings'] = array(
|
|||
'download_url_time' => 0, //下载地址生效时间,按秒计算,0代表不限制,默认不限制
|
||||
'api_login_tonken' => '', //设定则认为开启服务端api通信登陆,同时作为加密密匙
|
||||
'update_chunk_size' => 1024*1024, //分片上传大小设定;不设定则用post_max_size;有时会受nginx的post_size限制
|
||||
'param_rewrite' => true
|
||||
'param_rewrite' => false,
|
||||
);
|
||||
|
||||
//初始化系统配置
|
||||
|
@ -42,7 +42,7 @@ $config['setting_default'] = array(
|
|||
'sound_open' => "0", // 操作音效
|
||||
'theme' => "win10", // app theme [mac,win7,win10,metro,metro_green,alpha]
|
||||
'wall' => "2", // wall picture
|
||||
"file_repeat" => "rename", // rename,replace
|
||||
"file_repeat" => "replace", // rename,replace,skip
|
||||
"recycle_open" => "1", // 1 | 0 代表是否开启
|
||||
'resize_config' =>
|
||||
'{"filename":250,"filetype":80,"filesize":80,"filetime":215,"editor_left_tree_width":200,"explorer_left_tree_width":200}'
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
<?php
|
||||
define('KOD_VERSION','3.36');
|
||||
define('KOD_VERSION','3.37');
|
||||
|
|
|
@ -12,6 +12,12 @@ class desktop extends Controller{
|
|||
$this->tpl = TEMPLATE.'desktop/';
|
||||
}
|
||||
public function index() {
|
||||
$wap = is_wap() && (!isset($_COOKIE['forceWap']) || $_COOKIE['forceWap'] == '1');
|
||||
if($wap){
|
||||
header("location:./index.php?explorer");
|
||||
exit;
|
||||
}
|
||||
|
||||
$wall = $this->config['user']['wall'];
|
||||
if(strlen($wall)>3){
|
||||
$this->assign('wall',$wall);
|
||||
|
|
|
@ -123,7 +123,7 @@ class explorer extends Controller{
|
|||
$new= rtrim($this->path,'/');
|
||||
$new = get_filename_auto($new,'',$repeat_type);//已存在处理 创建副本
|
||||
if(@touch($new)){
|
||||
chmod_path($new,0777);
|
||||
chmod_path($new,DEFAULT_PERRMISSIONS);
|
||||
if (isset($this->in['content'])) {
|
||||
file_put_contents($new,$this->in['content']);
|
||||
}else{
|
||||
|
@ -148,8 +148,8 @@ class explorer extends Controller{
|
|||
}
|
||||
$new = rtrim($this->path,'/');
|
||||
$new = get_filename_auto($new,'',$repeat_type);//已存在处理 创建副本
|
||||
if(mk_dir($new,0777)){
|
||||
chmod_path($new,0777);
|
||||
if(mk_dir($new,DEFAULT_PERRMISSIONS)){
|
||||
chmod_path($new,DEFAULT_PERRMISSIONS);
|
||||
show_json($this->L['create_success'],true,_DIR_OUT(iconv_app($new)) );
|
||||
}else{
|
||||
show_json($this->L['create_error'],false);
|
||||
|
@ -336,7 +336,7 @@ class explorer extends Controller{
|
|||
}
|
||||
$the_fav = array(
|
||||
'name' => $val['name'],
|
||||
'ext' => $val['ext'],
|
||||
'ext' => isset($val['ext'])?$val['ext']:"",
|
||||
'menuType' => "menuTreeFav",
|
||||
|
||||
'path' => $val['path'],
|
||||
|
@ -375,6 +375,13 @@ class explorer extends Controller{
|
|||
$fav = $this->_tree_fav($app);
|
||||
|
||||
$public_path = KOD_GROUP_PATH.':1/';
|
||||
|
||||
$group_root = system_group::get_info(1);
|
||||
$group_root_name = $this->L['public_path'];
|
||||
if($group_root && $group_root['name'] != 'public'){
|
||||
$group_root_name = $group_root['name'];
|
||||
}
|
||||
|
||||
if(system_member::user_auth_group(1) == false){
|
||||
$public_path = KOD_GROUP_SHARE.':1/';//不在公共组则只能读取公共组共享目录
|
||||
}
|
||||
|
@ -416,7 +423,7 @@ class explorer extends Controller{
|
|||
),
|
||||
|
||||
'public'=>array(
|
||||
'name' => $this->L['public_path'],
|
||||
'name' => $group_root_name,
|
||||
'menuType' => "menuTreeGroupRoot",
|
||||
'ext' => "groupPublic",
|
||||
'children' => $public,
|
||||
|
@ -856,7 +863,7 @@ class explorer extends Controller{
|
|||
}
|
||||
public function zip($zip_path=''){
|
||||
load_class('pclzip');
|
||||
ini_set('memory_limit', '2028M');//2G;
|
||||
ignore_timeout();
|
||||
|
||||
$zip_list = json_decode($this->in['list'],true);
|
||||
$list_num = count($zip_list);
|
||||
|
@ -917,7 +924,9 @@ class explorer extends Controller{
|
|||
}
|
||||
}
|
||||
public function unzip(){
|
||||
ini_set('memory_limit', '2028M');//2G;
|
||||
load_class('pclzip');
|
||||
ignore_timeout();
|
||||
|
||||
$path=$this->path;
|
||||
$name = get_path_this($path);
|
||||
$name = substr($name,0,strrpos($name,'.'));
|
||||
|
@ -936,11 +945,10 @@ class explorer extends Controller{
|
|||
show_json($this->L['no_permission_write'],false);
|
||||
}
|
||||
space_size_use_check();
|
||||
load_class('pclzip');
|
||||
$zip = new PclZip($path);
|
||||
unzip_charset_get($zip->listContent());
|
||||
$result = $zip->extract(PCLZIP_OPT_PATH,$unzip_to,
|
||||
PCLZIP_OPT_SET_CHMOD,0777,
|
||||
PCLZIP_OPT_SET_CHMOD,DEFAULT_PERRMISSIONS,
|
||||
PCLZIP_CB_PRE_FILE_NAME,'unzip_pre_name',
|
||||
PCLZIP_CB_PRE_EXTRACT,"check_ext_unzip",
|
||||
PCLZIP_OPT_REPLACE_NEWER);//解压到某个地方,覆盖方式
|
||||
|
|
|
@ -475,7 +475,7 @@ class share extends Controller{
|
|||
show_json($this->L['share_not_download_tips'],false);
|
||||
}
|
||||
load_class('pclzip');
|
||||
ini_set('memory_limit', '2028M');//2G;
|
||||
ignore_timeout();
|
||||
|
||||
$zip_list = json_decode($this->in['list'],true);
|
||||
$list_num = count($zip_list);
|
||||
|
|
|
@ -248,7 +248,7 @@ class user extends Controller{
|
|||
*/
|
||||
public function login($msg = ''){
|
||||
if (!file_exists(USER_SYSTEM.'install.lock')) {
|
||||
chmod_path(BASIC_PATH,0777);
|
||||
chmod_path(BASIC_PATH,DEFAULT_PERRMISSIONS);
|
||||
$this->display('install.html');
|
||||
exit;
|
||||
}
|
||||
|
@ -299,6 +299,7 @@ class user extends Controller{
|
|||
* api登陆:index.php?user/loginSubmit&login_token=ZGVtbw==|da9926fdab0c7c32ab2c329255046793
|
||||
*/
|
||||
public function loginSubmit(){
|
||||
$api_login_check = false;
|
||||
if(isset($this->in['login_token'])){
|
||||
$api_token = $this->config['settings']['api_login_tonken'];
|
||||
$param = explode('|',$this->in['login_token']);
|
||||
|
@ -481,6 +482,7 @@ class user extends Controller{
|
|||
header('location:http://qr.liantu.com/api.php?text='.$this->in['url']);
|
||||
exit;
|
||||
}
|
||||
ob_get_clean();
|
||||
include CLASS_DIR.'phpqrcode.php';
|
||||
QRcode::png(rawurldecode($this->in['url']));
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
ob_start();
|
||||
include ('./config/config.php');
|
||||
include ('config/config.php');
|
||||
$app = new Application();
|
||||
init_config();
|
||||
$app->run();
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -208,6 +208,7 @@ class imageThumb {
|
|||
|
||||
// 输出图片,link---只输出,不保存文件。file--保存为文件
|
||||
function echoImage($img, $toFile){
|
||||
ob_get_clean();
|
||||
$result = false;
|
||||
switch ($this->echoType) {
|
||||
case 'link':$result = imagePNG($img);break;
|
||||
|
|
|
@ -203,10 +203,9 @@ class myCaptcha{
|
|||
}
|
||||
}
|
||||
private function show_img(&$img){
|
||||
ob_get_clean();
|
||||
$out = ob_get_clean();//清除之前所有输出缓冲 TODO
|
||||
if($out != ''){
|
||||
die($out);
|
||||
}
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
||||
|
|
|
@ -109,7 +109,20 @@ function clear_html($HTML, $br = true){
|
|||
} else {
|
||||
return str_replace("\n", '', $HTML);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤js、css等
|
||||
*/
|
||||
function filter_html($html){
|
||||
$find = array(
|
||||
"/<(\/?)(script|i?frame|style|html|body|title|link|meta|\?|\%)([^>]*?)>/isU",
|
||||
"/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU",
|
||||
"/javascript\s*:/isU",
|
||||
);
|
||||
$replace = array("<\\1\\2\\3>","\\1\\2","");
|
||||
return preg_replace($find,$replace,$html);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将obj深度转化成array
|
||||
|
@ -129,7 +142,13 @@ function obj2array($obj){
|
|||
} else {
|
||||
return $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ignore_timeout(){
|
||||
@ignore_user_abort(true);
|
||||
@set_time_limit(24 * 60 * 60);//set_time_limit(0) 1day
|
||||
@ini_set('memory_limit', '2028M');//2G;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算时间差
|
||||
|
@ -310,7 +329,41 @@ function array_get_index($arr,$index){
|
|||
}
|
||||
}
|
||||
|
||||
//set_error_handler('errorHandler',E_ERROR|E_PARSE|E_CORE_ERROR|E_COMPILE_ERROR|E_USER_ERROR);
|
||||
register_shutdown_function('fatalErrorHandler');
|
||||
function errorHandler($err_type,$errstr,$errfile,$errline){
|
||||
if (($err_type & E_WARNING) === 0 && ($err_type & E_NOTICE) === 0) {
|
||||
return false;
|
||||
}
|
||||
$arr = array(
|
||||
$err_type,
|
||||
$errstr,
|
||||
//" in [".$errfile.']',
|
||||
" in [".get_path_this(get_path_father($errfile)).'/'.get_path_this($errfile).']',
|
||||
'line:'.$errline,
|
||||
);
|
||||
$str = implode(" ",$arr)."<br/>";
|
||||
show_tips($str);
|
||||
}
|
||||
|
||||
//捕获fatalError
|
||||
function fatalErrorHandler(){
|
||||
$e = error_get_last();
|
||||
switch($e['type']){
|
||||
case E_ERROR:
|
||||
case E_PARSE:
|
||||
case E_CORE_ERROR:
|
||||
case E_COMPILE_ERROR:
|
||||
case E_USER_ERROR:
|
||||
errorHandler($e['type'],$e['message'],$e['file'],$e['line']);
|
||||
break;
|
||||
case E_NOTICE:break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
||||
function show_tips($message,$url= '', $time = 3){
|
||||
ob_get_clean();
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
$goto = "content='$time;url=$url'";
|
||||
$info = "Auto jump after {$time}s, <a href='$url'>Click Here</a>";
|
||||
|
@ -318,10 +371,7 @@ function show_tips($message,$url= '', $time = 3){
|
|||
$goto = "";
|
||||
$info = "";
|
||||
} //是否自动跳转
|
||||
$message = nl2br(htmlentities($message,ENT_COMPAT,"utf-8"));
|
||||
$message = str_replace(
|
||||
array("<br/>","<br>","<b>","</b>"),
|
||||
array("<br/>","<br/>","<b>","</b>"), $message);
|
||||
$message = filter_html(nl2br($message));
|
||||
echo<<<END
|
||||
<html>
|
||||
<meta http-equiv='refresh' $goto charset="utf-8">
|
||||
|
@ -332,6 +382,7 @@ function show_tips($message,$url= '', $time = 3){
|
|||
#msgbox #info{margin-top: 10px;color:#aaa;font-size: 12px;}
|
||||
#msgbox #title{color: #888;border-bottom: 1px solid #ddd;padding: 10px 0;margin: 0 0 15px;font-size:18px;}
|
||||
#msgbox #info a{color: #64b8fb;text-decoration: none;padding: 2px 0px;border-bottom: 1px solid;}
|
||||
#msgbox a{text-decoration:none;color:#2196F3;}#msgbox a:hover{color:#f60;border-bottom:1px solid}
|
||||
</style>
|
||||
<body>
|
||||
<div id="msgbox">
|
||||
|
@ -384,7 +435,7 @@ function show_json($data,$code = true,$info=''){
|
|||
if ($info != '') {
|
||||
$result['info'] = $info;
|
||||
}
|
||||
ob_end_clean();
|
||||
ob_end_clean();
|
||||
header("X-Powered-By: kodExplorer.");
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode($result);
|
||||
|
@ -421,7 +472,7 @@ function getTplList($cute1, $cute2, $arraylist, $tpl,$current,$current_str=''){
|
|||
$html .= $temp;
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 去掉HTML代码中的HTML标签,返回纯文本
|
||||
|
|
|
@ -32,13 +32,18 @@
|
|||
|
||||
// 传入参数为程序编码时,有传出,则用程序编码,
|
||||
// 传入参数没有和输出无关时,则传入时处理成系统编码。
|
||||
|
||||
|
||||
if(!defined("DEFAULT_PERRMISSIONS")){
|
||||
define("DEFAULT_PERRMISSIONS",0755);
|
||||
}
|
||||
function iconv_app($str){
|
||||
if (!function_exists('iconv')){
|
||||
return $str;
|
||||
}
|
||||
global $config;
|
||||
$result = iconv($config['system_charset'], $config['app_charset'], $str);
|
||||
if (strlen($result)==0) {//转换失败
|
||||
$result = @iconv($config['system_charset'], $config['app_charset'], $str);
|
||||
if (!$result || strlen($result)==0) {//转换失败
|
||||
$result = $str;
|
||||
}
|
||||
return $result;
|
||||
|
@ -48,8 +53,8 @@ function iconv_system($str){
|
|||
return $str;
|
||||
}
|
||||
global $config;
|
||||
$result = iconv($config['app_charset'], $config['system_charset'], $str);
|
||||
if (strlen($result)==0) {//转换失败
|
||||
$result = @iconv($config['app_charset'], $config['system_charset'], $str);
|
||||
if (!$result || strlen($result)==0) {//转换失败
|
||||
$result = $str;
|
||||
}
|
||||
return $result;
|
||||
|
@ -140,7 +145,7 @@ function path_readable($path){
|
|||
$mode = get_mode($path);
|
||||
if( $mode &&
|
||||
strlen($mode) == 18 &&
|
||||
substr($mode,-9,1) == 'r'){// -rwx rwx rwx(0777)
|
||||
substr($mode,-9,1) == 'r'){// drwx rwx r-x(0775)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -153,7 +158,7 @@ function path_writeable($path){
|
|||
$mode = get_mode($path);
|
||||
if( $mode &&
|
||||
strlen($mode) == 18 &&
|
||||
substr($mode,-8,1) == 'w'){// -rwx rwx rwx (0777)
|
||||
substr($mode,-8,1) == 'w'){// drwx rwx r-x(0775)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -415,7 +420,7 @@ function path_haschildren($dir,$check_file=false){
|
|||
*/
|
||||
function del_file($fullpath){
|
||||
if (!@unlink($fullpath)) { // 删除不了,尝试修改文件权限
|
||||
@chmod($fullpath, 0777);
|
||||
@chmod($fullpath, DEFAULT_PERRMISSIONS);
|
||||
if (!@unlink($fullpath)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -430,20 +435,20 @@ function del_file($fullpath){
|
|||
function del_dir($dir){
|
||||
if(!file_exists($dir) || !is_dir($dir)) return true;
|
||||
if (!$dh = opendir($dir)) return false;
|
||||
@set_time_limit(0);
|
||||
ignore_timeout();
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
if ($file != "." && $file != "..") {
|
||||
$fullpath = $dir . '/' . $file;
|
||||
if (!is_dir($fullpath)) {
|
||||
if (!unlink($fullpath)) { // 删除不了,尝试修改文件权限
|
||||
chmod($fullpath, 0777);
|
||||
chmod($fullpath, DEFAULT_PERRMISSIONS);
|
||||
if (!unlink($fullpath)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!del_dir($fullpath)) {
|
||||
chmod($fullpath, 0777);
|
||||
chmod($fullpath, DEFAULT_PERRMISSIONS);
|
||||
if (!del_dir($fullpath)) return false;
|
||||
}
|
||||
}
|
||||
|
@ -472,7 +477,7 @@ function copy_dir($source, $dest){
|
|||
if (!$dest) return false;
|
||||
if (is_dir($source) && $source == substr($dest,0,strlen($source))) return false;//防止父文件夹拷贝到子文件夹,无限递归
|
||||
|
||||
@set_time_limit(0);
|
||||
ignore_timeout();
|
||||
$result = true;
|
||||
if (is_file($source)) {
|
||||
if ($dest[strlen($dest)-1] == '/') {
|
||||
|
@ -481,13 +486,13 @@ function copy_dir($source, $dest){
|
|||
$__dest = $dest;
|
||||
}
|
||||
$result = @copy($source, $__dest);
|
||||
@chmod($__dest, 0777);
|
||||
@chmod($__dest, DEFAULT_PERRMISSIONS);
|
||||
}else if(is_dir($source)) {
|
||||
if ($dest[strlen($dest)-1] == '/') {
|
||||
$dest = $dest . basename($source);
|
||||
}
|
||||
if (!is_dir($dest)) {
|
||||
@mkdir($dest,0777);
|
||||
@mkdir($dest,DEFAULT_PERRMISSIONS);
|
||||
}
|
||||
if (!$dh = opendir($source)) return false;
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
|
@ -507,7 +512,7 @@ function copy_dir($source, $dest){
|
|||
function move_path2($source,$dest,$repeat_add='',$repeat_type='replace'){
|
||||
if (!$dest) return false;
|
||||
if (is_dir($source) && $source == substr($dest,0,strlen($source))) return false;//防止父文件夹拷贝到子文件夹,无限递归
|
||||
@set_time_limit(0);
|
||||
ignore_timeout();
|
||||
if (is_file($source)) {
|
||||
return move_file($source,$dest,$repeat_add,$repeat_type);
|
||||
}else if(is_dir($source)) {
|
||||
|
@ -515,7 +520,7 @@ function move_path2($source,$dest,$repeat_add='',$repeat_type='replace'){
|
|||
$dest = $dest . basename($source);
|
||||
}
|
||||
if (!file_exists($dest)) {
|
||||
@mkdir($dest,0777);
|
||||
@mkdir($dest,DEFAULT_PERRMISSIONS);
|
||||
}
|
||||
if (!$dh = opendir($source)) return false;
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
|
@ -540,7 +545,7 @@ function move_path($source,$dest,$repeat_add='',$repeat_type='replace'){
|
|||
if (!$dest || !file_exists($source)) return false;
|
||||
if (is_dir($source) && $source == substr($dest,0,strlen($source))) return false;//防止父文件夹拷贝到子文件夹,无限递归
|
||||
|
||||
@set_time_limit(0);
|
||||
ignore_timeout();
|
||||
if(is_file($source)){
|
||||
return move_file($source,$dest,$repeat_add,$repeat_type);
|
||||
}
|
||||
|
@ -576,7 +581,7 @@ function move_path($source,$dest,$repeat_add='',$repeat_type='replace'){
|
|||
* @param int $mode
|
||||
* @return bool
|
||||
*/
|
||||
function mk_dir($dir, $mode = 0777){
|
||||
function mk_dir($dir, $mode = DEFAULT_PERRMISSIONS){
|
||||
if (is_dir($dir) || @mkdir($dir, $mode)){
|
||||
return true;
|
||||
}
|
||||
|
@ -750,7 +755,7 @@ function file_search($path,$search,$is_case){
|
|||
* @return :string
|
||||
*/
|
||||
function chmod_path($path,$mod){
|
||||
if (!isset($mod)) $mod = 0777;
|
||||
if (!isset($mod)) $mod = DEFAULT_PERRMISSIONS;
|
||||
if (!file_exists($path)) return;
|
||||
if (is_file($path)) return @chmod($path,$mod);
|
||||
if (!$dh = @opendir($path)) return false;
|
||||
|
@ -863,7 +868,7 @@ function file_put_out($file,$download=false){
|
|||
$filename = iconv_app(get_path_this($file));
|
||||
}
|
||||
|
||||
@set_time_limit(0);
|
||||
ignore_timeout();
|
||||
ob_end_clean();
|
||||
$mime = get_file_mime(get_path_ext($file));
|
||||
$time = gmdate('D, d M Y H:i:s', filemtime($file));
|
||||
|
@ -940,7 +945,7 @@ function file_put_out($file,$download=false){
|
|||
* 支持fopen的打开都可以;支持本地、url
|
||||
*/
|
||||
function file_download_this($from, $file_name,$header_size=0){
|
||||
@set_time_limit(0);
|
||||
ignore_timeout();
|
||||
if ($fp = @fopen ($from, "rb")){
|
||||
if(!$download_fp = @fopen($file_name, "wb")){
|
||||
return false;
|
||||
|
|
|
@ -9,26 +9,59 @@ if(UPDATE_DEV){
|
|||
define('THE_DATA_PATH',DATA_PATH);
|
||||
}
|
||||
|
||||
function update_check($self_file){
|
||||
//version <3.3 to 3.36
|
||||
if( file_exists(THE_DATA_PATH.'system/member.php')){
|
||||
new updateToV330($self_file);
|
||||
header('location:./index.php?user/logout');
|
||||
exit;
|
||||
function update_check(){
|
||||
//from <=3.23 to last
|
||||
if( file_exists(THE_DATA_PATH.'system/member.php') &&
|
||||
!file_exists(THE_DATA_PATH.'system/system_member.php')){
|
||||
new updateToV330();
|
||||
update_clear();
|
||||
}
|
||||
$system = THE_DATA_PATH.'system/system_setting.php';
|
||||
$data = fileCache::load($file_in);
|
||||
if( file_exists($system) &&
|
||||
(is_array($data) && !isset($data['current_version']) )
|
||||
){//不是3.30~3.36
|
||||
return;
|
||||
|
||||
//from [3.30~3.35] to last
|
||||
$system_file = THE_DATA_PATH.'system/system_setting.php';
|
||||
$system_data = fileCache::load($system_file);
|
||||
if( file_exists($system_file) &&
|
||||
(is_array($system_data) && !isset($system_data['current_version']) )
|
||||
){
|
||||
update330To336();
|
||||
update_clear();
|
||||
}
|
||||
//3.3x ~ 3.36;
|
||||
update330To336($self_file);
|
||||
|
||||
//from 3.36 to last
|
||||
update_clear();
|
||||
}
|
||||
|
||||
// 还原用户目录
|
||||
function update330To336($self_file){
|
||||
|
||||
function update_clear(){
|
||||
//更新版本号
|
||||
$file = THE_DATA_PATH.'system/system_setting.php';
|
||||
if(file_exists($file)){
|
||||
updateToV330::init_system();
|
||||
}
|
||||
|
||||
del_file(THE_DATA_PATH.'system/group.php');
|
||||
del_file(THE_DATA_PATH.'system/member.php');
|
||||
del_file(BASIC_PATH.'readme.txt');
|
||||
del_file(THE_DATA_PATH.'2.0-3.23.zip');
|
||||
del_file(THE_DATA_PATH.'2.0-3.34.zip');
|
||||
del_file(THE_DATA_PATH.'2.0-3.35.zip');
|
||||
del_file(THE_DATA_PATH.'2.0-'.KOD_VERSION.'.zip');
|
||||
del_file(THE_DATA_PATH.'system/update.lock');
|
||||
|
||||
del_dir(THE_DATA_PATH.'i18n');
|
||||
del_dir(THE_DATA_PATH.'thumb');
|
||||
del_dir(BASIC_PATH.'__MACOSX');
|
||||
del_dir(THE_DATA_PATH.'session');
|
||||
mk_dir(THE_DATA_PATH.'session');
|
||||
mk_dir(THE_DATA_PATH.'temp/thumb');
|
||||
|
||||
del_file(__FILE__);
|
||||
header('location:./index.php?user/logout');
|
||||
exit;
|
||||
}
|
||||
|
||||
// 还原用户目录 3.30~3.35之间
|
||||
function update330To336(){
|
||||
//change user path
|
||||
$the_file = THE_DATA_PATH.'system/system_member.php';
|
||||
$the_data = fileCache::load($the_file);
|
||||
|
@ -72,15 +105,13 @@ function update330To336($self_file){
|
|||
}
|
||||
fileCache::save($the_file,$the_data);
|
||||
updateToV330::init_system();
|
||||
del_file($self_file);
|
||||
del_file(THE_DATA_PATH.'2.0-'.KOD_VERSION.'.zip');
|
||||
}
|
||||
|
||||
|
||||
class updateToV330{
|
||||
private $user_array;
|
||||
private $role_array;
|
||||
function __construct($self_file) {
|
||||
function __construct() {
|
||||
$update_lock = THE_DATA_PATH.'system/update.lock';
|
||||
if(file_exists($update_lock)){
|
||||
show_tips("正在升级中,请稍后(Updating...)");
|
||||
|
@ -94,13 +125,9 @@ class updateToV330{
|
|||
$this->user_array = array();
|
||||
$this->role_array = array();
|
||||
$this->init_role();
|
||||
$result = $this->init_user();
|
||||
$this->init_user();
|
||||
$this->init_group();
|
||||
$this->init_system();
|
||||
if($result){
|
||||
$this->clear_path();
|
||||
del_file($self_file);
|
||||
}
|
||||
}
|
||||
private function init_role(){
|
||||
$file_in = THE_DATA_PATH.'system/group.php';
|
||||
|
@ -199,8 +226,10 @@ class updateToV330{
|
|||
fileCache::save($file_in,$data);
|
||||
}
|
||||
private function init_user(){
|
||||
$file_in = THE_DATA_PATH.'system/member.php';
|
||||
$file_in = THE_DATA_PATH.'system/member_old.php';
|
||||
$file_out = THE_DATA_PATH.'system/system_member.php';
|
||||
@rename(THE_DATA_PATH.'system/member.php',$file_in);//backup
|
||||
|
||||
$data = fileCache::load($file_in);
|
||||
$data_new = array();
|
||||
$default =array(
|
||||
|
@ -247,7 +276,7 @@ class updateToV330{
|
|||
$this->reset_user_config($value);
|
||||
$data_new[$id] = $value;
|
||||
}
|
||||
return fileCache::save($file_out,$data_new);
|
||||
fileCache::save($file_out,$data_new);
|
||||
}
|
||||
static function init_system(){
|
||||
$file_in = THE_DATA_PATH.'system/system_setting.php';
|
||||
|
@ -261,25 +290,7 @@ class updateToV330{
|
|||
$data[$key] = $value;
|
||||
}
|
||||
}
|
||||
$data['need_check_code'] = '0';
|
||||
$data['current_version'] = KOD_VERSION;
|
||||
fileCache::save($file_out,$data);
|
||||
}
|
||||
private function clear_path(){
|
||||
@rename(THE_DATA_PATH.'system/member.php',THE_DATA_PATH.'system/member_old.php');//backup
|
||||
del_file(THE_DATA_PATH.'system/group.php');
|
||||
del_file(BASIC_PATH.'readme.txt');
|
||||
//del_file(BASIC_PATH.'README.md');
|
||||
del_file(THE_DATA_PATH.'2.0-3.34.zip');
|
||||
del_file(THE_DATA_PATH.'2.0-3.35.zip');
|
||||
del_file(THE_DATA_PATH.'2.0-'.KOD_VERSION.'.zip');
|
||||
del_file(THE_DATA_PATH.'system/update.lock');
|
||||
|
||||
del_dir(THE_DATA_PATH.'i18n');
|
||||
del_dir(THE_DATA_PATH.'thumb');
|
||||
del_dir(BASIC_PATH.'__MACOSX');
|
||||
del_dir(THE_DATA_PATH.'session');
|
||||
mk_dir(THE_DATA_PATH.'session');
|
||||
mk_dir(THE_DATA_PATH.'temp/thumb');
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -78,6 +78,12 @@ var quoteEncode = function(str){
|
|||
var canvasSupport = function() {
|
||||
return !!document.createElement('canvas').getContext;
|
||||
}
|
||||
var isWap = function(){
|
||||
if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//var obj1 = $.extend({}, obj);//浅拷贝
|
||||
//var obj2 = $.extend(true, {}, obj);//深拷贝
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -32,12 +32,23 @@ a.button:active { color: #000; border-color: #444;}
|
|||
a.button:focus { outline: none;}
|
||||
|
||||
|
||||
.init_loading{position:fixed;left:50%;margin-left:-80px;top:40%;font-size:1.25em;z-index:999999;width:auto;}
|
||||
.init_loading div{padding:20px;background:#000;opacity:0.6;margin:0 auto;color:#FFF;
|
||||
border-radius:6px;text-align:center;line-height:30px;}
|
||||
.init_loading img{border-radius:10px;}
|
||||
|
||||
|
||||
.fileList_list {width: 100%; z-index: 0;cursor: pointer;}
|
||||
.fileList_list .app_link { height: 14px; width: 14px; margin-left: 10px; margin-top: 5px; position: absolute; font-size: 12px; color: #666;}
|
||||
.fileList_list .app_link::before { font-family: FontAwesome; content: "\f064"; color: #fff; text-shadow: 0 0 5px #333;}
|
||||
.fileList_list .file { color: #225;width: 100%;height:50px;border-bottom: 1px solid #ddd;}
|
||||
.fileList_list .file {
|
||||
color: #225;width: 100%;height:50px;border-bottom: 1px solid #ddd;
|
||||
border-bottom: solid 1px #f6f6f6;position: relative;
|
||||
}
|
||||
|
||||
/*.fileList_list .file2 { background: #fff3d9;}*/
|
||||
.fileList_list .file {border-bottom: solid 1px #f6f6f6;position: relative;}
|
||||
/*.fileList_list .file:hover{background:#def;border-bottom-color:#def;}*/
|
||||
|
||||
|
||||
.fileList_list .file .filename,.fileList_list .file .filesize,.fileList_list .file .filetime
|
||||
{line-height: 25px; height: 25px; font-size: 12px;padding-left:50px;color:#bbb;}
|
||||
|
@ -383,6 +394,13 @@ body{overflow-x: hidden;}
|
|||
.menu-open .panel-menu{left:0px;}
|
||||
.menu-open{overflow: hidden;}
|
||||
|
||||
.frame-main .panel-mask{display:none;}
|
||||
.menu-open .frame-main .panel-mask{
|
||||
display: block;z-index: 9999;
|
||||
position:absolute;left:0;right:0;top:0;bottom:0;
|
||||
background:#000;opacity:0.1;filter: alpha(opacity=10);
|
||||
}
|
||||
|
||||
.file-action{position: absolute;right: 0px;margin-top: -40px;font-size: 14px;color:#aaa;padding: 10px 15px;}
|
||||
.file_action_menu{
|
||||
height: 48px;
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
<link href="<?php echo STATIC_PATH;?>style/wap/app_explorer.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="init_loading"><div><img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif"/></div></div>
|
||||
<div class="panel-menu">
|
||||
<div class="panel-hd">
|
||||
<span class="my-avator"> <img src="./static/images/common/pic.jpg"> </span>
|
||||
<span class="my-avator"> <img src="<?php echo STATIC_PATH;?>images/common/pic.jpg"> </span>
|
||||
<div><h3 class="name"><?php echo $_SESSION['kod_user']['name'];?></h3></div>
|
||||
</div>
|
||||
<ul>
|
||||
|
@ -30,10 +31,10 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div class="frame-main">
|
||||
<div class="panel-mask"></div>
|
||||
<div class="frame-header">
|
||||
<div class="tool left_tool"><i class="font-icon icon-list"></i></div>
|
||||
<div class="title"><?php echo $L['kod_name'];?></div>
|
||||
|
||||
<div class="menu_group">
|
||||
<div class="tool right_tool"><i class="font-icon icon-ellipsis-vertical"></i></div>
|
||||
<ul class="dropdown-menu menu-right_tool pull-right animated menuShow" role="menu">
|
||||
|
|
Loading…
Reference in New Issue