Permalink
Browse files

version 3.37

1 parent af95284 commit 32ed2070bd48d7d0153fdd7b89c25f46de3838ee @kalcaddle committed Jan 5, 2017
Showing with 306 additions and 180 deletions.
  1. +17 −0 ChangeLog.md
  2. +2 −1 config/config.php
  3. +2 −2 config/setting.php
  4. +1 −1 config/version.php
  5. +6 −0 controller/desktop.class.php
  6. +17 −9 controller/explorer.class.php
  7. +1 −1 controller/share.class.php
  8. +3 −1 controller/user.class.php
  9. +1 −1 controller/util.php
  10. +1 −1 index.php
  11. +1 −1 lib/class/.cache_data
  12. +1 −0 lib/class/imageThumb.class.php
  13. +2 −3 lib/class/myCaptcha.class.php
  14. +59 −8 lib/function/common.function.php
  15. +25 −20 lib/function/file.function.php
  16. +55 −44 lib/update.php
  17. +3 −3 static/js/app/src/app/main.js
  18. +5 −5 static/js/app/src/desktop/main.js
  19. +4 −4 static/js/app/src/edit/main.js
  20. +6 −6 static/js/app/src/editor/main.js
  21. +7 −7 static/js/app/src/explorer/main.js
  22. +4 −4 static/js/app/src/explorer_wap/main.js
  23. +2 −2 static/js/app/src/setting/main.js
  24. +3 −3 static/js/app/src/share_editor/main.js
  25. +5 −5 static/js/app/src/share_explorer/main.js
  26. +2 −2 static/js/app/src/share_index/main.js
  27. +3 −3 static/js/app/src/user/main.js
  28. +6 −0 static/js/lib/util.js
  29. +2 −2 static/style/skin/alpha_image.css
  30. +2 −2 static/style/skin/alpha_image_sky.css
  31. +2 −2 static/style/skin/alpha_image_sun.css
  32. +3 −3 static/style/skin/base/app_code_edit.css
  33. +3 −3 static/style/skin/base/app_desktop.css
  34. +3 −3 static/style/skin/base/app_editor.css
  35. +3 −3 static/style/skin/base/app_explorer.css
  36. +3 −3 static/style/skin/base/app_setting.css
  37. +2 −2 static/style/skin/diy.css
  38. +2 −2 static/style/skin/mac.css
  39. +2 −2 static/style/skin/metro.css
  40. +2 −2 static/style/skin/metro_green.css
  41. +2 −2 static/style/skin/metro_orange.css
  42. +2 −2 static/style/skin/metro_pink.css
  43. +2 −2 static/style/skin/metro_purple.css
  44. +2 −2 static/style/skin/win10.css
  45. +2 −2 static/style/skin/win7.css
  46. +20 −2 static/style/wap/app_explorer.css
  47. +3 −2 template/explorer/index_wap.php
View
@@ -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:
View
@@ -25,7 +25,7 @@
}
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('FUNCTION_DIR', LIB_DIR .'function/'); //函数库目录
define('CLASS_DIR', LIB_DIR .'class/'); //内目录
define('CORER_DIR', LIB_DIR .'core/'); //核心目录
+define('DEFAULT_PERRMISSIONS',0755); //新建文件、解压文件默认权限,777 部分虚拟主机限制了777
/*
* 可以数据目录;移到web目录之外,可以使程序更安全, 就不用限制用户的扩展名权限了;
View
@@ -11,7 +11,7 @@
'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 @@
'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}'
View
@@ -1,2 +1,2 @@
<?php
-define('KOD_VERSION','3.36');
+define('KOD_VERSION','3.37');
@@ -12,6 +12,12 @@ function __construct() {
$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 @@ public function mkfile(){
$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 @@ public function mkdir(){
}
$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 @@ private function _tree_fav(){
}
$the_fav = array(
'name' => $val['name'],
- 'ext' => $val['ext'],
+ 'ext' => isset($val['ext'])?$val['ext']:"",
'menuType' => "menuTreeFav",
'path' => $val['path'],
@@ -375,6 +375,13 @@ private function _tree_init($app){
$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 @@ private function _tree_init($app){
),
'public'=>array(
- 'name' => $this->L['public_path'],
+ 'name' => $group_root_name,
'menuType' => "menuTreeGroupRoot",
'ext' => "groupPublic",
'children' => $public,
@@ -856,7 +863,7 @@ public function zipDownload(){
}
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 @@ public function zip($zip_path=''){
}
}
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 @@ public function unzip(){
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 @@ private function zip($zip_path){
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 @@ public function common_js(){
*/
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 @@ public function logout(){
* 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 @@ public function qrcode(){
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']));
}
View
Oops, something went wrong.
View
@@ -1,6 +1,6 @@
<?php
ob_start();
- include ('./config/config.php');
+ include ('config/config.php');
$app = new Application();
init_config();
$app->run();
Oops, something went wrong.
@@ -208,6 +208,7 @@ public function imgRotate($toFile,$degree) {
// 输出图片,link---只输出,不保存文件。file--保存为文件
function echoImage($img, $toFile){
+ ob_get_clean();
$result = false;
switch ($this->echoType) {
case 'link':$result = imagePNG($img);break;
@@ -203,10 +203,9 @@ private function draw_line(&$img,$width,$height){
}
}
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,18 +329,49 @@ 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>";
if ($url == "") {
$goto = "";
$info = "";
} //是否自动跳转
- $message = nl2br(htmlentities($message,ENT_COMPAT,"utf-8"));
- $message = str_replace(
- array("&lt;br/&gt;","&lt;br&gt;","&lt;b&gt;","&lt;/b&gt;"),
- 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标签,返回纯文本
Oops, something went wrong.

0 comments on commit 32ed207

Please sign in to comment.