Permalink
Browse files

version 3.37

  • Loading branch information...
1 parent 8e76436 commit 4b2c33663f9bfff91db9b7690c45f92ef94e4ad5 @kalcaddle committed Jan 9, 2017
Showing with 139 additions and 125 deletions.
  1. +14 −17 config/config.php
  2. +2 −2 controller/user.class.php
  3. +1 −1 controller/util.php
  4. +1 −1 data/system/system_group.php
  5. +1 −1 data/system/system_member.php
  6. +1 −1 lib/class/.cache_data
  7. +4 −2 lib/core/Application.class.php
  8. +8 −8 lib/function/common.function.php
  9. +22 −4 lib/update.php
  10. +3 −3 static/js/app/src/app/main.js
  11. +5 −5 static/js/app/src/desktop/main.js
  12. +4 −4 static/js/app/src/edit/main.js
  13. +3 −3 static/js/app/src/editor/main.js
  14. +7 −7 static/js/app/src/explorer/main.js
  15. +4 −4 static/js/app/src/explorer_wap/main.js
  16. +3 −3 static/js/app/src/setting/main.js
  17. +5 −5 static/js/app/src/share_editor/main.js
  18. +3 −3 static/js/app/src/share_explorer/main.js
  19. +3 −3 static/js/app/src/share_index/main.js
  20. +3 −3 static/js/app/src/user/main.js
  21. +7 −10 static/js/lib/util.js
  22. +2 −2 static/style/skin/alpha_image.css
  23. +2 −2 static/style/skin/alpha_image_sky.css
  24. +2 −2 static/style/skin/alpha_image_sun.css
  25. +3 −3 static/style/skin/base/app_code_edit.css
  26. +2 −2 static/style/skin/base/app_desktop.css
  27. +2 −2 static/style/skin/base/app_editor.css
  28. +2 −2 static/style/skin/base/app_explorer.css
  29. +2 −2 static/style/skin/base/app_setting.css
  30. +2 −2 static/style/skin/diy.css
  31. +2 −2 static/style/skin/mac.css
  32. +2 −2 static/style/skin/metro.css
  33. +2 −2 static/style/skin/metro_green.css
  34. +2 −2 static/style/skin/metro_orange.css
  35. +2 −2 static/style/skin/metro_pink.css
  36. +2 −2 static/style/skin/metro_purple.css
  37. +2 −2 static/style/skin/win10.css
  38. +2 −2 static/style/skin/win7.css
View
@@ -60,28 +60,25 @@
// https://view.officeapps.live.com/op/view.aspx?src=
-include_once(FUNCTION_DIR.'common.function.php');
+include(FUNCTION_DIR.'common.function.php');
$config['app_startTime'] = mtime();
-include_once(FUNCTION_DIR.'web.function.php');
-include_once(FUNCTION_DIR.'file.function.php');
-include_once(CORER_DIR.'Application.class.php');
-include_once(CORER_DIR.'Controller.class.php');
-include_once(CORER_DIR.'Model.class.php');
-include_once(CLASS_DIR.'fileCache.class.php');
-include_once(CLASS_DIR.'mcrypt.class.php');
-include_once(CONTROLLER_DIR.'system_member.class.php');
-include_once(CONTROLLER_DIR.'system_group.class.php');
-include_once(CONTROLLER_DIR.'system_role.class.php');
-include_once(CONTROLLER_DIR.'util.php');
-include_once(BASIC_PATH.'config/setting.php');
-include_once(BASIC_PATH.'config/version.php');
+include(FUNCTION_DIR.'web.function.php');
+include(FUNCTION_DIR.'file.function.php');
+include(CORER_DIR.'Application.class.php');
+include(CORER_DIR.'Controller.class.php');
+include(CORER_DIR.'Model.class.php');
+include(CLASS_DIR.'fileCache.class.php');
+include(CLASS_DIR.'mcrypt.class.php');
+include(CONTROLLER_DIR.'system_member.class.php');
+include(CONTROLLER_DIR.'system_group.class.php');
+include(CONTROLLER_DIR.'system_role.class.php');
+include(CONTROLLER_DIR.'util.php');
+include(BASIC_PATH.'config/setting.php');
+include(BASIC_PATH.'config/version.php');
define('WEB_ROOT',get_webroot(BASIC_PATH));
define('HOST',get_host().'/');
define('APPHOST',HOST.str_replace(WEB_ROOT,'',BASIC_PATH));//程序根目录
-//数据地址定义。
-$config['pic_thumb'] = BASIC_PATH.'data/thumb/'; // 缩略图生成存放地址
-$config['cache_dir'] = BASIC_PATH.'data/cache/'; // 缓存文件地址
$config['app_charset'] = 'utf-8'; //该程序整体统一编码
$config['settings']['static_path'] = "./static/"; //静态文件目录
@@ -81,7 +81,7 @@ public function loginCheck(){
private function login_success($user){
$this->user = $user;
if(!$user['path']){//服务器管理后立即生效
- $this->login($this->L['kod_version_error']);
+ $this->login("Your 'path' is empty,please install again!");
}else if($user['status'] == 0){
$this->login($this->L['login_error_user_not_use']);
}else if($user['role']==''){
@@ -275,7 +275,7 @@ public function loginFirst(){
$user = $sql->get($root);
$user['password'] = md5($this->in['password']);
$sql->set($root,$user);
- if( $user['path'] == '' && $user['create_time'] == ''){
+ if($user['create_time'] == ''){
$member = new system_member();
$member->init_install();
}
View
Oops, something went wrong.
@@ -1 +1 @@
-<?php exit;?>{"1":{"group_id":1,"name":"public","parent_id":"","children":"","config":{"size_max":0,"size_use":0},"path":"","create_time":""}}
+<?php exit;?>{"1":{"group_id":1,"name":"public","parent_id":"","children":"","config":{"size_max":0,"size_use":0},"path":"public","create_time":""}}
@@ -1 +1 @@
-<?php exit;?>{"1":{"user_id":"1","name":"admin","password":"21232f297a57a5a743894a0e4a801fc3","role":"1","config":{"size_max":1,"size_use":5369},"group_info":{"1":"write"},"path":"","status":1,"create_time":"","size_max":"1","last_login":""},"100":{"user_id":"100","name":"demo","password":"fe01ce2a7fbac8fafaed7c982a04e229","role":"2","config":{"size_max":5,"size_use":1048576},"group_info":{"1":"read"},"path":"","status":1,"last_login":"","create_time":""},"101":{"user_id":"101","name":"guest","password":"084e0343a0486ff05530df6c705c8bb4","role":"100","config":{"size_max":0.1,"size_use":1048576},"group_info":{"1":"read"},"path":"","status":1,"last_login":"","create_time":""}}
+<?php exit;?>{"1":{"user_id":"1","name":"admin","password":"21232f297a57a5a743894a0e4a801fc3","role":"1","config":{"size_max":1,"size_use":5369},"group_info":{"1":"write"},"path":"admin","status":1,"create_time":"","size_max":"1","last_login":""},"100":{"user_id":"100","name":"demo","password":"fe01ce2a7fbac8fafaed7c982a04e229","role":"2","config":{"size_max":5,"size_use":1048576},"group_info":{"1":"read"},"path":"demo","status":1,"last_login":"","create_time":""},"101":{"user_id":"101","name":"guest","password":"084e0343a0486ff05530df6c705c8bb4","role":"100","config":{"size_max":0.1,"size_use":1048576},"group_info":{"1":"read"},"path":"guest","status":1,"last_login":"","create_time":""}}
Oops, something went wrong.
@@ -48,10 +48,12 @@ public function setSubDir($dir){
public function appRun($class,$function){
$sub_dir = $this -> sub_dir ? $this -> sub_dir . '/' : '';
$class_file = CONTROLLER_DIR . $sub_dir.$class.'.class.php';
- if (!is_file($class_file)) {
+ if (!file_exists($class_file)) {
show_tips($class.' controller not exists!');
}
- require_once $class_file;
+ if (!class_exists($class)) {
+ include($class_file);
+ }
if (!class_exists($class)) {
show_tips($class.' class not exists');
}
@@ -11,13 +11,13 @@
*/
function _autoload($className){
if (file_exists(CLASS_DIR . strtolower($className) . '.class.php')) {
- require_once(CLASS_DIR . strtolower($className) . '.class.php');
+ include(CLASS_DIR . strtolower($className) . '.class.php');
} else if (file_exists(CONTROLLER_DIR . strtolower($className) . '.class.php')) {
- require_once(CONTROLLER_DIR . strtolower($className) . '.class.php');
+ include(CONTROLLER_DIR . strtolower($className) . '.class.php');
} else if (file_exists(MODEl_DIR . strtolower($className) . '.class.php')) {
- require_once(MODEl_DIR . strtolower($className) . '.class.php');
+ include(MODEl_DIR . strtolower($className) . '.class.php');
} else {
- // error code;
+ show_tips($className.' is not exist');
}
}
@@ -27,7 +27,7 @@ function _autoload($className){
function init_model($model_name){
if (!class_exists($model_name.'Model')) {
$model_file = MODEL_DIR.$model_name.'Model.class.php';
- require_once ($model_file);
+ include($model_file);
if(!is_file($model_file)){
return false;
}
@@ -46,7 +46,7 @@ function init_controller($controller_name){
if(!is_file($model_file)){
return false;
}
- require_once ($model_file);
+ include($model_file);
}
$reflectionObj = new ReflectionClass($controller_name);
$args = func_get_args();
@@ -60,7 +60,7 @@ function init_controller($controller_name){
function load_class($class){
$filename = CLASS_DIR.$class.'.class.php';
if (file_exists($filename)) {
- require_once($filename);
+ include($filename);
}else{
show_tips($filename.' is not exist');
}
@@ -71,7 +71,7 @@ function load_class($class){
function load_function($function){
$filename = FUNCTION_DIR.$function.'.function.php';
if (file_exists($filename)) {
- require_once($filename);
+ include($filename);
}else{
show_tips($filename.' is not exist');
}
View
@@ -1,6 +1,8 @@
<?php
+define('UPDATE_VERSION','');
define('UPDATE_DEV',false);
+
if(UPDATE_DEV){
define('THE_DATA_PATH',WEB_ROOT.'self/kod/3.23/data/');
del_dir(THE_DATA_PATH);
@@ -10,6 +12,8 @@
}
function update_check(){
+ unzip_repeat();//再次解压,避免windows部分主机解压失败问题
+
//from <=3.23 to last
if( file_exists(THE_DATA_PATH.'system/member.php') &&
!file_exists(THE_DATA_PATH.'system/system_member.php')){
@@ -31,21 +35,35 @@ function update_check(){
update_clear();
}
+function unzip_repeat(){
+ $zip_file = THE_DATA_PATH.'2.0-'.UPDATE_VERSION.'.zip';
+ if(!file_exists($zip_file)){
+ return;
+ }
+ $unzip_to = BASIC_PATH;
+ load_class('pclzip');
+ $zip = new PclZip($zip_file);
+ $result = $zip->extract(PCLZIP_OPT_PATH,$unzip_to,
+ PCLZIP_OPT_REPLACE_NEWER);
+}
+
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.'2.0-'.UPDATE_VERSION.'.zip');
+
+ del_file(BASIC_PATH.'readme.txt');
+ del_file(BASIC_PATH.'controller/group.class.php');
+ del_file(BASIC_PATH.'controller/member.class.php');
del_dir(THE_DATA_PATH.'i18n');
del_dir(THE_DATA_PATH.'thumb');
@@ -195,7 +213,7 @@ private function init_group(){//新建
$item_path = iconv_system($group_path.$arr['path'].'/');
mk_dir($item_path.'data');
mk_dir($item_path.'recycle');
- if(file_exists($public)){
+ if(file_exists($public)){//移动文件耗时操作;放最后;
if(! @rename($public,$item_path.'home')){
move_path($public,$item_path.'home');
}
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
View
@@ -431,7 +431,7 @@ function download(data, strFileName, strMimeType) {
}else{
return navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs:
navigator.msSaveBlob(dataUrlToBlob(payload), fileName) :
- saver(payload) ; // everyone else can save dataURLs un-processed
+ saveToData(payload) ; // everyone else can save dataURLs un-processed
}
}//end if dataURL passed?
@@ -451,7 +451,7 @@ function download(data, strFileName, strMimeType) {
return new myBlob([uiArr], {type: type});
}
- function saver(url, winMode){
+ function saveToData(url, winMode){
if ('download' in anchor) { //html5 A[download]
anchor.href = url;
anchor.setAttribute("download", fileName);
@@ -485,18 +485,15 @@ function download(data, strFileName, strMimeType) {
return navigator.msSaveBlob(blob, fileName);
}
if(self.URL){
- saver(self.URL.createObjectURL(blob), true);
+ saveToData(self.URL.createObjectURL(blob), true);
}else{
- if(typeof blob === "string" || blob.constructor===toString ){
- try{
- return saver( "data:" + mimeType + ";base64," + self.btoa(blob) );
- }catch(y){
- return saver( "data:" + mimeType + "," + encodeURIComponent(blob) );
- }
+ if( typeof(blob) === "string" ||
+ blob.constructor===toString ){
+ return saveToData("data:"+mimeType+";base64,"+window.btoa(blob));
}
reader=new FileReader();
reader.onload=function(e){
- saver(this.result);
+ saveToData(this.result);
};
reader.readAsDataURL(blob);
}
Oops, something went wrong.

0 comments on commit 4b2c336

Please sign in to comment.