4.30 release.
parent
0b88917b40
commit
c7e3fdbdb0
111
ChangeLog.md
111
ChangeLog.md
|
@ -1,3 +1,114 @@
|
|||
### ver4.30 `2018/07/05`
|
||||
-----
|
||||
#### update:
|
||||
- 文件管理
|
||||
- 并发读写文件数据异常问题解决
|
||||
- 选中文件,自动出现快捷操作工具栏
|
||||
- icon列表模式,排序方式菜单按钮
|
||||
- 扩展名限制自动处理
|
||||
- 文档排序自然排序数字优化
|
||||
- 文件名结尾为空格时处理:文件操作、列表图标等处理
|
||||
- 正序倒序文件夹都在前面;
|
||||
- 新建文件、文件夹;根据语言自动命名。
|
||||
- 新建office文档直接放在右键中;去除无关扩展名新建 【新建Word/Excle/PowerPoint 文档】
|
||||
- 优化所有文件小图标显示:文件列表、右键菜单、对话框标题、标签栏图标等
|
||||
- 文件、文件夹属性优化:文件大小优化,非管理员隐藏真实权限相关内容
|
||||
- 新建文件和新建文件夹时,不输入文件名称,提示创建文件/文件夹成功,实际上目录下未出现文件夹/文件
|
||||
- 文件搜索样式、筛选逻辑优化
|
||||
- 系统及用户管理优化
|
||||
- 壁纸管理优化:登陆背景管理、桌面壁纸管理;
|
||||
- 记住密码优化本地存储;登陆密码传输加密
|
||||
- 用户管理支持批量设置用户空间大小
|
||||
- 用户昵称支持;
|
||||
- 用户新建修改;部门新建修改、部门权限组新建修改、部门新建修改;名称不能为空格
|
||||
- 设置部门优化: 部门只展开第一层级;设置用户部门自动展开到对应层级
|
||||
- 部门编辑,添加自己到子部门排除检测;
|
||||
- 系统管理员角色设置,隐藏设置项
|
||||
- 权限细节优化;部门下载权限,屏蔽相关入口(浏览器打开,zip文件内容下载)
|
||||
- 批量添加用户有重复时,列表自动刷新处理;
|
||||
- 上传优化:
|
||||
- 文件分片上传速度优化
|
||||
- 上传对话框关闭继续后台上传,上传完成自动隐藏对话框
|
||||
- 上传是否成功大小校验,空文件上传处理,报错提示及报错相关优化。
|
||||
- 权限前置判断:没有部门上传权限提前判断,空间不足提前判断
|
||||
- 文件夹上传,部分文件上传到文件夹外面的问题;
|
||||
- 文件大小为0时目录不存在则自动处理;
|
||||
- 分享优化:
|
||||
- 分享页面等打开方式统一优化处理,移动端打开方式按优先级处理;移动端office打开方式优化处理
|
||||
- 分享页面打印样式优化,针对文本、markdown专门处理
|
||||
- 加密码分享内容内部成员不可见;
|
||||
- 系统设置关闭用户列表则不展示用户分享数据;
|
||||
- 文件夹分享设置可上传,移动端没有上传处理
|
||||
- 分享文件重名时,文件预览打开方式关联失败;分享禁用下载时隐藏下载按钮;分享office支持onlyoffice预览;
|
||||
- 移动端打开需要密码的分享页面,输入密码问题;微信中图片分享优化;
|
||||
- 分享创建优化;加入快速复制分享链接;保存后自动关闭
|
||||
- 编辑器优化:
|
||||
- 新增开发相关实用工具:插入时间;繁简转换;base64编解码;URL编解码;文字选中生成二维码;md5等
|
||||
- 新增自由计算功能(实时编译执行)。
|
||||
- 编辑器打开文件,编辑器对话框置顶;
|
||||
- 编辑器着色优化;php格式化太长时优化处理。
|
||||
- 编辑器底部显示文件编码,点击切换、修改编码
|
||||
- 授权版:编辑器帮助中隐藏: 关于,了解更多
|
||||
- php格式化优化;
|
||||
- markdown编辑右侧工具栏菜单展开按钮点击自动显示隐藏;
|
||||
- markdown优化:打印样式处理;标题标签自动加入锚点跳转(分享页面、下载html统一处理)
|
||||
- 编辑器自动保存支持;配置开关
|
||||
- 其他优化:tab新增右键新窗口打开;新打开时不显示帮助,入口可加到工具栏
|
||||
- API 功能接口增强
|
||||
- 文件选择API优化:自动筛选符合选择的内容(同时支持双击打开、右键操作);移动端优化;返回值功能增强
|
||||
- 支持通过用户名获取用户信息。
|
||||
- 通用文件预览组件,预览未知文件处理;
|
||||
- hook绑定点加入show_json;
|
||||
- 插件增强及优化
|
||||
- 插件更新红点提示,新增一键更新
|
||||
- 插件安装更新链接请求走后端,提升安全性
|
||||
- 插件安装卸载权限加入权限体系
|
||||
- ofd,djvu 文件格式支持在线预览。客户端实时渲染,支持文本选中复制。
|
||||
- 视频播放器新增内置Dplayer;体验优化,支持弹幕、支持自动挂载字幕;
|
||||
- PSD/AI 等文件在线预览;视频缩略图生成;中文路径兼容linux,windows;检测问题提示;可执行文件可以手动指定;
|
||||
- 永中officedoc预览大纲,打印;样式优化;点聚office编辑保存生成历史版本记录
|
||||
- 音乐播放有概率出现.mp3格式的音乐无法播放的情况,一直在缓冲中,重启打开一次后,音乐正常播放
|
||||
- office配置自适应ip、端口处理
|
||||
- 插件重新启用(或升级);配置数据还原的问题
|
||||
- PSD在线预览插件优化;安装部署教程
|
||||
- 域账户插件:支持数据库存储;默认存储
|
||||
- 其他优化:
|
||||
- 界面样式诸多细节优化
|
||||
- 回收站文件右键菜单处理;
|
||||
- 右键菜单小图标样式优化;
|
||||
- 宽度不足时不显示文件选中时快捷菜单。
|
||||
- json_encode/json_decode 服务器兼容;
|
||||
- 页面加载、对话框加载loading处理优化
|
||||
- nginx自目录绑定相关url不一致问题兼容;nginx反向代理端口、url等跳转问题兼容
|
||||
- 优化对话框弹出层,iframe全屏调用问题
|
||||
- 对话框中iframe加载持续未完成loading自动隐藏处理
|
||||
- 一键清理Win中文乱码问题,清空位置完善
|
||||
- 移动端菜单中加入剪切功能;
|
||||
- https 优化;
|
||||
|
||||
#### fix bug
|
||||
- 搜索界面文件类型筛选条件不生效,筛选gif搜索了其他类型文件,文件类型筛选条件未生效
|
||||
- 新建部门创建文件夹从配置读取失败问题;
|
||||
- 移动端上传取消提示文字优化
|
||||
- 编辑器对话框,未保存文件关闭提示;
|
||||
- 多选打开文件,进入了打开方式
|
||||
- 移动端音乐播放界面最小化后,无法快速的恢复到窗口模式
|
||||
- 插件设置多次打开保存配置失败问题解决
|
||||
- 搜索文件内容报错问题,程序信息不显示任务栏,文件属性项目加入标记,文字修改:登陆==>登录;
|
||||
- DIY主题样式显示问题;
|
||||
- 搜索路径为空时优化处理,搜索文件内容json输出时乱码问题解决;
|
||||
- 勾选用户所在部门窗口,权限组名长导致换行问题,支持放大缩小。
|
||||
- dockeroffice 重启脚本优化
|
||||
- 视频、psd等缩略图浏览器缓存处理
|
||||
- 浏览器兼容处理:
|
||||
- Edge 浏览器样式优化处理
|
||||
- IE上传下拉菜单——上传文件item被隐藏了
|
||||
- IE上传进度条不匹配百分比问题
|
||||
- IE第二次双击打开视频,出现“没有支持此文件的应用”
|
||||
- ios系统safari登录问题优化
|
||||
|
||||
|
||||
|
||||
### ver4.25 `2017/12/01`
|
||||
-----
|
||||
#### update:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# KodExplorer
|
||||
|
||||
[![Home page](https://img.shields.io/badge/home-page-yellow.svg?style=flat)](http://kodcloud.com) [![GPLV3 License](https://img.shields.io/badge/Licence-GPLV3-green.svg?style=flat)](http://kodcloud.com) [![Download](http://kodcloud.com/tools/version/?analyze/download)](https://github.com/kalcaddle/KODExplorer/archive/master.zip)
|
||||
[![Home page](https://img.shields.io/badge/home-page-yellow.svg?style=flat)](http://kodcloud.com) [![GPLV3 License](https://img.shields.io/badge/Licence-GPLV3-green.svg?style=flat)](http://kodcloud.com) [![Download](http://api.kodcloud.com/?analyze/download)](https://github.com/kalcaddle/KODExplorer/archive/master.zip)
|
||||
|
||||
> KodExplorer is a file manager for web. It is also a web code editor, which allows you to develop websites directly within the web browser.You can run KodExplorer either online or locally,on Linux, Windows or Mac based platforms. The only requirement is to have PHP 5 available.
|
||||
|
||||
|
@ -11,8 +11,7 @@
|
|||
### [Demo](http://demo.kodcloud.com/) [user: demo/demo]
|
||||
-----
|
||||
- [Change log](./ChangeLog.md)
|
||||
- [English Document](http://kodcloud.com#lang=en)
|
||||
- [中文文档](http://kodcloud.com/#lang=zh_CN)
|
||||
- [Document/开发文档](http://doc.kodcloud.com/)
|
||||
- [Donate](https://www.paypal.me/kalcaddle)
|
||||
|
||||
### Source code
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<?php
|
||||
|
||||
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
require_once(dirname(dirname(__FILE__)).'/function/web.function.php');
|
||||
class SSO{
|
||||
static private function init(){
|
||||
|
@ -34,7 +38,7 @@ class SSO{
|
|||
@session_write_close();
|
||||
unset($_SESSION);
|
||||
@session_start();
|
||||
if(!$_SESSION['kodSSO']){
|
||||
if(!isset($_SESSION['kodSSO']) || !$_SESSION['kodSSO']){
|
||||
@session_save_path($sessionSavePath);//session path
|
||||
@session_start();
|
||||
$_SESSION['kodSSO'] = true;
|
||||
|
|
|
@ -20,6 +20,10 @@ class app extends Controller{
|
|||
}
|
||||
|
||||
public function initApp(){
|
||||
//为空则不初始化桌面
|
||||
if(!$this->config['settingSystem']['desktopFolder']){
|
||||
return;
|
||||
}
|
||||
$list = $this->sql->get();
|
||||
$newUserApp = $this->config['settingSystem']['newUserApp'];
|
||||
$default = explode(',',$newUserApp);
|
||||
|
|
|
@ -14,7 +14,7 @@ class desktop extends Controller{
|
|||
$wap = is_wap() && (!isset($_COOKIE['forceWap']) || $_COOKIE['forceWap'] == '1');
|
||||
$desktopApps = include(DATA_PATH.'system/desktop_app.php');
|
||||
$wall = $this->config['user']['wall'];
|
||||
if(strlen($wall)<3){
|
||||
if( !strstr($wall,'/') ){
|
||||
$wall = STATIC_PATH.'images/wall_page/'.$wall.'.jpg';
|
||||
}
|
||||
|
||||
|
|
|
@ -72,14 +72,14 @@ class editor extends Controller{
|
|||
if (!path_readable($filepath)){
|
||||
show_json(LNG('no_permission_read_all'),false);
|
||||
}
|
||||
if (filesize($filepath) >= 1024*1024*40){
|
||||
if (filesize($filepath) >= 1024*1024*20){
|
||||
show_json(LNG('edit_too_big'),false);
|
||||
}
|
||||
}
|
||||
|
||||
$fileContents=file_get_contents($filepath);//文件内容
|
||||
//echo $fileContents;exit;
|
||||
if(isset($this->in['charset'])){
|
||||
if(isset($this->in['charset']) && $this->in['charset']){
|
||||
$charset = strtolower($this->in['charset']);
|
||||
}else{
|
||||
$charset = get_charset($fileContents);
|
||||
|
@ -95,20 +95,9 @@ class editor extends Controller{
|
|||
'name' => iconv_app(get_path_this($displayName)),
|
||||
'filename' => $displayName,
|
||||
'charset' => $charset,
|
||||
'base64' => false,
|
||||
'content' => $fileContents
|
||||
'base64' => true,// 部分防火墙编辑文件误判问题处理
|
||||
'content' => base64_encode($fileContents)
|
||||
);
|
||||
// 部分防火墙编辑文件误判问题处理
|
||||
//if(!json_encode(array("data"=>$fileContents))){
|
||||
$data['content'] = base64_encode($fileContents);
|
||||
$data['base64'] = true;
|
||||
//}
|
||||
|
||||
// $data['size_before'] = filesize($filepath);
|
||||
// $data['size_after'] = strlen($fileContents);
|
||||
// $data['hex_before'] = bin2hex(file_get_contents($filepath));
|
||||
// $data['hex_after'] = bin2hex($fileContents);
|
||||
// $data['content_before'] = $fileContents;
|
||||
show_json($data);
|
||||
}
|
||||
public function fileSave(){
|
||||
|
|
|
@ -29,7 +29,7 @@ class explorer extends Controller{
|
|||
public function index(){
|
||||
$dir = '';
|
||||
if(isset($this->in['path']) && $this->in['path'] !=''){
|
||||
$dir = _DIR_CLEAR($_GET['path']);
|
||||
$dir = _DIR_CLEAR($this->in['path']);
|
||||
$dir = rtrim($dir,'/').'/';
|
||||
}
|
||||
$this->assign('dir',$dir);
|
||||
|
@ -81,6 +81,10 @@ class explorer extends Controller{
|
|||
isset($this->in['viewPage'])){
|
||||
$data['downloadPath'] = _make_file_proxy($file);
|
||||
}
|
||||
//所在部门,下载权限检测
|
||||
if($GLOBALS['kodPathRoleGroupAuth'] && !$GLOBALS['kodPathRoleGroupAuth']['explorer.fileDownload']){
|
||||
unset($data['downloadPath']);
|
||||
}
|
||||
if($data['size'] < 100*1024|| isset($this->in['getMd5'])){//100kb
|
||||
$data['fileMd5'] = @md5_file($file);
|
||||
}else{
|
||||
|
@ -130,6 +134,10 @@ class explorer extends Controller{
|
|||
$repeatType = $this->in['repeat_type'];
|
||||
}
|
||||
$new= rtrim($this->path,'/');
|
||||
$parent = get_path_father($this->path);
|
||||
if(!file_exists($parent)){
|
||||
mk_dir($parent);
|
||||
}
|
||||
$new = get_filename_auto($new,'',$repeatType);//已存在处理 创建副本
|
||||
Hook::trigger("explorer.mkfileBefore",$new);
|
||||
if(@touch($new)){
|
||||
|
@ -285,22 +293,21 @@ class explorer extends Controller{
|
|||
}
|
||||
}
|
||||
|
||||
//用户根目录
|
||||
//部门根目录
|
||||
private function _selfGroupLoad(&$root){
|
||||
foreach ($root as $key => $value) {
|
||||
if($value['name'] == 'share'){
|
||||
if($value['name'] == $GLOBALS['config']['settingSystem']['groupShareFolder']){
|
||||
$root[$key] = array(
|
||||
'name' => LNG('group_share'),
|
||||
'menuType' => "menu-folder folder-box",
|
||||
'ext' => "folder-share",
|
||||
'isParent' => true,
|
||||
'name' => LNG('group_share'),
|
||||
'menuType' => "menu-folder folder-box",
|
||||
'ext' => "folder-share",
|
||||
'isReadable' => true,
|
||||
'isWriteable' => true,
|
||||
|
||||
'path' => KOD_GROUP_PATH.':'.$GLOBALS['kodPathId'].'/share/',
|
||||
'type' => 'folder',
|
||||
'open' => false,
|
||||
'isParent' => false
|
||||
'path' => $value['path'],
|
||||
'type' => 'folder',
|
||||
'open' => false,
|
||||
'isParent' => $value['isParent']
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
@ -404,7 +411,6 @@ class explorer extends Controller{
|
|||
'isParent' => count($project)>0?true:false)
|
||||
);
|
||||
show_json($treeData);
|
||||
return;
|
||||
}
|
||||
$checkFile = ($app == 'editor'?true:false);
|
||||
$fav = $this->_treeFav($app);
|
||||
|
@ -526,6 +532,13 @@ class explorer extends Controller{
|
|||
show_json($result);
|
||||
}
|
||||
|
||||
private function _rootListGroup(){
|
||||
return $this->config['settingSystem']['rootListGroup'] == 1;
|
||||
}
|
||||
private function _rootListUser(){
|
||||
return $this->config['settingSystem']['rootListUser'] == 1;
|
||||
}
|
||||
|
||||
//session记录用户可以管理的组织;继承关系
|
||||
private function _groupTree($nodeId){//获取组织架构的用户和子组织;为空则获取根目录
|
||||
$groupSql = systemGroup::loadData();
|
||||
|
@ -533,11 +546,11 @@ class explorer extends Controller{
|
|||
$groupList = $this->_makeNodeList($groups);
|
||||
|
||||
//根群组不显示子群组
|
||||
if( $nodeId == '1' && !$this->config['settingSystem']['rootListGroup']){
|
||||
if( $nodeId == '1' && !$this->_rootListGroup() ){
|
||||
$groupList = array();
|
||||
}
|
||||
//根群组不显示用户
|
||||
if( $nodeId == '1' && !$this->config['settingSystem']['rootListUser']){
|
||||
if( $nodeId == '1' || !$this->_rootListUser() ){
|
||||
return $groupList;
|
||||
}
|
||||
|
||||
|
@ -589,8 +602,10 @@ class explorer extends Controller{
|
|||
$treeIcon = 'group-self';
|
||||
}
|
||||
$hasChildren = true;
|
||||
$userList = systemMember::userAtGroup($val['groupID']);
|
||||
|
||||
$userList = array();
|
||||
if( $this->_rootListUser() ){
|
||||
$userList = systemMember::userAtGroup($val['groupID']);
|
||||
}
|
||||
if(count($userList)==0 && $val['children']==''){
|
||||
$hasChildren = false;
|
||||
}
|
||||
|
@ -888,7 +903,7 @@ class explorer extends Controller{
|
|||
|
||||
Hook::trigger("explorer.pathRemoveBefore",$path,false);
|
||||
del_file($path);
|
||||
Hook::trigger("explorer.pathRemoveAfter",$path);
|
||||
//Hook::trigger("explorer.pathRemoveAfter",$path);
|
||||
}
|
||||
public function zipDownload(){
|
||||
$userTemp = iconv_system(USER_TEMP);
|
||||
|
@ -1027,7 +1042,8 @@ class explorer extends Controller{
|
|||
exit;
|
||||
}
|
||||
if (@filesize($this->path) <= 1024*50 ||
|
||||
!function_exists('imagecolorallocate') ) {//小于50k或者不支持gd库 不再生成缩略图
|
||||
!function_exists('imagecolorallocate') ||
|
||||
get_path_ext($this->path) == 'gif') {//小于50k、不支持gd库、gif图 不再生成缩略图
|
||||
file_put_out($this->path,false);
|
||||
return;
|
||||
}
|
||||
|
@ -1155,9 +1171,11 @@ class explorer extends Controller{
|
|||
$fullPath = _DIR_CLEAR(rawurldecode($this->in['fullPath']));
|
||||
$fullPath = get_path_father($fullPath);
|
||||
$fullPath = iconv_system($fullPath);
|
||||
if ($this->_mkdir($savePath.$fullPath)) {
|
||||
$savePath = $savePath.$fullPath;
|
||||
}
|
||||
$savePath = $savePath.$fullPath;
|
||||
mk_dir($savePath);
|
||||
// if ($this->_mkdir($savePath.$fullPath)) {
|
||||
// $savePath = $savePath.$fullPath;
|
||||
// }
|
||||
}
|
||||
//分片上传
|
||||
$repeatAction = $this->config['user']['fileRepeat'];
|
||||
|
@ -1170,7 +1188,12 @@ class explorer extends Controller{
|
|||
//分享根目录
|
||||
private function _pathShare(&$list){
|
||||
$arr = explode(',',$GLOBALS['kodPathId']);
|
||||
$shareList = systemMember::userShareList($arr[0]);
|
||||
|
||||
//不展示用户时;屏蔽获取其他人分享列表
|
||||
if( $arr[0] != $_SESSION['kodUser']['userID'] && !$this->_rootListUser()){
|
||||
return;
|
||||
}
|
||||
$shareList = systemMember::userShareList($arr[0]);
|
||||
$beforeShareId = $GLOBALS['kodPathIdShare'];
|
||||
foreach ($shareList as $key => $value) {
|
||||
$thePath = _DIR(KOD_USER_SHARE.':'.$arr[0].'/'.$value['name']);
|
||||
|
|
|
@ -27,12 +27,18 @@ class pluginApp extends Controller{
|
|||
}
|
||||
$model = $this->loadModel('Plugin');
|
||||
if(!$model->checkAuth($app)){
|
||||
show_tips("Plugin not open,or you have't permission[".$app."]");
|
||||
if(!$_SESSION['kodLogin']){
|
||||
show_tips("出错了!您尚未登录",APP_HOST,3);
|
||||
}
|
||||
show_tips("出错了!插件未开启,或您没有{$app}插件的权限");
|
||||
}
|
||||
|
||||
$appConfig = $model->getConfig($app);
|
||||
if(!$appConfig['pluginAuthOpen'] && !$this->checkAccessPlugin()){
|
||||
show_tips("Sorry! You have't permission[".$app."]");
|
||||
if(!$_SESSION['kodLogin']){
|
||||
show_tips("出错了!您尚未登录",APP_HOST,3);
|
||||
}
|
||||
show_tips("出错了!插件未开启,或您没有{$app}插件的权限");
|
||||
}
|
||||
Hook::apply($app.'Plugin.'.$action);
|
||||
}
|
||||
|
@ -73,7 +79,7 @@ class pluginApp extends Controller{
|
|||
public function changeStatus(){
|
||||
if( !isset($this->in['app']) ||
|
||||
!isset($this->in['status'])){
|
||||
show_json(LNG('error'),false);
|
||||
show_json(LNG('data_not_full'),false);
|
||||
}
|
||||
$app = $this->in['app'];
|
||||
$status = $this->in['status']?1:0;
|
||||
|
@ -97,7 +103,7 @@ class pluginApp extends Controller{
|
|||
show_json('needConfig',false);
|
||||
}
|
||||
}
|
||||
$model->changeStatus($app,$this->in['status']);
|
||||
$model->changeStatus($app,$status);
|
||||
$list = $model->viewList();
|
||||
show_json($list);
|
||||
}
|
||||
|
@ -105,7 +111,7 @@ class pluginApp extends Controller{
|
|||
public function setConfig(){
|
||||
if( !$this->in['app'] ||
|
||||
!$this->in['value']){
|
||||
show_json(LNG('error'),false);
|
||||
show_json(LNG('data_not_full'),false);
|
||||
}
|
||||
$json = $this->in['value'];
|
||||
$app = $this->in['app'];
|
||||
|
@ -124,13 +130,82 @@ class pluginApp extends Controller{
|
|||
show_json(LNG('success'));
|
||||
}
|
||||
|
||||
//install [download=>unzip=>regiest,install=>changeStatus]
|
||||
// download=>fileSize=>unzip=>remove
|
||||
public function install(){
|
||||
$app = _DIR_CLEAR($this->in['app']);
|
||||
$appPath = PLUGIN_DIR.$app.'.zip';
|
||||
$appPathTemp = $appPath.'.downloading';
|
||||
switch($this->in['step']){
|
||||
case 'check':
|
||||
$info = $this->pluginInfo($app);
|
||||
if(!is_array($info)){
|
||||
show_json(false,false);
|
||||
}
|
||||
echo json_encode($info);
|
||||
break;
|
||||
case 'download':
|
||||
if(!is_writable(PLUGIN_DIR)){
|
||||
show_json(LNG("no_permission_write").': '.PLUGIN_DIR,false);
|
||||
}
|
||||
$info = $this->pluginInfo($app);
|
||||
if(!$info || !$info['code']){
|
||||
show_json(LNG('error'),false);
|
||||
}
|
||||
$result = Downloader::start($info['data'],$appPath);
|
||||
show_json($result['data'],!!$result['code'],$app);
|
||||
break;
|
||||
case 'fileSize':
|
||||
if(file_exists($appPath)){
|
||||
show_json(filesize($appPath));
|
||||
}
|
||||
if(file_exists($appPathTemp)){
|
||||
show_json(filesize($appPathTemp));
|
||||
}
|
||||
show_json(0,false);
|
||||
break;
|
||||
case 'unzip':
|
||||
//hook log
|
||||
$GLOBALS['isRoot'] = 1;
|
||||
if(!file_exists($appPath)){
|
||||
show_json(LNG("error"),false);
|
||||
}
|
||||
$result = KodArchive::extract($appPath,PLUGIN_DIR.$app.'/');
|
||||
del_file($appPathTemp);
|
||||
del_file($appPath);
|
||||
show_json($result['data'],!!$result['code']);
|
||||
break;
|
||||
case 'remove':
|
||||
del_file($appPathTemp);
|
||||
del_file($appPath);
|
||||
show_json(LNG('success'));
|
||||
break;
|
||||
case 'update':
|
||||
show_json(Hook::apply($app.'Plugin.update'));
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
private function pluginInfo($app){
|
||||
$api = $this->config['settings']['pluginServer'].'plugin/install';
|
||||
$param = array(
|
||||
"app" => $app,
|
||||
"version" => KOD_VERSION,
|
||||
"versionHash" => $this->config['settingSystem']['versionHash'],
|
||||
"systemOS" => $this->config['systemOS'],
|
||||
"phpVersion" => PHP_VERSION,
|
||||
"lang" => I18n::getType()
|
||||
);
|
||||
$info = url_request($api,'POST',$param);
|
||||
$result = false;
|
||||
if($info && $info['data']){
|
||||
$result = json_decode($info['data'],true);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function unInstall(){
|
||||
if( !$this->in['app']){
|
||||
show_json(LNG('error'),false);
|
||||
show_json(LNG('data_not_full'),false);
|
||||
}
|
||||
$model = $this->loadModel('Plugin');
|
||||
$model->remove($this->in['app']);
|
||||
|
|
|
@ -32,8 +32,10 @@ class setting extends Controller{
|
|||
case 'theme':
|
||||
case 'wall':
|
||||
show_json(array(
|
||||
'settingAll' => $this->config['settingAll'],
|
||||
'user' => $this->config['user']
|
||||
'settingAll' => $this->config['settingAll'],
|
||||
'user' => $this->config['user'],
|
||||
'wallpageDesktop' => $this->config['settingSystem']['wallpageDesktop'],
|
||||
'wallpageLogin' => $this->config['settingSystem']['wallpageLogin'],
|
||||
));
|
||||
break;
|
||||
case 'system':
|
||||
|
@ -41,7 +43,6 @@ class setting extends Controller{
|
|||
if(isset($this->in['env_check'])){
|
||||
show_json(php_env_check());
|
||||
}
|
||||
|
||||
$result = $this->config['settingSystem'];
|
||||
unset($result['systemPassword']);
|
||||
show_json($result,true);
|
||||
|
@ -100,8 +101,8 @@ class setting extends Controller{
|
|||
$sql = systemMember::loadData();
|
||||
$user_arr = $sql->get();
|
||||
foreach ($user_arr as $key => $user) {
|
||||
$userPath = USER_PATH.$user['path']."/";
|
||||
$pathArr = array(
|
||||
$userPath = iconv_system(USER_PATH.$user['path']."/");
|
||||
$pathArr = array(
|
||||
$userPath.'data/temp',
|
||||
$userPath.'data/share_temp',
|
||||
$userPath.'recycle_kod'
|
||||
|
|
|
@ -63,12 +63,15 @@ class share extends Controller{
|
|||
//密码检测
|
||||
if ($shareInfo['sharePassword']=='') return;
|
||||
if (!isset($this->in['password'])){
|
||||
if ($_SESSION['password_'.$this->in['sid']]==$shareInfo['sharePassword']) return;
|
||||
if ($_SESSION['password_'.$this->in['sid']]==$shareInfo['sharePassword']){
|
||||
return;
|
||||
}
|
||||
$this->_error('password');
|
||||
}else{
|
||||
if ($this->in['password'] == $shareInfo['sharePassword']) {
|
||||
session_start();
|
||||
$_SESSION['password_'.$this->in['sid']]=$shareInfo['sharePassword'];
|
||||
session_write_close();
|
||||
show_json('success');
|
||||
}else{
|
||||
show_json(LNG('share_error_password'),false);
|
||||
|
@ -215,6 +218,7 @@ class share extends Controller{
|
|||
'webHost' => HOST,
|
||||
'appHost' => APP_HOST,
|
||||
'staticPath' => STATIC_PATH,
|
||||
'appIndex' => $_SERVER['SCRIPT_NAME'],
|
||||
'version' => KOD_VERSION,
|
||||
'versionDesc' => $versionDesc,
|
||||
'kodID' => md5(BASIC_PATH.$this->config['settingSystem']['systemPassword']),
|
||||
|
@ -240,6 +244,8 @@ class share extends Controller{
|
|||
'KOD_USER_FAV' => KOD_USER_FAV,
|
||||
'KOD_GROUP_ROOT_SELF' => KOD_GROUP_ROOT_SELF,
|
||||
'KOD_GROUP_ROOT_ALL' => KOD_GROUP_ROOT_ALL,
|
||||
'ST' => $this->in['st'],
|
||||
'ACT' => $this->in['act'],
|
||||
);
|
||||
|
||||
$userConfig = $GLOBALS['config']['settingDefault'];
|
||||
|
@ -251,6 +257,7 @@ class share extends Controller{
|
|||
|
||||
if(isset($this->config['settingSystem']['versionHash'])){
|
||||
$theConfig['versionHash'] = $this->config['settingSystem']['versionHash'];
|
||||
$theConfig['versionHashUser'] = $this->config['settingSystem']['versionHashUser'];
|
||||
}
|
||||
$theConfig['userConfig'] = $userConfig;
|
||||
$useTime = mtime() - $GLOBALS['config']['appStartTime'];
|
||||
|
@ -260,7 +267,11 @@ class share extends Controller{
|
|||
Hook::trigger('user.commonJs.insert',$this->in['st'],$this->in['act']);
|
||||
echo 'AUTH=[];';
|
||||
echo 'G='.json_encode($theConfig).';';
|
||||
echo 'LNG='.json_encode(I18n::getAll()).';G.useTime='.$useTime.';';
|
||||
$lang = json_encode_force(I18n::getAll());
|
||||
if(!$lang){
|
||||
$lang = '{}';
|
||||
}
|
||||
echo 'LNG='.$lang.';G.useTime='.$useTime.';';
|
||||
}
|
||||
|
||||
|
||||
|
@ -523,16 +534,12 @@ class share extends Controller{
|
|||
}
|
||||
$data = array(
|
||||
'ext' => get_path_ext($displayName),
|
||||
'name' => iconv_app(get_path_this($displayName)),
|
||||
'name' => iconv_app(get_path_this($displayName)),
|
||||
'filename' => $displayName,
|
||||
'charset' => $charset,
|
||||
'base64' => false,
|
||||
'content' => $fileContents
|
||||
);
|
||||
if(!json_encode(array("data"=>$fileContents))){
|
||||
$data['content'] = base64_encode($fileContents);
|
||||
$data['base64'] = true;
|
||||
}
|
||||
'base64' => true,// 部分防火墙编辑文件误判问题处理
|
||||
'content' => base64_encode($fileContents)
|
||||
);
|
||||
show_json($data);
|
||||
}
|
||||
|
||||
|
@ -546,7 +553,8 @@ class share extends Controller{
|
|||
exit;
|
||||
}
|
||||
if (@filesize($this->path) <= 1024*50 ||
|
||||
!function_exists('imagecolorallocate') ) {//小于50k或者不支持gd库 不再生成缩略图
|
||||
!function_exists('imagecolorallocate') ||
|
||||
get_path_ext($this->path) == 'gif') {//小于50k、不支持gd库、gif图 不再生成缩略图
|
||||
file_put_out($this->path,false);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ class systemGroup extends Controller{
|
|||
)
|
||||
);
|
||||
$this->sql->reset($default);
|
||||
$this->_initDir($default[0]['path']);
|
||||
$this->initDir($default[0]['path']);
|
||||
}
|
||||
//删除 path id
|
||||
public static function _filterList($list,$filter_key = 'path'){
|
||||
|
@ -118,9 +118,9 @@ class systemGroup extends Controller{
|
|||
$groupID = $this->sql->getMaxId().'';
|
||||
$groupName = rawurldecode($this->in['name']);
|
||||
$groupInfo = array(
|
||||
'groupID' => $groupID,
|
||||
'groupID' => $groupID,
|
||||
'name' => $groupName,
|
||||
'parentID' => $this->in['parentID'],
|
||||
'parentID' => $this->in['parentID'],
|
||||
'children' => '',
|
||||
'config' => array('sizeMax' => floatval($this->in['sizeMax']),//G
|
||||
'sizeUse' => floatval(1024*1024)),//总大小,目前使用大小
|
||||
|
@ -142,7 +142,7 @@ class systemGroup extends Controller{
|
|||
}
|
||||
$this->_parentChildChange($groupInfo,true);//更新父节点
|
||||
if ($this->sql->set($groupID,$groupInfo)) {
|
||||
$this->_initDir($groupInfo['path']);
|
||||
$this->initDir($groupInfo['path']);
|
||||
show_json(LNG('success'));
|
||||
}
|
||||
show_json(LNG('error'),false);
|
||||
|
@ -170,7 +170,8 @@ class systemGroup extends Controller{
|
|||
$this->in['parentID']!=$groupInfo['parentID']){//父节点变更
|
||||
|
||||
$childChange = explode(',',$groupInfo['children']);
|
||||
if(in_array($this->in['parentID'],$childChange)){//不能移动到子节点;死循环
|
||||
if( in_array($this->in['parentID'],$childChange)
|
||||
|| $this->in['parentID'] == $this->in['groupID']){//不能移动到子节点;死循环
|
||||
show_json(LNG('current_has_parent'),false);
|
||||
}
|
||||
self::spaceChange($this->in['groupID']);//重置用户使用空间
|
||||
|
@ -204,9 +205,9 @@ class systemGroup extends Controller{
|
|||
$groupInfo = $this->sql->get($this->in['groupID']);
|
||||
$this->_parentChildChange($groupInfo,false);//向所有父节点,删除包含此节点的children
|
||||
$this->sql->set(//将该节点的子节点的父节点设置为根目录
|
||||
array('parentID',$groupInfo["groupID"]),
|
||||
array('parentID','1')
|
||||
);
|
||||
array('parentID',$groupInfo["groupID"]),
|
||||
array('parentID','1')
|
||||
);
|
||||
systemMember::groupRemoveUserUpdate($groupInfo["groupID"]);//用户所在组变更
|
||||
$this->sql->remove($this->in['groupID']);
|
||||
|
||||
|
@ -263,12 +264,9 @@ class systemGroup extends Controller{
|
|||
/**
|
||||
*初始化用户数据和配置。
|
||||
*/
|
||||
private function _initDir($path){
|
||||
public function initDir($path){
|
||||
$root = array('home','data');
|
||||
$newGroupFolder = $this->config['settingSystem']['newGroupFolder'];
|
||||
if(!is_array($newGroupFolder)){
|
||||
$newGroupFolder = $this->config['settingSystemDefault']['newGroupFolder'];
|
||||
}
|
||||
$home = explode(',',$newGroupFolder);
|
||||
$path = GROUP_PATH.$path.'/';
|
||||
foreach ($root as $dir) {
|
||||
|
|
|
@ -148,8 +148,11 @@ class systemMember extends Controller{
|
|||
return $list;
|
||||
}
|
||||
|
||||
//含有密码则不罗列
|
||||
foreach($list as $key=>&$val){
|
||||
unset($val['sharePassword']);
|
||||
if($val['sharePassword']){
|
||||
unset($list[$key]);
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
@ -205,6 +208,22 @@ class systemMember extends Controller{
|
|||
show_json($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户列表数据,根据用户组筛选;默认输出所有用户
|
||||
*/
|
||||
public function getByName($name = '') {
|
||||
if(!$name){
|
||||
$name = $this->in['name'];
|
||||
}
|
||||
$result = $this->sql->get(array('name',$name));
|
||||
if(is_array($result) && count($result)>0){
|
||||
$arr = array_values($result);
|
||||
unset($arr[0]['password']);
|
||||
show_json($arr[0]);
|
||||
}
|
||||
show_json(LNG("not_exists"),false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户添加
|
||||
* systemMember/add&name=warlee&password=123&sizeMax=0&groupInfo={"0":"read","10":"write"}&role=default
|
||||
|
@ -226,7 +245,7 @@ class systemMember extends Controller{
|
|||
show_json(LNG('systemMember_group_error'),false);
|
||||
}
|
||||
if($this->sql->get(array('name',$name))){
|
||||
show_json(LNG('error_repeat'),false);
|
||||
show_json(LNG('error_repeat'),false,$name);
|
||||
}
|
||||
|
||||
//非系统管理员,不能添加系统管理员
|
||||
|
@ -258,6 +277,7 @@ class systemMember extends Controller{
|
|||
$userInfo = array(
|
||||
'userID' => $userID,
|
||||
'name' => $val,
|
||||
'nickName' => $this->in['nickName'],
|
||||
'password' => md5($password),
|
||||
'role' => $this->in['role'],
|
||||
'config' => array('sizeMax' => floatval($this->in['sizeMax']),//M
|
||||
|
@ -282,21 +302,25 @@ class systemMember extends Controller{
|
|||
unset($userInfo['homePath']);
|
||||
}
|
||||
if ($this->sql->set($userID,$userInfo)) {
|
||||
$this->_initDir($userInfo['path']);
|
||||
$this->initDir($userInfo['path']);
|
||||
}else{
|
||||
$errorArr[] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$success = count($userArray)-count($errorArr);
|
||||
$show = " success:$success";
|
||||
$msg = LNG('success');
|
||||
if(count($errorArr) > 0 ){
|
||||
$msg = LNG('word_success').' : '.$success.', ';//部分失败
|
||||
if($success == 0 ){
|
||||
$msg = LNG('error_repeat');
|
||||
}
|
||||
$msg .= LNG('word_error').' : '.count($errorArr);
|
||||
}
|
||||
if($success==count($userArray)){
|
||||
show_json(LNG('success').$show,true,$success);
|
||||
}else if($success!=0){//部分失败
|
||||
$errorInfo = " error:".count($errorArr);
|
||||
show_json(LNG('success').$show.$errorInfo,false,implode("\n",$errorArr));
|
||||
show_json($msg,true,$success);
|
||||
}else{
|
||||
show_json(LNG('error_repeat'),false);
|
||||
show_json($msg,false,implode("\n",$errorArr));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -337,7 +361,7 @@ class systemMember extends Controller{
|
|||
}
|
||||
|
||||
$this->in['name'] = rawurlencode($theName);//还原
|
||||
$editArr = array('name','role','password','groupInfo','homePath','status','sizeMax');
|
||||
$editArr = array('name','nickName','role','password','groupInfo','homePath','status','sizeMax');
|
||||
foreach ($editArr as $key) {
|
||||
if(!isset($this->in[$key])) continue;
|
||||
$userInfo[$key] = rawurldecode($this->in[$key]);
|
||||
|
@ -402,6 +426,12 @@ class systemMember extends Controller{
|
|||
$status = intval($this->in['param']);
|
||||
$this->sql->set(array('userID',$userID),array('status',$status));
|
||||
break;
|
||||
case 'spaceSet'://批量设置用户空间大小
|
||||
$value = intval($this->in['param']);
|
||||
$userInfo = $this->sql->get($userID);
|
||||
$userInfo['config']['sizeMax'] = $value;
|
||||
$this->sql->set($userID,$userInfo);
|
||||
break;
|
||||
case 'roleSet'://设置权限组
|
||||
$role = $this->in['param'];
|
||||
//非系统管理员,不能将别人设置为系统管理员
|
||||
|
@ -431,8 +461,8 @@ class systemMember extends Controller{
|
|||
$userInfo = $this->sql->get($userID);
|
||||
foreach ($groupArr as $key => $value) {
|
||||
$userInfo['groupInfo'][$key] = $value;
|
||||
}
|
||||
$this->sql->set($userID,$userInfo);
|
||||
}
|
||||
$this->sql->set($userID,$userInfo);
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
|
@ -444,7 +474,7 @@ class systemMember extends Controller{
|
|||
$list = $sql->get();
|
||||
foreach ($list as $id => &$info) {//创建用户目录及初始化
|
||||
$path = make_path($info['name']);
|
||||
$this->_initDir($path);
|
||||
$this->initDir($path);
|
||||
$info['path'] = $path;
|
||||
$info['createTime'] = time();
|
||||
}
|
||||
|
@ -470,7 +500,7 @@ class systemMember extends Controller{
|
|||
/**
|
||||
*初始化用户数据和配置。
|
||||
*/
|
||||
private function _initDir($path){
|
||||
public function initDir($path){
|
||||
$userFolder = array('home','recycle_kod','data');
|
||||
$homeFolders = explode(',',$this->config['settingSystem']['newUserFolder']);
|
||||
$rootPath = USER_PATH.$path.'/';
|
||||
|
|
|
@ -41,7 +41,8 @@ class systemRole extends Controller{
|
|||
*/
|
||||
public function add(){
|
||||
$role = $this->_initData();
|
||||
$role['roleID'] = $this->sql->getMaxId().'';
|
||||
$roleId = $role['roleID'] = $this->sql->getMaxId().'';
|
||||
$this->_checkExist( $this->sql->get(),array('name',$role['name']),$roleId );
|
||||
if ($this->sql->set($role['roleID'],$role)) {
|
||||
show_json(LNG('success'),true,$role['roleID']);
|
||||
}
|
||||
|
@ -54,6 +55,7 @@ class systemRole extends Controller{
|
|||
public function edit(){
|
||||
$role = $this->_initData();
|
||||
$roleId = $this->in['roleID'];
|
||||
$this->_checkExist( $this->sql->get(),array('name',$role['name']),$roleId );
|
||||
if ($this->sql->set($roleId,$role)){
|
||||
show_json(LNG('success'),true,$roleId);
|
||||
}
|
||||
|
@ -94,6 +96,8 @@ class systemRole extends Controller{
|
|||
$roleId = $sql->getMaxId().'';
|
||||
$roleArr = json_decode($this->in['role_arr'],true);
|
||||
if(!is_array($roleArr)) show_json(LNG('error'),false);
|
||||
if(!trim($roleArr['name'])) show_json(LNG("data_not_full"),false);
|
||||
$this->_checkExist( $sql->get(),array('name',$roleArr['name']),$roleId);
|
||||
if ($sql->set($roleId,$roleArr)) {
|
||||
show_json(array($roleId),true,$sql->get());
|
||||
}
|
||||
|
@ -103,6 +107,8 @@ class systemRole extends Controller{
|
|||
$roleId = $this->in['roleID'];
|
||||
$roleArr = json_decode($this->in['role_arr'],true);
|
||||
if(!is_array($roleArr)) show_json(LNG('error'),false);
|
||||
if(!trim($roleArr['name'])) show_json(LNG("data_not_full"),false);
|
||||
$this->_checkExist( $sql->get(),array('name',$roleArr['name']),$roleId);
|
||||
if ($sql->set($roleId,$roleArr)){
|
||||
show_json(LNG('success'),true,$sql->get());
|
||||
}
|
||||
|
@ -122,6 +128,20 @@ class systemRole extends Controller{
|
|||
}
|
||||
}
|
||||
|
||||
//检测是否存在
|
||||
private function _checkExist($data,$find,$checkID){
|
||||
$findData = array();
|
||||
foreach ($data as $key => $val) {
|
||||
if ($val[$find[0]] == $find[1]) {
|
||||
$findData[$key] = $data[$key];
|
||||
}
|
||||
}
|
||||
if(is_array($findData) && count($findData)>0 ){
|
||||
$key = array_keys($findData);$key=$key[0];
|
||||
if($key != $checkID) show_json(LNG("error_repeat"),false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//===========内部调用============
|
||||
/**
|
||||
|
|
|
@ -35,6 +35,9 @@ class user extends Controller{
|
|||
$this->notCheckApp = array('pluginApp.to','api.view');
|
||||
}
|
||||
$this->config['forceWap'] = is_wap() && (!isset($_COOKIE['forceWap']) || $_COOKIE['forceWap'] == '1');
|
||||
if( isset($_GET['forceWap']) ){
|
||||
$this->config['forceWap'] = $_GET['forceWap'];
|
||||
}
|
||||
}
|
||||
|
||||
public function bindHook(){
|
||||
|
@ -62,7 +65,7 @@ class user extends Controller{
|
|||
if (!is_array($user) || !isset($user['password'])) {
|
||||
$this->logout();
|
||||
}
|
||||
if($this->_makeLoginToken($user) == $_COOKIE['kodToken']){
|
||||
if($this->_makeLoginToken($user) === $_COOKIE['kodToken']){
|
||||
@session_start();//re start
|
||||
$_SESSION['kodLogin'] = true;
|
||||
$_SESSION['kodUser']= $user;
|
||||
|
@ -207,8 +210,13 @@ class user extends Controller{
|
|||
}
|
||||
$this->login($error);
|
||||
}
|
||||
|
||||
|
||||
public function accessToken(){
|
||||
if($_SESSION['kodLogin'] === true){
|
||||
show_json(access_token_get(),true);
|
||||
}else{
|
||||
show_json('not login!',false);
|
||||
}
|
||||
}
|
||||
|
||||
//临时文件访问
|
||||
public function publicLink(){
|
||||
|
@ -240,8 +248,9 @@ class user extends Controller{
|
|||
'userID' => $this->user['userID'],
|
||||
'webRoot' => $GLOBALS['webRoot'],
|
||||
'webHost' => HOST,
|
||||
'appHost' => APP_HOST,
|
||||
'appHost' => APP_HOST,
|
||||
'staticPath' => STATIC_PATH,
|
||||
'appIndex' => $_SERVER['SCRIPT_NAME'],
|
||||
'basicPath' => $basicPath,
|
||||
'userPath' => $userPath,
|
||||
'groupPath' => $groupPath,
|
||||
|
@ -274,9 +283,12 @@ class user extends Controller{
|
|||
'KOD_USER_FAV' => KOD_USER_FAV,
|
||||
'KOD_GROUP_ROOT_SELF' => KOD_GROUP_ROOT_SELF,
|
||||
'KOD_GROUP_ROOT_ALL' => KOD_GROUP_ROOT_ALL,
|
||||
'ST' => $this->in['st'],
|
||||
'ACT' => $this->in['act'],
|
||||
);
|
||||
if(isset($this->config['settingSystem']['versionHash'])){
|
||||
$theConfig['versionHash'] = $this->config['settingSystem']['versionHash'];
|
||||
$theConfig['versionHashUser'] = $this->config['settingSystem']['versionHashUser'];
|
||||
}
|
||||
if (!isset($GLOBALS['auth'])) {
|
||||
$GLOBALS['auth'] = array();
|
||||
|
@ -288,7 +300,12 @@ class user extends Controller{
|
|||
Hook::trigger('user.commonJs.insert',$this->in['st'],$this->in['act']);
|
||||
echo 'AUTH='.json_encode($GLOBALS['auth']).';';
|
||||
echo 'G='.json_encode($theConfig).';';
|
||||
echo 'LNG='.json_encode(I18n::getAll()).';G.useTime='.$useTime.';';
|
||||
|
||||
$lang = json_encode_force(I18n::getAll());
|
||||
if(!$lang){
|
||||
$lang = '{}';
|
||||
}
|
||||
echo 'LNG='.$lang.';G.useTime='.$useTime.';';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -370,7 +387,7 @@ class user extends Controller{
|
|||
count($param) != 2 ||
|
||||
md5(base64_decode($param[0]).$api_token) != $param[1]
|
||||
){
|
||||
$this->_loginDisplay("Api param error!",false);
|
||||
$this->_loginDisplay("API 接口参数错误!",false);
|
||||
}
|
||||
$this->in['name'] = urlencode(base64_decode($param[0]));
|
||||
$apiLoginCheck = true;
|
||||
|
@ -387,10 +404,16 @@ class user extends Controller{
|
|||
|
||||
$name = rawurldecode($this->in['name']);
|
||||
$password = rawurldecode($this->in['password']);
|
||||
|
||||
if($this->in['salt']){
|
||||
$key = substr($password,0,5)."2&$%@(*@(djfhj1923";
|
||||
$password = Mcrypt::decode(substr($password,5),$key);
|
||||
}
|
||||
|
||||
$member = systemMember::loadData();
|
||||
$user = $member->get('name',$name);
|
||||
if($apiLoginCheck && $user){//api自动登陆
|
||||
}else if ($user === false || md5($password)!=$user['password']){
|
||||
}else if ($user === false || md5($password) !== $user['password']){
|
||||
$this->_loginDisplay(LNG('password_error'),false);//$member->get()
|
||||
}else if($user['status'] == 0){
|
||||
$this->_loginDisplay(LNG('login_error_user_not_use'),false);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -50,17 +50,17 @@ class Application {
|
|||
$classFile = CONTROLLER_DIR . $subDir.$class.'.class.php';
|
||||
$className = $class;//.'Controller'
|
||||
if (!file_exists_case($classFile)) {
|
||||
show_tips($class.' controller not exists!');
|
||||
show_tips($class.' controller '.LNG("not_exists"),APP_HOST,3);
|
||||
}
|
||||
if (!class_exists($className)) {
|
||||
include_once($classFile);
|
||||
}
|
||||
if (!class_exists($className)) {
|
||||
show_tips($className.' class not exists');
|
||||
show_tips($className.' class '.LNG("not_exists"),APP_HOST,3);
|
||||
}
|
||||
$instance = new $className();
|
||||
if (!method_exists($instance, $function)) {
|
||||
show_tips($function.' method not exists');
|
||||
show_tips($function.' method '.LNG("not_exists"),APP_HOST,3);
|
||||
}
|
||||
return $instance -> $function();
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
if(!isset($config['appStartTime'])){
|
||||
$config['appStartTime'] = mtime();
|
||||
}
|
||||
|
||||
function myAutoloader($name) {
|
||||
$find = array(
|
||||
|
@ -120,7 +123,7 @@ function filter_html($html){
|
|||
|
||||
|
||||
function in_array_not_case($needle, $haystack) {
|
||||
return in_array(strtolower($needle),array_map('strtolower',$haystack));
|
||||
return in_array(strtolower($needle),array_map('strtolower',$haystack));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -244,6 +247,11 @@ if (!function_exists('gzdecode')) {
|
|||
}
|
||||
}
|
||||
|
||||
function xml2json($decodeXml){
|
||||
$data = simplexml_load_string($decodeXml,'SimpleXMLElement', LIBXML_NOCDATA);
|
||||
return json_decode(json_encode($data),true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 二维数组按照指定的键值进行排序,
|
||||
*
|
||||
|
@ -257,18 +265,11 @@ if (!function_exists('gzdecode')) {
|
|||
* $out = array_sort_by($array,'price');
|
||||
*/
|
||||
function array_sort_by($records, $field, $reverse=false){
|
||||
$hash = array();
|
||||
foreach($records as $record){
|
||||
$hash[$record[$field]] = $record;
|
||||
}
|
||||
($reverse)? krsort($hash) : ksort($hash);
|
||||
|
||||
$records = array();
|
||||
foreach($hash as $record){
|
||||
$records []= $record;
|
||||
}
|
||||
return $records;
|
||||
}
|
||||
$reverse = $reverse?SORT_DESC:SORT_ASC;
|
||||
array_multisort(array_column($records,$field),$reverse,$records);
|
||||
return $records;
|
||||
}
|
||||
|
||||
/**
|
||||
* 遍历数组,对每个元素调用 $callback,假如返回值不为假值,则直接返回该返回值;
|
||||
* 假如每次 $callback 都返回假值,最终返回 false
|
||||
|
@ -323,6 +324,43 @@ function array_get_index($arr,$index){
|
|||
}
|
||||
}
|
||||
|
||||
function array_field_values($arr,$field){
|
||||
$result = array();
|
||||
foreach ($arr as $val) {
|
||||
if(is_array($val) && isset($val[$field])){
|
||||
$result[] = $val[$field];
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
// 删除数组某个值
|
||||
function array_remove_value($array, $value){
|
||||
$isNumericArray = true;
|
||||
foreach ($array as $key => $item) {
|
||||
if ($item === $value) {
|
||||
if (!is_int($key)) {
|
||||
$isNumericArray = false;
|
||||
}
|
||||
unset($array[$key]);
|
||||
}
|
||||
}
|
||||
if ($isNumericArray) {
|
||||
$array = array_values($array);
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
// 获取数组key最大的值
|
||||
function array_key_max($array){
|
||||
if(count($array)==0){
|
||||
return 1;
|
||||
}
|
||||
$idArr = array_keys($array);
|
||||
rsort($idArr,SORT_NUMERIC);//id从高到底
|
||||
return intval($idArr[0]);
|
||||
}
|
||||
|
||||
//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){
|
||||
|
@ -360,14 +398,14 @@ function show_tips($message,$url= '', $time = 3,$title = ''){
|
|||
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>";
|
||||
$info = "{$time}s 后自动跳转, <a href='$url'>立即跳转</a>";
|
||||
if ($url == "") {
|
||||
$goto = "";
|
||||
$info = "";
|
||||
} //是否自动跳转
|
||||
|
||||
if($title == ''){
|
||||
$title = "警告 (Warning!)";
|
||||
$title = "出错了!";
|
||||
}
|
||||
|
||||
if(is_array($message) || is_object($message)){
|
||||
|
@ -376,7 +414,11 @@ function show_tips($message,$url= '', $time = 3,$title = ''){
|
|||
$message = "<pre>".$message.'</pre>';
|
||||
}else{
|
||||
$message = filter_html(nl2br($message));
|
||||
}
|
||||
}
|
||||
if(file_exists(TEMPLATE.'common/showTips.html')){
|
||||
include(TEMPLATE.'common/showTips.html');
|
||||
exit;
|
||||
}
|
||||
echo<<<END
|
||||
<html>
|
||||
<meta http-equiv='refresh' $goto charset="utf-8">
|
||||
|
@ -502,6 +544,7 @@ function json_space_clear($str){
|
|||
}
|
||||
|
||||
function json_decode_force($str){
|
||||
$str = trim($str,'');
|
||||
$str = json_comment_clear($str);
|
||||
$str = json_space_clear($str);
|
||||
|
||||
|
@ -520,7 +563,9 @@ function json_encode_force($json){
|
|||
$jsonStr = json_encode($json);
|
||||
}
|
||||
if($jsonStr === false){
|
||||
$jsonStr = __json_encode($json);
|
||||
include_once(dirname(__FILE__)."/others/JSON.php");
|
||||
$parse = new Services_JSON();
|
||||
$jsonStr = $parse->encode($json);
|
||||
}
|
||||
return $jsonStr;
|
||||
}
|
||||
|
@ -531,6 +576,9 @@ function json_encode_force($json){
|
|||
* @params {array} 返回的数据集合
|
||||
*/
|
||||
function show_json($data,$code = true,$info=''){
|
||||
if($GLOBALS['SHOW_JSON_RETURN']){
|
||||
return;
|
||||
}
|
||||
$useTime = mtime() - $GLOBALS['config']['appStartTime'];
|
||||
$result = array('code'=>$code,'use_time'=>$useTime,'data'=>$data);
|
||||
if(defined("GLOBAL_DEBUG") && GLOBAL_DEBUG==1){
|
||||
|
@ -540,16 +588,28 @@ function show_json($data,$code = true,$info=''){
|
|||
$result['info'] = $info;
|
||||
}
|
||||
ob_end_clean();
|
||||
header("X-Powered-By: kodExplorer.");
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
if(!headers_sent()){
|
||||
header("X-Powered-By: kodExplorer.");
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
}
|
||||
if(class_exists('Hook')){
|
||||
$temp = Hook::trigger("show_json",$result);
|
||||
if(is_array($temp)){
|
||||
$result = $temp;
|
||||
}
|
||||
}
|
||||
$json = json_encode_force($result);
|
||||
if(isset($_GET['callback'])){
|
||||
if(!preg_match("/^[0-9a-zA-Z_.]+$/",$_GET['callback'])){
|
||||
die("calllback error!");
|
||||
}
|
||||
echo $_GET['callback'].'('.$json.');';
|
||||
}else{
|
||||
echo $json;
|
||||
}
|
||||
exit;
|
||||
if(!isset($GLOBALS['SHOW_JSON_EXIT']) || !$GLOBALS['SHOW_JSON_EXIT']){
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
function show_trace(){
|
||||
|
@ -561,13 +621,12 @@ function show_trace(){
|
|||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function str2hex($string){
|
||||
$hex='';
|
||||
for ($i=0; $i < strlen($string); $i++){
|
||||
$hex .= dechex(ord($string[$i]));
|
||||
for($i=0;$i<strlen($string);$i++){
|
||||
$hex .= sprintf('%02s',dechex(ord($string[$i])));
|
||||
}
|
||||
$hex = strtoupper($hex);
|
||||
return $hex;
|
||||
}
|
||||
|
||||
|
@ -580,65 +639,19 @@ function hex2str($hex){
|
|||
}
|
||||
|
||||
if(!function_exists('json_encode')){
|
||||
include_once(dirname(__FILE__)."/others/JSON.php");
|
||||
function json_encode($data){
|
||||
__json_encode($data);
|
||||
$json = new Services_JSON();
|
||||
return $json->encode($data);
|
||||
}
|
||||
function json_decode($json_data,$toarray =false) {
|
||||
$json = new Services_JSON();
|
||||
$array = $json->decode($json_data);
|
||||
if ($toarray) {
|
||||
$array = obj2array($array);
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
function __json_encode( $data ) {
|
||||
if( is_array($data) || is_object($data) ) {
|
||||
$islist = is_array($data) && ( empty($data) || array_keys($data) === range(0,count($data)-1) );
|
||||
if( $islist ) {
|
||||
$json = '[' . implode(',', array_map('__json_encode', $data) ) . ']';
|
||||
} else {
|
||||
$items = Array();
|
||||
foreach( $data as $key => $value ) {
|
||||
$items[] = __json_encode("$key") . ':' . __json_encode($value);
|
||||
}
|
||||
$json = '{' . implode(',', $items) . '}';
|
||||
}
|
||||
} else if( is_string($data) ) {
|
||||
$string = addcslashes($data, "\\\"\n\r\t/" . chr(8) . chr(12));
|
||||
$json = '';
|
||||
$len = strlen($string);
|
||||
# Convert UTF-8 to Hexadecimal Codepoints.
|
||||
for( $i = 0; $i < $len; $i++ ) {
|
||||
$char = $string[$i];
|
||||
$c1 = ord($char);
|
||||
|
||||
# Single byte;
|
||||
if( $c1 <128 ) {
|
||||
$json .= ($c1 > 31) ? $char : sprintf("\\u%04x", $c1);
|
||||
continue;
|
||||
}
|
||||
|
||||
# Double byte
|
||||
$c2 = ord($string[++$i]);
|
||||
if ( ($c1 & 32) === 0 ) {
|
||||
$json .= sprintf("\\u%04x", ($c1 - 192) * 64 + $c2 - 128);
|
||||
continue;
|
||||
}
|
||||
|
||||
# Triple
|
||||
$c3 = ord($string[++$i]);
|
||||
if( ($c1 & 16) === 0 ) {
|
||||
$json .= sprintf("\\u%04x", (($c1 - 224) <<12) + (($c2 - 128) << 6) + ($c3 - 128));
|
||||
continue;
|
||||
}
|
||||
|
||||
# Quadruple
|
||||
$c4 = ord($string[++$i]);
|
||||
if( ($c1 & 8 ) === 0 ) {
|
||||
$u = (($c1 & 15) << 2) + (($c2>>4) & 3) - 1;
|
||||
$w1 = (54<<10) + ($u<<6) + (($c2 & 15) << 2) + (($c3>>4) & 3);
|
||||
$w2 = (55<<10) + (($c3 & 15)<<6) + ($c4-128);
|
||||
$json .= sprintf("\\u%04x\\u%04x", $w1, $w2);
|
||||
}
|
||||
}
|
||||
$json = '"'.addcslashes($data, "\"").'"';
|
||||
} else {
|
||||
$json = strtolower(var_export( $data, true ));
|
||||
}
|
||||
return $json;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -222,7 +222,7 @@ function folder_info($path){
|
|||
* test/11/ ==>11 test/1.c ==>1.c
|
||||
*/
|
||||
function get_path_this($path){
|
||||
$path = str_replace('\\','/', rtrim(trim($path),'/'));
|
||||
$path = str_replace('\\','/', rtrim($path,'/'));
|
||||
$pos = strrpos($path,'/');
|
||||
if($pos === false){
|
||||
return $path;
|
||||
|
@ -234,7 +234,7 @@ function get_path_this($path){
|
|||
* /test/11/==>/test/ /test/1.c ==>/www/test/
|
||||
*/
|
||||
function get_path_father($path){
|
||||
$path = str_replace('\\','/', rtrim(trim($path),'/'));
|
||||
$path = str_replace('\\','/', rtrim($path,'/'));
|
||||
$pos = strrpos($path,'/');
|
||||
if($pos === false){
|
||||
return $path;
|
||||
|
@ -254,7 +254,7 @@ function get_path_ext($path){
|
|||
if (strlen($ext)>3 && preg_match("/([\x81-\xfe][\x40-\xfe])/", $ext, $match)) {
|
||||
$ext = '';
|
||||
}
|
||||
return clear_html($ext);
|
||||
return htmlspecialchars($ext);
|
||||
}
|
||||
|
||||
|
||||
|
@ -650,76 +650,72 @@ function recursion_dir($path,&$dir,&$file,$deepest=-1,$deep=0){
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 安全读取文件,避免并发下读取数据为空
|
||||
function file_read_safe($file,$timeout = 0.1){
|
||||
function file_read_safe($file,$timeout = 5){
|
||||
clearstatcache();
|
||||
if(!$file || !file_exists($file)) return false;
|
||||
|
||||
$start_time = microtime(true);
|
||||
$index = 0;
|
||||
$fp = fopen($file, 'r+');
|
||||
if(!$fp) return false;
|
||||
$startTime = microtime(true);
|
||||
do{
|
||||
clearstatcache();
|
||||
$index++;
|
||||
$file_size = filesize($file);
|
||||
$result = @file_get_contents($file);
|
||||
if( $result === false ||
|
||||
!file_exists($file) ||
|
||||
strlen($result) !== $file_size){
|
||||
usleep(round(rand(0,1000)*50));//0.01~10ms
|
||||
}else{
|
||||
return $result;
|
||||
$canWrite = flock($fp, LOCK_EX | LOCK_NB);//必须加上LOCK_NB,否则设置超时无效
|
||||
if(!$canWrite){
|
||||
usleep(round(mt_rand(0, 100) * 1000));//随机等待0~100ms
|
||||
}
|
||||
}while($index<=100 && (microtime(true)-$start_time) < $timeout );
|
||||
return false;
|
||||
} while((!$canWrite) && ((microtime(true) - $startTime) < $timeout ));//设置超时时间
|
||||
if($canWrite){
|
||||
$result = "";
|
||||
while (!feof($fp)) {
|
||||
$result .= fread($fp, 409600);
|
||||
}
|
||||
flock($fp,LOCK_UN);fclose($fp);
|
||||
return $result;
|
||||
}else{
|
||||
flock($fp,LOCK_UN);fclose($fp);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 安全读取文件,避免并发下读取数据为空
|
||||
function file_wirte_safe($file,$buffer,$timeout=0.1){
|
||||
function file_wirte_safe($file,$buffer,$timeout=5){
|
||||
clearstatcache();
|
||||
$fileTemp = $file.'.'.time().rand_string(5);
|
||||
if(!$fp = fopen($fileTemp, "w")){
|
||||
@unlink($fileTemp);
|
||||
if(strlen($file) == 0 || !$file || !file_exists($file)) return false;
|
||||
$fp = fopen($file,'r+');
|
||||
$startTime = microtime(true);
|
||||
do{
|
||||
$canWrite = flock($fp, LOCK_EX | LOCK_NB);//必须加上LOCK_NB,否则设置超时无效
|
||||
if(!$canWrite){
|
||||
usleep(round(mt_rand(0, 100) * 1000));//随机等待0~100ms
|
||||
}
|
||||
} while((!$canWrite) && ((microtime(true) - $startTime) < $timeout ));//设置超时时间
|
||||
if($canWrite){
|
||||
ftruncate($fp,0);
|
||||
rewind($fp);
|
||||
fwrite($fp,$buffer);
|
||||
flock($fp,LOCK_UN);fclose($fp);
|
||||
return true;
|
||||
}else{
|
||||
flock($fp,LOCK_UN);fclose($fp);
|
||||
return false;
|
||||
}
|
||||
fwrite($fp, $buffer);
|
||||
fclose($fp);
|
||||
|
||||
$file_lock = $file.'.lock';
|
||||
$start_time = microtime(true);
|
||||
$index = 0;
|
||||
do{
|
||||
clearstatcache();
|
||||
$index++;
|
||||
if(!file_exists($file_lock)){
|
||||
@rename($file,$file_lock);
|
||||
}
|
||||
$result = @rename($fileTemp,$file);
|
||||
if( $result === false || file_exists($fileTemp)){
|
||||
usleep(round(rand(0,1000)*10));//0.01~10ms
|
||||
}else{
|
||||
@unlink($file_lock);
|
||||
return true;
|
||||
}
|
||||
}while($index<=100 && (microtime(true)-$start_time)<$timeout );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* $search 为包含的字符串
|
||||
* is_content 表示是否搜索文件内容;默认不搜索
|
||||
* is_case 表示区分大小写,默认不区分
|
||||
*/
|
||||
function path_search($path,$search,$is_content=false,$file_ext='',$is_case=false){
|
||||
$result = array();
|
||||
$result['fileList'] = array();
|
||||
$result['folderList'] = array();
|
||||
if(!$path) return $result;
|
||||
|
||||
$ext_arr = explode("|",$file_ext);
|
||||
recursion_dir($path,$dirs,$files,-1,0);
|
||||
$strpos = 'stripos';//是否区分大小写
|
||||
if ($is_case) $strpos = 'strpos';
|
||||
|
||||
$result = array();
|
||||
$result['fileList'] = array();
|
||||
$result['folderList'] = array();
|
||||
|
||||
$result_num = 0;
|
||||
$result_num_max = 2000;//搜索文件内容,限制最多匹配条数
|
||||
foreach($files as $f){
|
||||
|
@ -727,15 +723,16 @@ function path_search($path,$search,$is_content=false,$file_ext='',$is_case=false
|
|||
$result['error_info'] = $result_num_max;
|
||||
break;
|
||||
}
|
||||
|
||||
//若指定了扩展名则只在匹配扩展名文件中搜索
|
||||
$ext = get_path_ext($f);
|
||||
if($file_ext != '' && !in_array($ext,$ext_arr)){
|
||||
continue;
|
||||
}
|
||||
|
||||
//搜索内容则不搜索文件名
|
||||
if ($is_content) {
|
||||
$ext = get_path_ext($f);
|
||||
if ($file_ext != '') { //若指定了扩展名则只在匹配扩展名文件中搜索
|
||||
if(!in_array($ext,$ext_arr)) continue;
|
||||
}else{
|
||||
if(!is_text_file($ext)) continue; //在限定中或者不在bin中
|
||||
}
|
||||
if(!is_text_file($ext)) continue; //在限定中或者不在bin中
|
||||
$search_info = file_search($f,$search,$is_case);
|
||||
if($search_info !== false){
|
||||
$result_num += count($search_info['searchInfo']);
|
||||
|
@ -749,7 +746,7 @@ function path_search($path,$search,$is_content=false,$file_ext='',$is_case=false
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!$is_content) {//没有指定搜索文件内容,才搜索文件夹
|
||||
if (!$is_content && $file_ext == '' ) {//没有指定搜索文件内容,且没有限定扩展名,才搜索文件夹
|
||||
foreach($dirs as $f){
|
||||
$path_this = get_path_this($f);
|
||||
if ($strpos($path_this,$search) !== false){
|
||||
|
@ -774,6 +771,11 @@ function file_search($path,$search,$is_case){
|
|||
return false;
|
||||
}
|
||||
$content = file_get_contents($path);
|
||||
if( $strpos($content,"\0") > 0 ){// 不是文本文档
|
||||
unset($content);
|
||||
return false;
|
||||
}
|
||||
|
||||
$charset = get_charset($content);
|
||||
|
||||
//搜索关键字为纯英文则直接搜索;含有中文则转为utf8再搜索,为兼容其他文件编码格式
|
||||
|
@ -1008,6 +1010,10 @@ function file_put_out($file,$download=-1,$downFilename=false){
|
|||
}else{
|
||||
header('Content-Type: '.$mime);
|
||||
header('Content-Disposition: inline;filename='.$headerName);
|
||||
if(strstr($mime,'text/')){
|
||||
//$charset = get_charset(file_get_contents($file));
|
||||
header('Content-Type: '.$mime.'; charset=');//避免自动追加utf8导致gbk网页乱码
|
||||
}
|
||||
}
|
||||
|
||||
//缓存文件
|
||||
|
@ -1073,8 +1079,8 @@ function file_put_out($file,$download=-1,$downFilename=false){
|
|||
$cur = $start;
|
||||
fseek($fp, $start,0);
|
||||
while(!feof($fp) && $cur <= $end){ // && (connection_status() == 0)
|
||||
print fread($fp, min(1024 * 100, ($end - $cur) + 1));
|
||||
$cur += 1024 * 100;
|
||||
print fread($fp, min(1024 * 200, ($end - $cur) + 1));
|
||||
$cur += 1024 *200;
|
||||
flush();
|
||||
}
|
||||
fclose($fp);
|
||||
|
@ -1103,7 +1109,7 @@ function file_download_this($from, $fileName,$headerSize=0){
|
|||
){
|
||||
break;
|
||||
}
|
||||
fwrite($downloadFp, fread($fp, 1024 * 8 ), 1024 * 8);
|
||||
fwrite($downloadFp, fread($fp, 1024 * 200 ), 1024 * 200);
|
||||
}
|
||||
//下载完成,重命名临时文件到目标文件
|
||||
fclose($downloadFp);
|
||||
|
@ -1165,7 +1171,7 @@ function get_post_max(){
|
|||
$upload = intval($upload)*1024*1024*0.8;
|
||||
$post = intval($post)*1024*1024*0.8;
|
||||
$the_max = $upload<$post?$upload:$post;
|
||||
return $the_max==0?1024*1024*0.6:$the_max;//获取不到则800k
|
||||
return $the_max==0?1024*1024*0.5:$the_max;//获取不到则500k
|
||||
}
|
||||
|
||||
|
||||
|
@ -1194,7 +1200,7 @@ function kod_move_uploaded_file($fromPath,$savePath){
|
|||
$out = @fopen($tempPath, "wb");
|
||||
if(!$in || !$out) return false;
|
||||
while (!feof($in)) {
|
||||
fwrite($out, fread($in, 409600));
|
||||
fwrite($out, fread($in, 1024*200));
|
||||
}
|
||||
fclose($in);
|
||||
fclose($out);
|
||||
|
@ -1210,17 +1216,27 @@ function kod_move_uploaded_file($fromPath,$savePath){
|
|||
}
|
||||
function check_upload($error){
|
||||
$status = array(
|
||||
'UPLOAD_ERR_OK', //没有错误发生,文件上传成功。
|
||||
'UPLOAD_ERR_INI_SIZE', //上传的文件超过了php.ini 中 upload_max_filesize 选项限制的值。
|
||||
'UPLOAD_ERR_FORM_SIZE', //上传文件的大小超过了 HTML 表单中 MAX_FILE_SIZE 选项指定的值。
|
||||
'UPLOAD_ERR_PARTIAL', //文件只有部分被上传。
|
||||
'UPLOAD_ERR_NO_FILE', //没有文件被上传。
|
||||
'UPLOAD_ERR_NO_TMP_DIR',//找不到临时文件夹。php 4.3.10 和 php 5.0.3 引进。
|
||||
'UPLOAD_ERR_CANT_WRITE',//文件写入失败。php 5.1.0 引进。
|
||||
'UPLOAD_ERR_OK', //0 没有错误发生,文件上传成功。
|
||||
'UPLOAD_ERR_INI_SIZE', //1 上传的文件超过了php.ini 中 upload_max_filesize 选项限制的值。
|
||||
'UPLOAD_ERR_FORM_SIZE', //2 上传文件的大小超过了 HTML 表单中 MAX_FILE_SIZE 选项指定的值。
|
||||
'UPLOAD_ERR_PARTIAL', //3 文件只有部分被上传。
|
||||
'UPLOAD_ERR_NO_FILE', //4 没有文件被上传。
|
||||
'UPLOAD_UNKNOW', //5 未定义
|
||||
'UPLOAD_ERR_NO_TMP_DIR',//6 找不到临时文件夹。php 4.3.10 和 php 5.0.3 引进。
|
||||
'UPLOAD_ERR_CANT_WRITE',//7 文件写入失败。php 5.1.0 引进。
|
||||
);
|
||||
return $error.':'.$status[$error];
|
||||
}
|
||||
|
||||
//拍照上传
|
||||
function updload_ios_check($fileName,$in){
|
||||
if(!is_wap()) return $fileName;
|
||||
if($fileName == "image.jpg" || $fileName == "image.jpeg"){
|
||||
return date('YmdHis',time()).'-'.rand_string(4,1).'.jpg';
|
||||
}
|
||||
return $fileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传处理。大文件支持分片上传
|
||||
* upload('file','D:/www/');
|
||||
|
@ -1237,22 +1253,18 @@ function upload($path,$tempPath,$repeatAction='replace'){
|
|||
if(!$uploadFile && $_FILES[$fileInput]['error']>0){
|
||||
show_json(check_upload($_FILES[$fileInput]['error']),false);
|
||||
}
|
||||
if($fileName == "image.jpg" && is_wap()){//拍照上传
|
||||
$fileName = iconv_system(path_clear_name($in["lastModifiedDate"])).'.jpg';
|
||||
}
|
||||
$fileName = updload_ios_check($fileName,$in);//拍照上传
|
||||
}else if (isset($in["name"])) {
|
||||
$fileName = iconv_system(path_clear_name($in["name"]));
|
||||
$uploadFile = "php://input";
|
||||
if(isset($in['base64Upload'])){
|
||||
$uploadFile = "base64";
|
||||
}
|
||||
if($fileName == "image.jpg" && is_wap()){//拍照上传
|
||||
$fileName = iconv_system(path_clear_name($in["lastModifiedDate"])).'.jpg';
|
||||
}
|
||||
$fileName = updload_ios_check($fileName,$in);//拍照上传
|
||||
}else if( isset($in["check_md5"]) ) {//断点续传检测
|
||||
$fileName = iconv_system(path_clear_name($in["file_name"]));
|
||||
$savePath = get_filename_auto($path.$fileName,""); //自动重命名
|
||||
return upload_chunk("",$tempPath,$savePath);
|
||||
$fileName = iconv_system(path_clear_name($in["name"]));
|
||||
$savePath = get_filename_auto($path.$fileName,""); //自动重命名
|
||||
return upload_chunk("--check_md5--",$tempPath,$savePath);
|
||||
}else{
|
||||
show_json('param error',false);
|
||||
}
|
||||
|
@ -1269,6 +1281,10 @@ function upload($path,$tempPath,$repeatAction='replace'){
|
|||
return upload_chunk($uploadFile,$tempPath,$savePath);
|
||||
}
|
||||
if(kod_move_uploaded_file($uploadFile,$savePath)){
|
||||
if( isset($in['size']) && filesize($savePath) != $in['size'] ){
|
||||
unlink($savePath);
|
||||
show_json('move_error',false);
|
||||
}
|
||||
Hook::trigger('uploadFileAfter',$savePath);
|
||||
show_json('upload_success',true,iconv_app(_DIR_OUT($savePath)));
|
||||
}else {
|
||||
|
@ -1310,7 +1326,7 @@ function upload_chunk($uploadFile,$tempPath,$savePath){
|
|||
}
|
||||
}
|
||||
if (!$done){
|
||||
show_json('upload_success',true,'chunk_'.$chunk.' success!');
|
||||
show_json('upload_success',true);
|
||||
}else{
|
||||
$savePathTemp = $tempFilePre.mtime();
|
||||
if(!$out = fopen($savePathTemp, "wb")){
|
||||
|
@ -1328,7 +1344,7 @@ function upload_chunk($uploadFile,$tempPath,$savePath){
|
|||
show_json('open chunk error! cur='.$chunk.';index='.$index,false);
|
||||
}
|
||||
while (!feof($fp_in)) {
|
||||
fwrite($out, fread($fp_in, 409600));
|
||||
fwrite($out, fread($fp_in,1024*200));
|
||||
}
|
||||
fclose($fp_in);
|
||||
unlink($chunk_file);
|
||||
|
@ -1338,6 +1354,10 @@ function upload_chunk($uploadFile,$tempPath,$savePath){
|
|||
}
|
||||
}
|
||||
$res = rename($savePathTemp,$savePath);
|
||||
if( isset($in['size']) && filesize($savePath) != $in['size'] ){
|
||||
unlink($savePath);
|
||||
show_json('move_error',false);
|
||||
}
|
||||
if(!$res){
|
||||
unlink($savePath);
|
||||
$res = rename($savePathTemp,$savePath);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
//扩展名权限判断 有权限则返回1 不是true
|
||||
function checkExt($file){
|
||||
if($GLOBALS['isRoot']) return 1;
|
||||
if (strstr($file,'<') || strstr($file,'>') || $file=='') {
|
||||
return 0;
|
||||
}
|
||||
|
@ -148,12 +149,12 @@ function get_charset(&$str) {
|
|||
$charsetGet = $charset;
|
||||
if ($charset == 'cp936'){
|
||||
// 有交叉,部分文件无法识别
|
||||
if(charset_check($str,'gbk') && charset_check($str,'gbk','big5')){
|
||||
$charset = 'gbk';
|
||||
}else if(charset_check($str,'big5') && charset_check($str,'big5','gbk')){
|
||||
$charset = 'big5';
|
||||
}else if(charset_check($str,'ISO-8859-4')){
|
||||
if(charset_check($str,'ISO-8859-4') && !charset_check($str,'gbk') && !charset_check($str,'big5')){
|
||||
$charset = 'ISO-8859-4';
|
||||
}elseif(charset_check($str,'gbk') && !charset_check($str,'big5')){
|
||||
$charset = 'gbk';
|
||||
}else if(charset_check($str,'big5')){
|
||||
$charset = 'big5';
|
||||
}
|
||||
}else if ($charset == 'euc-cn'){
|
||||
$charset = 'gbk';
|
||||
|
@ -165,8 +166,8 @@ function get_charset(&$str) {
|
|||
$check = array(
|
||||
'utf-8' => $charset,
|
||||
'utf-16' => 'gbk',
|
||||
'cp1252' => 'utf-8',
|
||||
'cp1251' => 'utf-8',
|
||||
'cp1252' => 'utf-8'
|
||||
);
|
||||
foreach($check as $key => $val){
|
||||
if(charset_check($str,$key,$val)){
|
||||
|
@ -211,6 +212,7 @@ function check_list_dir(){
|
|||
function php_env_check(){
|
||||
$error = '';
|
||||
if(!function_exists('iconv')) $error.= '<li>'.LNG('php_env_error').' iconv</li>';
|
||||
if(!function_exists('json_encode')) $error.= '<li>'.LNG('php_env_error').' json</li>';
|
||||
if(!function_exists('curl_init')) $error.= '<li>'.LNG('php_env_error').' curl</li>';
|
||||
if(!function_exists('mb_convert_encoding')) $error.= '<li>'.LNG('php_env_error').' mb_string</li>';
|
||||
if(!function_exists('file_get_contents')) $error.='<li>'.LNG('php_env_error').' file_get_contents</li>';
|
||||
|
@ -383,7 +385,8 @@ function user_logout(){
|
|||
setcookie('X-CSRF-TOKEN','',time()-3600);
|
||||
|
||||
$url = './index.php?user/login';
|
||||
if(ACT != 'logout'){ //不是主动退出则登陆后跳转到之前页面
|
||||
//之前界面维持,不是主动退出则登陆后跳转到之前页面
|
||||
if(ACT != 'logout' && count($_GET)!=0 ){
|
||||
$url .= '&link='.rawurlencode(this_url());
|
||||
}
|
||||
header('Location:'.$url);
|
||||
|
@ -484,5 +487,5 @@ function check_user_select($info){
|
|||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,788 @@
|
|||
<?php
|
||||
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
||||
|
||||
/**
|
||||
* Converts to and from JSON format.
|
||||
*
|
||||
* JSON (JavaScript Object Notation) is a lightweight data-interchange
|
||||
* format. It is easy for humans to read and write. It is easy for machines
|
||||
* to parse and generate. It is based on a subset of the JavaScript
|
||||
* Programming Language, Standard ECMA-262 3rd Edition - December 1999.
|
||||
* This feature can also be found in Python. JSON is a text format that is
|
||||
* completely language independent but uses conventions that are familiar
|
||||
* to programmers of the C-family of languages, including C, C++, C#, Java,
|
||||
* JavaScript, Perl, TCL, and many others. These properties make JSON an
|
||||
* ideal data-interchange language.
|
||||
*
|
||||
* This package provides a simple encoder and decoder for JSON notation. It
|
||||
* is intended for use with client-side Javascript applications that make
|
||||
* use of HTTPRequest to perform server communication functions - data can
|
||||
* be encoded into JSON notation for use in a client-side javascript, or
|
||||
* decoded from incoming Javascript requests. JSON format is native to
|
||||
* Javascript, and can be directly eval()'ed with no further parsing
|
||||
* overhead
|
||||
*
|
||||
* All strings should be in ASCII or UTF-8 format!
|
||||
*
|
||||
* LICENSE: Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met: Redistributions of source code must retain the
|
||||
* above copyright notice, this list of conditions and the following
|
||||
* disclaimer. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following disclaimer
|
||||
* in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||
* NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* @category
|
||||
* @package Services_JSON
|
||||
* @author Michal Migurski <mike-json@teczno.com>
|
||||
* @author Matt Knapp <mdknapp[at]gmail[dot]com>
|
||||
* @author Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
|
||||
* @copyright 2005 Michal Migurski
|
||||
* @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php
|
||||
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198
|
||||
*/
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_SLICE', 1);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_STR', 2);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_ARR', 3);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_OBJ', 4);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_CMT', 5);
|
||||
|
||||
/**
|
||||
* Behavior switch for Services_JSON::decode()
|
||||
*/
|
||||
define('SERVICES_JSON_LOOSE_TYPE', 16);
|
||||
|
||||
/**
|
||||
* Behavior switch for Services_JSON::decode()
|
||||
*/
|
||||
define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
|
||||
|
||||
/**
|
||||
* Converts to and from JSON format.
|
||||
*
|
||||
* Brief example of use:
|
||||
*
|
||||
* <code>
|
||||
* // create a new instance of Services_JSON
|
||||
* $json = new Services_JSON();
|
||||
*
|
||||
* // convert a complexe value to JSON notation, and send it to the browser
|
||||
* $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4)));
|
||||
* $output = $json->encode($value);
|
||||
*
|
||||
* print($output);
|
||||
* // prints: ["foo","bar",[1,2,"baz"],[3,[4]]]
|
||||
*
|
||||
* // accept incoming POST data, assumed to be in JSON notation
|
||||
* $input = file_get_contents('php://input', 1000000);
|
||||
* $value = $json->decode($input);
|
||||
* </code>
|
||||
*/
|
||||
class Services_JSON
|
||||
{
|
||||
/**
|
||||
* constructs a new JSON instance
|
||||
*
|
||||
* @param int $use object behavior flags; combine with boolean-OR
|
||||
*
|
||||
* possible values:
|
||||
* - SERVICES_JSON_LOOSE_TYPE: loose typing.
|
||||
* "{...}" syntax creates associative arrays
|
||||
* instead of objects in decode().
|
||||
* - SERVICES_JSON_SUPPRESS_ERRORS: error suppression.
|
||||
* Values which can't be encoded (e.g. resources)
|
||||
* appear as NULL instead of throwing errors.
|
||||
* By default, a deeply-nested resource will
|
||||
* bubble up with an error, so all return values
|
||||
* from encode() should be checked with isError()
|
||||
*/
|
||||
function __construct($use = 0)
|
||||
{
|
||||
$this->use = $use;
|
||||
}
|
||||
|
||||
/**
|
||||
* convert a string from one UTF-16 char to one UTF-8 char
|
||||
*
|
||||
* Normally should be handled by mb_convert_encoding, but
|
||||
* provides a slower PHP-only method for installations
|
||||
* that lack the multibye string extension.
|
||||
*
|
||||
* @param string $utf16 UTF-16 character
|
||||
* @return string UTF-8 character
|
||||
* @access private
|
||||
*/
|
||||
function utf162utf8($utf16)
|
||||
{
|
||||
// oh please oh please oh please oh please oh please
|
||||
if(function_exists('mb_convert_encoding')) {
|
||||
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
|
||||
}
|
||||
|
||||
$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
|
||||
|
||||
switch(true) {
|
||||
case ((0x7F & $bytes) == $bytes):
|
||||
// this case should never be reached, because we are in ASCII range
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0x7F & $bytes);
|
||||
|
||||
case (0x07FF & $bytes) == $bytes:
|
||||
// return a 2-byte UTF-8 character
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0xC0 | (($bytes >> 6) & 0x1F))
|
||||
. chr(0x80 | ($bytes & 0x3F));
|
||||
|
||||
case (0xFFFF & $bytes) == $bytes:
|
||||
// return a 3-byte UTF-8 character
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0xE0 | (($bytes >> 12) & 0x0F))
|
||||
. chr(0x80 | (($bytes >> 6) & 0x3F))
|
||||
. chr(0x80 | ($bytes & 0x3F));
|
||||
}
|
||||
|
||||
// ignoring UTF-32 for now, sorry
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* convert a string from one UTF-8 char to one UTF-16 char
|
||||
*
|
||||
* Normally should be handled by mb_convert_encoding, but
|
||||
* provides a slower PHP-only method for installations
|
||||
* that lack the multibye string extension.
|
||||
*
|
||||
* @param string $utf8 UTF-8 character
|
||||
* @return string UTF-16 character
|
||||
* @access private
|
||||
*/
|
||||
function utf82utf16($utf8)
|
||||
{
|
||||
// oh please oh please oh please oh please oh please
|
||||
if(function_exists('mb_convert_encoding')) {
|
||||
return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
|
||||
}
|
||||
|
||||
switch(strlen($utf8)) {
|
||||
case 1:
|
||||
// this case should never be reached, because we are in ASCII range
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return $utf8;
|
||||
|
||||
case 2:
|
||||
// return a UTF-16 character from a 2-byte UTF-8 char
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr(0x07 & (ord($utf8{0}) >> 2))
|
||||
. chr((0xC0 & (ord($utf8{0}) << 6))
|
||||
| (0x3F & ord($utf8{1})));
|
||||
|
||||
case 3:
|
||||
// return a UTF-16 character from a 3-byte UTF-8 char
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
return chr((0xF0 & (ord($utf8{0}) << 4))
|
||||
| (0x0F & (ord($utf8{1}) >> 2)))
|
||||
. chr((0xC0 & (ord($utf8{1}) << 6))
|
||||
| (0x7F & ord($utf8{2})));
|
||||
}
|
||||
|
||||
// ignoring UTF-32 for now, sorry
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* encodes an arbitrary variable into JSON format
|
||||
*
|
||||
* @param mixed $var any number, boolean, string, array, or object to be encoded.
|
||||
* see argument 1 to Services_JSON() above for array-parsing behavior.
|
||||
* if var is a strng, note that encode() always expects it
|
||||
* to be in ASCII or UTF-8 format!
|
||||
*
|
||||
* @return mixed JSON string representation of input var or an error if a problem occurs
|
||||
* @access public
|
||||
*/
|
||||
function encode($var)
|
||||
{
|
||||
switch (gettype($var)) {
|
||||
case 'boolean':
|
||||
return $var ? 'true' : 'false';
|
||||
|
||||
case 'NULL':
|
||||
return 'null';
|
||||
|
||||
case 'integer':
|
||||
return (int) $var;
|
||||
|
||||
case 'double':
|
||||
case 'float':
|
||||
return (float) $var;
|
||||
|
||||
case 'string':
|
||||
// STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
|
||||
$ascii = '';
|
||||
$strlen_var = strlen($var);
|
||||
|
||||
/*
|
||||
* Iterate over every character in the string,
|
||||
* escaping with a slash or encoding to UTF-8 where necessary
|
||||
*/
|
||||
for ($c = 0; $c < $strlen_var; ++$c) {
|
||||
|
||||
$ord_var_c = ord($var{$c});
|
||||
|
||||
switch (true) {
|
||||
case $ord_var_c == 0x08:
|
||||
$ascii .= '\b';
|
||||
break;
|
||||
case $ord_var_c == 0x09:
|
||||
$ascii .= '\t';
|
||||
break;
|
||||
case $ord_var_c == 0x0A:
|
||||
$ascii .= '\n';
|
||||
break;
|
||||
case $ord_var_c == 0x0C:
|
||||
$ascii .= '\f';
|
||||
break;
|
||||
case $ord_var_c == 0x0D:
|
||||
$ascii .= '\r';
|
||||
break;
|
||||
|
||||
case $ord_var_c == 0x22:
|
||||
case $ord_var_c == 0x2F:
|
||||
case $ord_var_c == 0x5C:
|
||||
// double quote, slash, slosh
|
||||
$ascii .= '\\'.$var{$c};
|
||||
break;
|
||||
|
||||
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
|
||||
// characters U-00000000 - U-0000007F (same as ASCII)
|
||||
$ascii .= $var{$c};
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xE0) == 0xC0):
|
||||
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c, ord($var{$c + 1}));
|
||||
$c += 1;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xF0) == 0xE0):
|
||||
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}));
|
||||
$c += 2;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xF8) == 0xF0):
|
||||
// characters U-00010000 - U-001FFFFF, mask 11110XXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}));
|
||||
$c += 3;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xFC) == 0xF8):
|
||||
// characters U-00200000 - U-03FFFFFF, mask 111110XX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}),
|
||||
ord($var{$c + 4}));
|
||||
$c += 4;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
|
||||
case (($ord_var_c & 0xFE) == 0xFC):
|
||||
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}),
|
||||
ord($var{$c + 4}),
|
||||
ord($var{$c + 5}));
|
||||
$c += 5;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return '"'.$ascii.'"';
|
||||
|
||||
case 'array':
|
||||
/*
|
||||
* As per JSON spec if any array key is not an integer
|
||||
* we must treat the the whole array as an object. We
|
||||
* also try to catch a sparsely populated associative
|
||||
* array with numeric keys here because some JS engines
|
||||
* will create an array with empty indexes up to
|
||||
* max_index which can cause memory issues and because
|
||||
* the keys, which may be relevant, will be remapped
|
||||
* otherwise.
|
||||
*
|
||||
* As per the ECMA and JSON specification an object may
|
||||
* have any string as a property. Unfortunately due to
|
||||
* a hole in the ECMA specification if the key is a
|
||||
* ECMA reserved word or starts with a digit the
|
||||
* parameter is only accessible using ECMAScript's
|
||||
* bracket notation.
|
||||
*/
|
||||
|
||||
// treat as a JSON object
|
||||
if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
|
||||
$properties = array_map(array($this, 'name_value'),
|
||||
array_keys($var),
|
||||
array_values($var));
|
||||
|
||||
foreach($properties as $property) {
|
||||
if(Services_JSON::isError($property)) {
|
||||
return $property;
|
||||
}
|
||||
}
|
||||
|
||||
return '{' . join(',', $properties) . '}';
|
||||
}
|
||||
|
||||
// treat it like a regular array
|
||||
$elements = array_map(array($this, 'encode'), $var);
|
||||
|
||||
foreach($elements as $element) {
|
||||
if(Services_JSON::isError($element)) {
|
||||
return $element;
|
||||
}
|
||||
}
|
||||
|
||||
return '[' . join(',', $elements) . ']';
|
||||
|
||||
case 'object':
|
||||
$vars = get_object_vars($var);
|
||||
|
||||
$properties = array_map(array($this, 'name_value'),
|
||||
array_keys($vars),
|
||||
array_values($vars));
|
||||
|
||||
foreach($properties as $property) {
|
||||
if(Services_JSON::isError($property)) {
|
||||
return $property;
|
||||
}
|
||||
}
|
||||
|
||||
return '{' . join(',', $properties) . '}';
|
||||
|
||||
default:
|
||||
return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
|
||||
? 'null'
|
||||
: new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* array-walking function for use in generating JSON-formatted name-value pairs
|
||||
*
|
||||
* @param string $name name of key to use
|
||||
* @param mixed $value reference to an array element to be encoded
|
||||
*
|
||||
* @return string JSON-formatted name-value pair, like '"name":value'
|
||||
* @access private
|
||||
*/
|
||||
function name_value($name, $value)
|
||||
{
|
||||
$encoded_value = $this->encode($value);
|
||||
|
||||
if(Services_JSON::isError($encoded_value)) {
|
||||
return $encoded_value;
|
||||
}
|
||||
|
||||
return $this->encode(strval($name)) . ':' . $encoded_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* reduce a string by removing leading and trailing comments and whitespace
|
||||
*
|
||||
* @param $str string string value to strip of comments and whitespace
|
||||
*
|
||||
* @return string string value stripped of comments and whitespace
|
||||
* @access private
|
||||
*/
|
||||
function reduce_string($str){
|
||||
$str = preg_replace(array(
|
||||
|
||||
// eliminate single line comments in '// ...' form
|
||||
'#^\s*//(.+)$#m',
|
||||
|
||||
// eliminate multi-line comments in '/* ... */' form, at start of string
|
||||
'#^\s*/\*(.+)\*/#Us',
|
||||
|
||||
// eliminate multi-line comments in '/* ... */' form, at end of string
|
||||
'#/\*(.+)\*/\s*$#Us'
|
||||
|
||||
), '', $str);
|
||||
|
||||
// eliminate extraneous space
|
||||
return trim($str);
|
||||
}
|
||||
|
||||
/**
|
||||
* decodes a JSON string into appropriate variable
|
||||
*
|
||||
* @param string $str JSON-formatted string
|
||||
*
|
||||
* @return mixed number, boolean, string, array, or object
|
||||
* corresponding to given JSON input string.
|
||||
* See argument 1 to Services_JSON() above for object-output behavior.
|
||||
* Note that decode() always returns strings
|
||||
* in ASCII or UTF-8 format!
|
||||
* @access public
|
||||
*/
|
||||
function decode($str)
|
||||
{
|
||||
$str = $this->reduce_string($str);
|
||||
|
||||
switch (strtolower($str)) {
|
||||
case 'true':
|
||||
return true;
|
||||
|
||||
case 'false':
|
||||
return false;
|
||||
|
||||
case 'null':
|
||||
return null;
|
||||
|
||||
default:
|
||||
$m = array();
|
||||
|
||||
if (is_numeric($str)) {
|
||||
// Lookie-loo, it's a number
|
||||
|
||||
// This would work on its own, but I'm trying to be
|
||||
// good about returning integers where appropriate:
|
||||
// return (float)$str;
|
||||
|
||||
// Return float or int, as appropriate
|
||||
return ((float)$str == (integer)$str)
|
||||
? (integer)$str
|
||||
: (float)$str;
|
||||
|
||||
} elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
|
||||
// STRINGS RETURNED IN UTF-8 FORMAT
|
||||
$delim = substr($str, 0, 1);
|
||||
$chrs = substr($str, 1, -1);
|
||||
$utf8 = '';
|
||||
$strlen_chrs = strlen($chrs);
|
||||
|
||||
for ($c = 0; $c < $strlen_chrs; ++$c) {
|
||||
|
||||
$substr_chrs_c_2 = substr($chrs, $c, 2);
|
||||
$ord_chrs_c = ord($chrs{$c});
|
||||
|
||||
switch (true) {
|
||||
case $substr_chrs_c_2 == '\b':
|
||||
$utf8 .= chr(0x08);
|
||||
++$c;
|
||||
break;
|
||||
case $substr_chrs_c_2 == '\t':
|
||||
$utf8 .= chr(0x09);
|
||||
++$c;
|
||||
break;
|
||||
case $substr_chrs_c_2 == '\n':
|
||||
$utf8 .= chr(0x0A);
|
||||
++$c;
|
||||
break;
|
||||
case $substr_chrs_c_2 == '\f':
|
||||
$utf8 .= chr(0x0C);
|
||||
++$c;
|
||||
break;
|
||||
case $substr_chrs_c_2 == '\r':
|
||||
$utf8 .= chr(0x0D);
|
||||
++$c;
|
||||
break;
|
||||
|
||||
case $substr_chrs_c_2 == '\\"':
|
||||
case $substr_chrs_c_2 == '\\\'':
|
||||
case $substr_chrs_c_2 == '\\\\':
|
||||
case $substr_chrs_c_2 == '\\/':
|
||||
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
|
||||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
|
||||
$utf8 .= $chrs{++$c};
|
||||
}
|
||||
break;
|
||||
|
||||
case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):
|
||||
// single, escaped unicode character
|
||||
$utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))
|
||||
. chr(hexdec(substr($chrs, ($c + 4), 2)));
|
||||
$utf8 .= $this->utf162utf8($utf16);
|
||||
$c += 5;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
|
||||
$utf8 .= $chrs{$c};
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xE0) == 0xC0:
|
||||
// characters U-00000080 - U-000007FF, mask 110XXXXX
|
||||
//see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 2);
|
||||
++$c;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xF0) == 0xE0:
|
||||
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 3);
|
||||
$c += 2;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xF8) == 0xF0:
|
||||
// characters U-00010000 - U-001FFFFF, mask 11110XXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 4);
|
||||
$c += 3;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xFC) == 0xF8:
|
||||
// characters U-00200000 - U-03FFFFFF, mask 111110XX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 5);
|
||||
$c += 4;
|
||||
break;
|
||||
|
||||
case ($ord_chrs_c & 0xFE) == 0xFC:
|
||||
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$utf8 .= substr($chrs, $c, 6);
|
||||
$c += 5;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $utf8;
|
||||
|
||||
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
|
||||
// array, or object notation
|
||||
|
||||
if ($str{0} == '[') {
|
||||
$stk = array(SERVICES_JSON_IN_ARR);
|
||||
$arr = array();
|
||||
} else {
|
||||
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
||||
$stk = array(SERVICES_JSON_IN_OBJ);
|
||||
$obj = array();
|
||||
} else {
|
||||
$stk = array(SERVICES_JSON_IN_OBJ);
|
||||
$obj = new stdClass();
|
||||
}
|
||||
}
|
||||
|
||||
array_push($stk, array('what' => SERVICES_JSON_SLICE,
|
||||
'where' => 0,
|
||||
'delim' => false));
|
||||
|
||||
$chrs = substr($str, 1, -1);
|
||||
$chrs = $this->reduce_string($chrs);
|
||||
|
||||
if ($chrs == '') {
|
||||
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||
return $arr;
|
||||
|
||||
} else {
|
||||
return $obj;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//print("\nparsing {$chrs}\n");
|
||||
|
||||
$strlen_chrs = strlen($chrs);
|
||||
|
||||
for ($c = 0; $c <= $strlen_chrs; ++$c) {
|
||||
|
||||
$top = end($stk);
|
||||
$substr_chrs_c_2 = substr($chrs, $c, 2);
|
||||
|
||||
if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
|
||||
// found a comma that is not inside a string, array, etc.,
|
||||
// OR we've reached the end of the character list
|
||||
$slice = substr($chrs, $top['where'], ($c - $top['where']));
|
||||
array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
|
||||
//print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||
// we are in an array, so just push an element onto the stack
|
||||
array_push($arr, $this->decode($slice));
|
||||
|
||||
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
|
||||
// we are in an object, so figure
|
||||
// out the property name and set an
|
||||
// element in an associative array,
|
||||
// for now
|
||||
$parts = array();
|
||||
|
||||
if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
|
||||
// "name":value pair
|
||||
$key = $this->decode($parts[1]);
|
||||
$val = $this->decode($parts[2]);
|
||||
|
||||
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
||||
$obj[$key] = $val;
|
||||
} else {
|
||||
$obj->$key = $val;
|
||||
}
|
||||
} elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
|
||||
// name:value pair, where name is unquoted
|
||||
$key = $parts[1];
|
||||
$val = $this->decode($parts[2]);
|
||||
|
||||
if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
|
||||
$obj[$key] = $val;
|
||||
} else {
|
||||
$obj->$key = $val;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
|
||||
// found a quote, and we are not inside a string
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
|
||||
//print("Found start of string at {$c}\n");
|
||||
|
||||
} elseif (($chrs{$c} == $top['delim']) &&
|
||||
($top['what'] == SERVICES_JSON_IN_STR) &&
|
||||
((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
|
||||
// found a quote, we're in a string, and it's not escaped
|
||||
// we know that it's not escaped becase there is _not_ an
|
||||
// odd number of backslashes at the end of the string so far
|
||||
array_pop($stk);
|
||||
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
|
||||
|
||||
} elseif (($chrs{$c} == '[') &&
|
||||
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||
// found a left-bracket, and we are in an array, object, or slice
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
|
||||
//print("Found start of array at {$c}\n");
|
||||
|
||||
} elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
|
||||
// found a right-bracket, and we're in an array
|
||||
array_pop($stk);
|
||||
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
} elseif (($chrs{$c} == '{') &&
|
||||
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||
// found a left-brace, and we are in an array, object, or slice
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
|
||||
//print("Found start of object at {$c}\n");
|
||||
|
||||
} elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
|
||||
// found a right-brace, and we're in an object
|
||||
array_pop($stk);
|
||||
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
} elseif (($substr_chrs_c_2 == '/*') &&
|
||||
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||
// found a comment start, and we are in an array, object, or slice
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
|
||||
$c++;
|
||||
//print("Found start of comment at {$c}\n");
|
||||
|
||||
} elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
|
||||
// found a comment end, and we're in one now
|
||||
array_pop($stk);
|
||||
$c++;
|
||||
|
||||
for ($i = $top['where']; $i <= $c; ++$i)
|
||||
$chrs = substr_replace($chrs, ' ', $i, 1);
|
||||
|
||||
//print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||
return $arr;
|
||||
|
||||
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
|
||||
return $obj;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo Ultimately, this should just call PEAR::isError()
|
||||
*/
|
||||
function isError($data, $code = null){
|
||||
if (class_exists('pear')) {
|
||||
return PEAR::isError($data, $code);
|
||||
} elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
|
||||
is_subclass_of($data, 'services_json_error'))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (class_exists('PEAR_Error')) {
|
||||
class Services_JSON_Error extends PEAR_Error{
|
||||
function __construct($message = 'unknown error', $code = null,
|
||||
$mode = null, $options = null, $userinfo = null){
|
||||
parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
class Services_JSON_Error{
|
||||
function __construct($message = 'unknown error', $code = null,
|
||||
$mode = null, $options = null, $userinfo = null){
|
||||
}
|
||||
}
|
||||
}
|
|
@ -41,6 +41,12 @@ function get_url_link($url){
|
|||
$port = (empty($res["port"]) || $res["port"] == '80')?'':':'.$res["port"];
|
||||
return $res['scheme']."://".$res["host"].$port.$res['path'];
|
||||
}
|
||||
function get_url_root($url){
|
||||
if(!$url) return "";
|
||||
$res = parse_url($url);
|
||||
$port = (empty($res["port"]) || $res["port"] == '80')?'':':'.$res["port"];
|
||||
return $res['scheme']."://".$res["host"].$port.'/';
|
||||
}
|
||||
function get_url_domain($url){
|
||||
if(!$url) return "";
|
||||
$res = parse_url($url);
|
||||
|
@ -48,6 +54,11 @@ function get_url_domain($url){
|
|||
}
|
||||
|
||||
function get_host() {
|
||||
//兼容子目录反向代理:只能是前端js通过cookie传入到后端进行处理
|
||||
if(isset($_COOKIE['HOST']) && isset($_COOKIE['APP_HOST'])){
|
||||
return $_COOKIE['HOST'];
|
||||
}
|
||||
|
||||
$protocol = (!empty($_SERVER['HTTPS'])
|
||||
&& $_SERVER['HTTPS'] !== 'off'
|
||||
|| $_SERVER['SERVER_PORT'] === 443) ? 'https://' : 'http://';
|
||||
|
@ -96,7 +107,7 @@ function is_wap(){
|
|||
if(!isset($_SERVER['HTTP_USER_AGENT'])){
|
||||
return false;
|
||||
}
|
||||
if(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|iphone|ipad|ipod|android|xoom)/i',
|
||||
if(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|iphone|ipad|ipod|android|xoom|miui)/i',
|
||||
strtolower($_SERVER['HTTP_USER_AGENT']))){
|
||||
return true;
|
||||
}
|
||||
|
@ -266,6 +277,12 @@ function curl_progress_get($file,$uuid=''){
|
|||
// http://blog.csdn.net/havedream_one/article/details/52585331
|
||||
// php7.1 curl上传中文路径文件失败问题?【暂时通过重命名方式解决】
|
||||
function url_request($url,$method='GET',$data=false,$headers=false,$options=false,$json=false,$timeout=3600){
|
||||
if(!$url){
|
||||
return array(
|
||||
'data' => 'url error! url='.$url,
|
||||
'code' => 0
|
||||
);
|
||||
}
|
||||
ignore_timeout();
|
||||
$ch = curl_init();
|
||||
$upload = false;
|
||||
|
@ -312,11 +329,19 @@ function url_request($url,$method='GET',$data=false,$headers=false,$options=fals
|
|||
|
||||
// post数组或拼接的参数;不同方式服务器兼容性有所差异
|
||||
// http://blog.csdn.net/havedream_one/article/details/52585331
|
||||
if ($data && is_array($headers) && $method != 'DOWNLOAD' &&
|
||||
in_array('Content-Type: application/x-www-form-urlencoded',$headers)) {
|
||||
$data = http_build_query($data);
|
||||
// post默认用array发送;content-type为x-www-form-urlencoded时用key=1&key=2的形式
|
||||
if (is_array($data) && is_array($headers) && $method != 'DOWNLOAD'){
|
||||
foreach ($headers as $key) {
|
||||
if(strstr($key,'x-www-form-urlencoded')){
|
||||
$data = http_build_query($data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($method == 'GET' && $data){
|
||||
if(is_array($data)){
|
||||
$data = http_build_query($data);
|
||||
}
|
||||
if(strstr($url,'?')){
|
||||
$url = $url.'&'.$data;
|
||||
}else{
|
||||
|
@ -429,7 +454,10 @@ function url_request($url,$method='GET',$data=false,$headers=false,$options=fals
|
|||
);
|
||||
return $return;
|
||||
}
|
||||
|
||||
function curl_get_contents($url){
|
||||
$data = url_request($url);
|
||||
return $data['data'];
|
||||
}
|
||||
|
||||
function get_headers_curl($url,$timeout=30,$depth=0,&$headers=array()){
|
||||
if(!function_exists('curl_init')){
|
||||
|
@ -635,7 +663,7 @@ function stripslashes_deep($value){
|
|||
}
|
||||
|
||||
function parse_url_route(){
|
||||
$param = str_replace($_SERVER['SCRIPT_NAME'],"",$_SERVER['PHP_SELF']);
|
||||
$param = str_replace($_SERVER['SCRIPT_NAME'],"",$_SERVER['SCRIPT_NAME']);
|
||||
if($param && substr($param,0,1) == '/'){
|
||||
$arr = explode('&',$param);
|
||||
$arr[0] = ltrim($arr[0],'/');
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -163,27 +163,24 @@ class FileCache{
|
|||
public static function load($file){//10000次需要4s 数据量差异不大。
|
||||
if (!$file) return false;
|
||||
$file = iconv_system($file);
|
||||
$fileLock = $file.'.lock';
|
||||
if ( (!file_exists($file) || filesize($file) == 0 ) &&
|
||||
!file_exists($fileLock) ){//并发下;正在写或删除
|
||||
@file_put_contents($file,CONFIG_EXIT);
|
||||
if ( !file_exists($file) ){
|
||||
@file_put_contents($file,CONFIG_EXIT.'[]');
|
||||
chmod_path($file,0777);
|
||||
return array();
|
||||
}
|
||||
|
||||
$str = file_read_safe($file,10.4);
|
||||
if($str === false || strlen($str) == 0){
|
||||
//服务器崩溃下文件不存在异常恢复
|
||||
if( (!file_exists($file) || filesize($file) == 0 ) &&
|
||||
file_exists($fileLock) &&
|
||||
@filemtime($fileLock) > 1000 &&
|
||||
time() - @filemtime($fileLock) > 10
|
||||
){
|
||||
@rename($fileLock,$file);
|
||||
}
|
||||
if (strlen($str) == 0 ||
|
||||
strlen($str) == strlen(CONFIG_EXIT) ){
|
||||
@file_put_contents($file,CONFIG_EXIT.'[]');
|
||||
chmod_path($file,0777);
|
||||
return array();
|
||||
}
|
||||
|
||||
if($str === false || strlen($str) < strlen(CONFIG_EXIT) ){
|
||||
show_tips('[Error Code:1010] FileCache load error!'.$file);
|
||||
}
|
||||
|
||||
$str = substr($str, strlen(CONFIG_EXIT));
|
||||
$data= json_decode($str,true);
|
||||
$data= json_decode(substr($str, strlen(CONFIG_EXIT)),true);
|
||||
if (is_null($data)) $data = array();
|
||||
return $data;
|
||||
}
|
||||
|
@ -193,24 +190,22 @@ class FileCache{
|
|||
public static function save($file,$data){//10000次需要6s
|
||||
if (!$file) return false;
|
||||
$file = iconv_system($file);
|
||||
if (!file_exists($file)){
|
||||
@touch($file);
|
||||
if ( !file_exists($file) ){
|
||||
@file_put_contents($file,CONFIG_EXIT);
|
||||
chmod_path($file,0777);
|
||||
}
|
||||
chmod_path($file,0777);
|
||||
|
||||
if (!path_writeable($file)) {
|
||||
show_tips(BASIC_PATH."<br/>".LNG('path_can_not_write_data'));
|
||||
}
|
||||
|
||||
if(defined('JSON_PRETTY_PRINT')){
|
||||
//$jsonStr = json_encode($data);
|
||||
$jsonStr = json_encode($data,JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT);
|
||||
}else{
|
||||
$jsonStr = json_encode($data);
|
||||
}
|
||||
if(is_null($jsonStr)){//含有二进制或非utf8字符串对应检测
|
||||
if(is_null($jsonStr) || strlen($jsonStr) == 0){//含有二进制或非utf8字符串对应检测
|
||||
show_tips('json_encode error!');
|
||||
}
|
||||
$buffer = CONFIG_EXIT.$jsonStr;
|
||||
return file_wirte_safe($file,$buffer,20.3);
|
||||
return file_wirte_safe($file,CONFIG_EXIT.$jsonStr,20.3);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,12 +39,12 @@ class Hook{
|
|||
$class = new $className();
|
||||
if( method_exists($class,$functionName) ){
|
||||
//return $class -> $functionName($args);
|
||||
return call_user_func_array(array($class,$functionName), $args);
|
||||
return @call_user_func_array(array($class,$functionName), $args);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(function_exists($action)){
|
||||
return call_user_func_array($action, $args);
|
||||
return @call_user_func_array($action, $args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,10 +93,11 @@ class KodArchive {
|
|||
if($result){
|
||||
//编码转换
|
||||
$charset = unzip_charset_get($result);
|
||||
$output = $output && $charset != 'utf-8' && function_exists('iconv');
|
||||
$output = $output && function_exists('iconv');
|
||||
for ($i=0; $i < count($result); $i++) {
|
||||
//不允许相对路径
|
||||
$result[$i]['filename'] = str_replace(array('../','..\\'),"_",$result[$i]['filename']);
|
||||
$charset = get_charset($result[$i]['filename']);
|
||||
if($output){
|
||||
$result[$i]['filename'] = iconv_to($result[$i]['filename'],$charset,'utf-8');
|
||||
unset($result[$i]['stored_filename']);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
|
||||
class Mcrypt{
|
||||
public $default_key = 'a!takA:dlmcldEv,e';
|
||||
public static $default_key = 'a!takA:dlmcldEv,e';
|
||||
|
||||
/**
|
||||
* 字符加解密,一次一密,可定时解密有效
|
||||
|
@ -28,7 +28,7 @@ class Mcrypt{
|
|||
*/
|
||||
public static function encode($string,$key = '', $expiry = 0){
|
||||
$ckeyLength = 4;
|
||||
$key = md5($key ? $key : $this->default_key); //解密密匙
|
||||
$key = md5($key ? $key : self::$default_key); //解密密匙
|
||||
$keya = md5(substr($key, 0, 16)); //做数据完整性验证
|
||||
$keyb = md5(substr($key, 16, 16)); //用于变化生成的密文 (初始化向量IV)
|
||||
$keyc = substr(md5(microtime()), - $ckeyLength);
|
||||
|
@ -78,7 +78,7 @@ class Mcrypt{
|
|||
{
|
||||
$string = str_replace(array('-', '_', '.'),array('+', '/', '='), $string);
|
||||
$ckeyLength = 4;
|
||||
$key = md5($key ? $key : $this->default_key); //解密密匙
|
||||
$key = md5($key ? $key : self::$default_key); //解密密匙
|
||||
$keya = md5(substr($key, 0, 16)); //做数据完整性验证
|
||||
$keyb = md5(substr($key, 16, 16)); //用于变化生成的密文 (初始化向量IV)
|
||||
$keyc = substr($string, 0, $ckeyLength);
|
||||
|
|
|
@ -24,7 +24,7 @@ class PluginBase{
|
|||
|
||||
$this->pluginName = str_replace('Plugin','',get_class($this));
|
||||
$this->pluginPath = PLUGIN_DIR.$this->pluginName.'/';
|
||||
$this->pluginApi = APP_HOST.'index.php?pluginApp/to/'.$this->pluginName.'/';
|
||||
$this->pluginApi = rtrim(APP_HOST,'/').'/index.php?pluginApp/to/'.$this->pluginName.'/';
|
||||
$this->pluginHost = $this->config['settings']['pluginHost'].$this->pluginName.'/';
|
||||
$this->pluginHostDefault = PLUGIN_HOST.$this->pluginName.'/';
|
||||
$this->pluginLangArr = $this->initLang();
|
||||
|
@ -35,6 +35,7 @@ class PluginBase{
|
|||
$this->setConfig(array());
|
||||
}
|
||||
public function install(){}
|
||||
public function update(){}
|
||||
public function unInstall(){}
|
||||
|
||||
|
||||
|
@ -123,6 +124,32 @@ class PluginBase{
|
|||
$this->packageData = $result;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取package.json中的数据;通过key获取,支持auther.copyright 多级获取
|
||||
* @param [type] $key [description]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function packageInfoGet($key){
|
||||
$data = $this->appPackage();
|
||||
$result = null;
|
||||
$keyArr = explode('.',$key);
|
||||
for ($i = 0; $i < count($keyArr); $i++) {
|
||||
if($i == 0){
|
||||
$result = $data[$keyArr[$i]];
|
||||
continue;
|
||||
}
|
||||
if(is_array($result)){
|
||||
$result = $result[$keyArr[$i]];
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public function packageVersion(){return $this->packageInfoGet('version');}
|
||||
public function packageTitle(){return $this->packageInfoGet('title');}
|
||||
public function packageCopyright(){return $this->packageInfoGet('auther.copyright');}
|
||||
|
||||
private function parseFile($file){
|
||||
$content = file_get_contents($file);
|
||||
|
|
|
@ -94,8 +94,10 @@ class pluginModel{
|
|||
$pluginList = &$this->config['settingSystem']['pluginList'];
|
||||
if(is_array($pluginList[$app])){
|
||||
if($open){
|
||||
$config = $this->getConfig($app);
|
||||
$default = $this->getConfigDefault($app);
|
||||
$config = array_merge($default,$config);//保存初始配置;兼容新增默认配置
|
||||
Hook::apply($app.'Plugin.regiest');
|
||||
$config = $this->getConfig($app,true);
|
||||
$this->setConfig($app,$config);
|
||||
}
|
||||
$pluginList[$app]['status'] = $open;
|
||||
|
@ -120,18 +122,17 @@ class pluginModel{
|
|||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function getPackageJson($app){
|
||||
return Hook::apply($app.'Plugin.appPackage');
|
||||
}
|
||||
public function getConfig($app,$force = false){
|
||||
public function getConfig($app){
|
||||
$result = array();
|
||||
$pluginList = &$this->config['settingSystem']['pluginList'];
|
||||
if( isset($pluginList[$app]) &&
|
||||
is_array($pluginList[$app]['config']) ){
|
||||
$result = $pluginList[$app]['config'];
|
||||
}
|
||||
if(!$result || $force){
|
||||
if(!$result){
|
||||
$result = $this->getConfigDefault($app);
|
||||
}
|
||||
return $result;
|
||||
|
|
|
@ -56,6 +56,9 @@
|
|||
<div class="content-info">
|
||||
<div class="name"></div>
|
||||
<div class="size"><span></span><i class="share-time"></i></div>
|
||||
<div class="btn-group">
|
||||
<a type="button" class="btn btn-primary btn-download" href=""><?php echo LNG('download');?></a>
|
||||
</div>
|
||||
<div class="error-tips"><?php echo LNG('share_error_show_tips');?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
}else{
|
||||
echo LNG('copyright_pre').' v'.KOD_VERSION.' | '.LNG('copyright_info');
|
||||
}
|
||||
echo '<a href="javascript:core.copyright();" class="icon-info-sign copyright-bottom"></a>';
|
||||
echo '<a href="javascript:core.copyright();" class="icon-info-sign copyright-bottom pl-5"></a>';
|
||||
if(isset($settingSystem['globalIcp'])){
|
||||
echo " ".$settingSystem['globalIcp'];
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta http-equiv="Content-Script-Type" content="text/javascript">
|
||||
<meta http-equiv="Cache-Control" content="no-transform">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="description" itemprop="description" content="<?php echo LNG('kod_meta_description');?>">
|
||||
|
@ -12,12 +13,25 @@
|
|||
<meta name="author" content="<?php echo LNG('kod_meta_name');?>" />
|
||||
<meta name="copyright" content="<?php echo LNG('kod_meta_copyright');?>" />
|
||||
<meta itemprop="image" content="<?php echo STATIC_PATH;?>images/common/ico.png?ver=<?php echo KOD_VERSION;?>" />
|
||||
<link href="<?php echo STATIC_PATH;?>images/common/ico.ico?ver=<?php echo KOD_VERSION;?>" rel="Shortcut Icon" type="image/x-icon">
|
||||
<link href="<?php echo STATIC_PATH;?>images/common/ico.ico?ver=<?php echo KOD_VERSION;?>" rel="icon" type="image/x-icon">
|
||||
<link href="<?php echo STATIC_PATH;?>images/common/ico.png?ver=<?php echo KOD_VERSION;?>" rel="Shortcut Icon" type="image/x-icon">
|
||||
<link href="<?php echo STATIC_PATH;?>images/common/ico.png?ver=<?php echo KOD_VERSION;?>" rel="icon" type="image/x-icon">
|
||||
<link href="<?php echo STATIC_PATH;?>style/common.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet"/>
|
||||
<link href="./static/style/font-awesome/css/font-awesome.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
|
||||
<!--[if IE 7]>
|
||||
<link rel="stylesheet" href="./static/style/font-awesome/css/font-awesome-ie7.css">
|
||||
<![endif]-->
|
||||
<?php Hook::trigger('templateCommonHeader');?>
|
||||
|
||||
<?php
|
||||
Hook::trigger('templateCommonHeader');
|
||||
function pageBackground(){
|
||||
$arr = explode(',',$GLOBALS['config']['settingSystem']['wallpageLogin']);
|
||||
$background = $arr[mt_rand(0,count($arr)-1)];
|
||||
if(!$background){
|
||||
$background = 'linear-gradient(160deg, #5648c1, #6fe3e7)';
|
||||
}else if(!strstr($background,'/')){
|
||||
$background = "url('./static/images/wall_page/{$background}.jpg')";
|
||||
}else{
|
||||
$background = "url('{$background}')";
|
||||
}
|
||||
return "<style type='text/css'>.aero:before,.aero:after,.background{background-color:#bbb;background-image:{$background};}</style>\n";
|
||||
}
|
||||
?>
|
|
@ -22,7 +22,10 @@
|
|||
foreach ($config['settingSystem']['menu'] as $key=>$value) {
|
||||
if ($value['use']!='1') continue;
|
||||
$has = ST==$value['name']?'this':'';
|
||||
$target = " target='".$value['target']."'" ;
|
||||
$target = " target='_self'" ;
|
||||
if($value['target']=='1' || $value['target'] == '_blank'){
|
||||
$target = " target='_blank'" ;
|
||||
}
|
||||
$name = rawurldecode($value['name']);
|
||||
if(LNG('ui_'.$name) != 'ui_'.$name){
|
||||
$name = "<i class='font-icon menu-".$name."'></i><span>".LNG('ui_'.$name).'</span>';
|
||||
|
@ -76,7 +79,14 @@
|
|||
<!-- 全局设置语言则不再显示 -->
|
||||
|
||||
<div class="menu-group">
|
||||
<a href="#" id='topbar-user' data-toggle="dropdown" class="topbar-menu"><i class="font-icon icon-user"></i><?php echo $_SESSION['kodUser']['name'];?> <b class="caret"></b></a>
|
||||
<a href="#" id='topbar-user' data-toggle="dropdown" class="topbar-menu">
|
||||
<i class="font-icon icon-user"></i>
|
||||
<?php
|
||||
$user = $_SESSION['kodUser'];
|
||||
echo $user['nickName']?$user['nickName']:$user['name'];
|
||||
?>
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu menu-topbar-user pull-right animated menuShow" role="menu" aria-labelledby="topbar-user">
|
||||
<?php if($GLOBALS['isRoot']){ ?>
|
||||
<li class="menu-system-setting"><a href="#" onclick="core.setting('system');"><i class="font-icon icon-cog"></i><?php echo LNG('system_setting');?></a></li>
|
||||
|
|
|
@ -0,0 +1,85 @@
|
|||
<?php include(TEMPLATE.'common/header.html');?>
|
||||
<title><?php echo $title;?></title>
|
||||
<script type="text/javascript" src="<?php echo STATIC_PATH;?>js/lib/jquery-1.8.0.min.js?ver=<?php echo KOD_VERSION;?>"></script>
|
||||
<style type="text/css">
|
||||
body{background-color:#f0f2f5;}
|
||||
body a,body a:hover{color: #1890ff;}
|
||||
.body-panel{
|
||||
width:70%;margin:10% auto 5% auto;
|
||||
font-size: 13px;
|
||||
color:#666;
|
||||
background:#fff;border-radius:4px;
|
||||
padding-top:50px;padding-bottom:100px;
|
||||
box-shadow: 0 5px 20px rgba(0,0,0,0.05);
|
||||
}
|
||||
.body-panel .check-result{text-align: center;color:#000;}
|
||||
.body-panel .check-result .icon{width:70px;height:70px;line-height:70px;font-size:30px;}
|
||||
.check-result-title{font-size: 24px;line-height: 32px;margin:20px 0;}
|
||||
.check-result-desc{
|
||||
color: #333;
|
||||
margin: 0 0 20px 0;
|
||||
background: #fafafa;
|
||||
font-size: 16px;
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
border-radius: 2px;
|
||||
padding: 24px 40px;
|
||||
text-align: left;
|
||||
}
|
||||
.error-info{border-left: 5px solid #1890ff;padding-left: 10px;}
|
||||
.location-to{padding: 10px 0;color: #888;font-size: 13px;font-style: italic;}
|
||||
.icon{
|
||||
font-family: FontAwesome;
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background: rgba(0, 0, 0, 0.02);
|
||||
text-align: center;
|
||||
color: #666;
|
||||
border-radius: 50%;
|
||||
line-height: 20px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.icon.icon-loading{
|
||||
-webkit-animation: moveCircleLoopRight 1.4s infinite linear;
|
||||
animation: moveCircleLoopRight 1.4s infinite linear;
|
||||
}
|
||||
.icon.icon-loading:before{content:"\f110";}
|
||||
.icon.icon-success{background:#52c41a;color:#fff;}
|
||||
.icon.icon-success:before{content:"\f00c";}
|
||||
.icon.icon-error{background:#f5222d;color:#fff;}
|
||||
.icon.icon-error:before{content:"\f00d";}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<div class="body-panel">
|
||||
<div class="check-result">
|
||||
<!-- <div class="icon icon-error"></div> -->
|
||||
<div class="check-result-title"><?php echo $title;?></div>
|
||||
<div class="check-result-desc">
|
||||
<span class="error-info"><?php echo $message;?></span>
|
||||
<div class="location-to"><?php echo $info;?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($url){ ?>
|
||||
<script>
|
||||
var timeout = parseInt("<?php echo $time;?>");
|
||||
var link = "<?php echo $url;?>";
|
||||
var loop = setInterval(function(){
|
||||
timeout --;
|
||||
var info = timeout + "s 后自动跳转, <a href='"+link+"'>立即跳转</a>";
|
||||
$('.location-to').html(info);
|
||||
if(timeout<=0){
|
||||
clearInterval(loop);
|
||||
window.location.href = link;
|
||||
}
|
||||
},1000);
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -4,7 +4,10 @@
|
|||
<link rel="stylesheet" href="<?php echo STATIC_PATH;?>style/skin/<?php echo $config['user']['theme'];?>.css?ver=<?php echo KOD_VERSION;?>" id='link-theme-style'/>
|
||||
|
||||
</head>
|
||||
<body <?php echo $codeThemeBlack;?>>
|
||||
<body <?php echo $codeThemeBlack;?>>
|
||||
<div class="init-loading">
|
||||
<div><img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif"/></div>
|
||||
</div>
|
||||
<div class="edit-main" style="height: 100%;" oncontextmenu="return core.contextmenu();">
|
||||
<div class="tools">
|
||||
<div class="left top-toolbar">
|
||||
|
@ -49,7 +52,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="edit-body">
|
||||
<div class="introduction">
|
||||
<div class="introduction hidden">
|
||||
<button class="btn btn-default font-icon icon-remove close-item"></button>
|
||||
<?php include(LANGUAGE_PATH.I18n::getType().'/edit.html');?>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
|
@ -57,6 +61,7 @@
|
|||
<div class="bottom-toolbar hidden">
|
||||
<a class="toolbar-menu menu-view-goto-line editor_position" href="javascript:;">0:0</a>
|
||||
<a class="file-mode" href="javascript:;">text</a>
|
||||
<a class="toolbar-menu menu-view-file-charset " href="javascript:;">UTF-8</a>
|
||||
<a class="toolbar-menu menuViewTab config-tab" href="javascript:;">Tabs:4</a>
|
||||
<a class="toolbar-menu menu-view-setting config" href="javascript:;"><i class="font-icon icon-cog"></i></a>
|
||||
<div style="clear:both"></div>
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
<button data-action='download' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-download"></i><?php echo LNG('download');?>
|
||||
</button>
|
||||
</button>
|
||||
</div>
|
||||
<span class='msg'><?php echo LNG('path_loading');?></span>
|
||||
<div class="clear"></div>
|
||||
|
@ -81,48 +81,80 @@
|
|||
<!-- 回收站tool -->
|
||||
<div class="kod-toolbar kod-toolbar-recycle btn-group btn-group-sm hidden fl-left">
|
||||
<button data-action='recycle-clear' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-folder-close-alt"></i><?php echo LNG('recycle_clear');?>
|
||||
</button>
|
||||
<i class="font-icon icon-folder-close-alt"></i><?php echo LNG('recycle_clear');?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- 分享 tool -->
|
||||
<div class="kod-toolbar kod-toolbar-share btn-group btn-group-sm hidden fl-left">
|
||||
<button data-action='refresh' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-refresh"></i><?php echo LNG('refresh');?>
|
||||
</button>
|
||||
<div class="kod-toolbar kod-toolbar-share hidden fl-left">
|
||||
<button data-action='refresh' class="btn btn-sm btn-default fl-left" type="button">
|
||||
<i class="font-icon icon-refresh"></i><?php echo LNG('refresh');?>
|
||||
</button>
|
||||
<div class="select-button-show-share btn-group btn-group-sm fl-left ml-10 mr-10 hidden">
|
||||
<button data-action='remove' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-remove"></i><?php echo LNG('share_remove');?>
|
||||
</button>
|
||||
<button data-action='shareEdit' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-edit"></i><?php echo LNG('share_edit');?>
|
||||
</button>
|
||||
<button data-action='shareOpenWindow' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-link"></i><?php echo LNG('share_open_page');?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 文件功能 -->
|
||||
<div class="kod-toolbar kod-toolbar-path fl-left">
|
||||
<div class="btn-group btn-group-sm fl-left mr-10">
|
||||
<div class="select-button-default btn-group btn-group-sm fl-left mr-10">
|
||||
<button data-action='newfolder' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-folder-close-alt"></i><?php echo LNG('newfolder');?>
|
||||
</button>
|
||||
<button data-action='newfile' class="btn btn-default tool-path-newfile" type="button">
|
||||
<i class="font-icon icon-caret-down"></i>
|
||||
</button>
|
||||
<i class="font-icon icon-folder-close-alt"></i><?php echo LNG('newfolder');?>
|
||||
</button>
|
||||
<button data-action='newfile' class="btn btn-default tool-path-newfile" type="button">
|
||||
<i class="font-icon icon-caret-down"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="btn-group btn-group-sm fl-left mr-10">
|
||||
<div class="select-button-default btn-group btn-group-sm fl-left mr-10">
|
||||
<button data-action='upload' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-cloud-upload"></i><?php echo LNG('upload');?>
|
||||
</button>
|
||||
<button data-action='upload-more' class="btn btn-default tool-path-upload" type="button">
|
||||
<i class="font-icon icon-caret-down"></i>
|
||||
</button>
|
||||
<i class="font-icon icon-cloud-upload"></i><?php echo LNG('upload');?>
|
||||
</button>
|
||||
<button data-action='upload-more' class="btn btn-default tool-path-upload" type="button">
|
||||
<i class="font-icon icon-caret-down"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-default btn-sm toolbar-path-more fl-left mr-10">
|
||||
<i class="font-icon icon-ellipsis-horizontal"></i>
|
||||
<?php echo LNG('button_more');?> <span class="caret"></span>
|
||||
</button>
|
||||
<div class="select-button-show btn-group btn-group-sm fl-left ml-10 mr-10 hidden">
|
||||
<button data-action='share' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-share"></i><?php echo LNG('share');?>
|
||||
</button>
|
||||
<button data-action='download' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-download"></i><?php echo LNG('download');?>
|
||||
</button>
|
||||
<button data-action='remove' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-remove"></i><?php echo LNG('remove');?>
|
||||
</button>
|
||||
<button data-action='rname' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-rename"></i><?php echo LNG('rename');?>
|
||||
</button>
|
||||
|
||||
<button data-action='copy' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-copy"></i><?php echo LNG('copy');?>
|
||||
</button>
|
||||
<button data-action='cute' class="btn btn-default" type="button">
|
||||
<i class="font-icon icon-cute"></i><?php echo LNG('cute');?>
|
||||
</button>
|
||||
<button type="button" class="btn btn-default btn-sm toolbar-path-more fl-left mr-10">
|
||||
<i class="font-icon icon-ellipsis-horizontal"></i>
|
||||
<?php echo LNG('button_more');?> <span class="caret"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="group-space-use fl-left hidden"></div>
|
||||
<div class="admin-real-path hidden fl-left">
|
||||
<button type="button" class="btn btn-default btn-sm dialog-goto-path ml-10" title="<?php echo LNG('open_the_path');?>">
|
||||
<i class="font-icon icon-folder-open"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<span class='msg fl-left'><?php echo LNG('path_loading');?></span>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
@ -155,12 +187,12 @@
|
|||
</div>
|
||||
<div class="set-icon-size">
|
||||
<span class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="font-icon icon-zoom-in"></i>
|
||||
</span>
|
||||
<ul class="dropdown-menu set-icon-size-slider animated menuShow">
|
||||
<div class="slider-bg"></div>
|
||||
<div class="slider-handle"></div>
|
||||
</ul>
|
||||
<i class="font-icon icon-zoom-in"></i>
|
||||
</span>
|
||||
<ul class="dropdown-menu set-icon-size-slider animated menuShow">
|
||||
<div class="slider-bg"></div>
|
||||
<div class="slider-handle"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
|
|
|
@ -6,8 +6,20 @@
|
|||
<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="<?php echo STATIC_PATH;?>images/common/pic.jpg"> </span>
|
||||
<div><h3 class="name"><?php echo $_SESSION['kodUser']['name'];?></h3></div>
|
||||
<span class="my-avator">
|
||||
<?php
|
||||
$avatar = STATIC_PATH.'images/common/pic.jpg';
|
||||
$name = $_SESSION['kodUser']['name'];
|
||||
if($_SESSION['kodUser']['avatar']){
|
||||
$avatar = $_SESSION['kodUser']['avatar'];
|
||||
}
|
||||
if($_SESSION['kodUser']['nickName']){
|
||||
$name = $_SESSION['kodUser']['nickName'];
|
||||
}
|
||||
echo '<img src="'.$avatar.'"/>';
|
||||
?>
|
||||
</span>
|
||||
<div><h3 class="name"><?php echo $name;?></h3></div>
|
||||
</div>
|
||||
<ul class="left-menu-path"></ul>
|
||||
</div>
|
||||
|
@ -24,7 +36,10 @@
|
|||
foreach ($config['settingSystem']['menu'] as $key=>$value) {
|
||||
if ($value['use']!='1') continue;
|
||||
$has = ST==$value['name']?'this':'';
|
||||
$target = " target='".$value['target']."'" ;
|
||||
$target = " target='_self'" ;
|
||||
if($value['target']=='1' || $value['target'] == '_blank'){
|
||||
$target = " target='_blank'" ;
|
||||
}
|
||||
$name = $value['name'];
|
||||
if(LNG('ui_'.$name) != 'ui_'.$name){
|
||||
$name = "<i class='font-icon menu-".$value['name']."'></i><span>".LNG('ui_'.$name).'</span>';
|
||||
|
@ -68,6 +83,11 @@
|
|||
<i class="font-icon icon-copy"></i><?php echo LNG('copy');?>
|
||||
</span>
|
||||
</div>
|
||||
<div class="action-menu" data-action="action-cute">
|
||||
<span class="content">
|
||||
<i class="font-icon icon-cut"></i><?php echo LNG('cute');?>
|
||||
</span>
|
||||
</div>
|
||||
<div class='action-menu' data-action="action-rname">
|
||||
<span class="content">
|
||||
<i class="font-icon icon-pencil"></i><?php echo LNG('rename');?>
|
||||
|
@ -113,7 +133,7 @@
|
|||
<li data-action="search"><a href="javascript:void();">
|
||||
<i class="font-icon icon-search"></i><?php echo LNG('search');?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" >
|
||||
G.thisPath = "<?php echo clear_html($dir);?>";
|
||||
seajs.use("<?php echo STATIC_JS;?>/src/explorerWap/main");
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
|
||||
</head>
|
||||
<body class="setting-page" oncontextmenu="return core.contextmenu();">
|
||||
<div class="init-loading">
|
||||
<div><img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif"/></div>
|
||||
</div>
|
||||
<div id="body">
|
||||
<div class="menu-left">
|
||||
<h1><?php echo LNG('setting_title');?></h1>
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="edit-body">
|
||||
<div class="introduction">
|
||||
<div class="introduction hidden">
|
||||
<?php include(LANGUAGE_PATH.I18n::getType().'/edit.html');?>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<?php if(isset($_GET['user'])){?>
|
||||
<style>
|
||||
.frame-main .frame-left{top:0;}
|
||||
.frame-main{bottom: 32px;}
|
||||
.frame-main{bottom:0px;}
|
||||
</style>
|
||||
<?php } ?>
|
||||
|
||||
|
|
|
@ -7,13 +7,7 @@
|
|||
<div class="frame-header">
|
||||
<div class="title"><?php echo $shareInfo['name'];?></div>
|
||||
<div class="menu-group">
|
||||
<div class="tool tool-menu-right-btn"><i class="font-icon icon-ellipsis-vertical"></i></div>
|
||||
<ul class="dropdown-menu tool-menu-right pull-right animated menuShow" role="menu">
|
||||
<li data-action="upload" class="hidden"><a href="javascript:void();">
|
||||
<i class="font-icon icon-cloud-upload"></i><?php echo LNG('upload');?></a></li>
|
||||
<li data-action="search"><a href="javascript:void();">
|
||||
<i class="font-icon icon-search"></i><?php echo LNG('search');?></a></li>
|
||||
</ul>
|
||||
<div class="btn-list-icon"><i class="font-icon icon-home"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -34,6 +28,21 @@
|
|||
</div>
|
||||
<?php include(TEMPLATE.'common/footer.html');?>
|
||||
</div><!-- / frame-main end-->
|
||||
<div class="toolbar-menu">
|
||||
<button class="menu-plus tool tool-menu-right-btn" data-toggle="dropdown"></button>
|
||||
<ul class="dropdown-menu tool-menu-right pull-right animated menuShow" role="menu" >
|
||||
<li data-action="upload"><a href="javascript:void();">
|
||||
<i class="font-icon icon-cloud-upload"></i><?php echo LNG('upload');?></a></li>
|
||||
<li data-action="newfolder"><a href="javascript:void();">
|
||||
<i class="font-icon icon-folder-close-alt"></i><?php echo LNG('newfolder');?></a></li>
|
||||
<li data-action="newfile"><a href="javascript:void();">
|
||||
<i class="font-icon icon-file-text"></i><?php echo LNG('newfile');?></a></li>
|
||||
<li data-action="past"><a href="javascript:void();">
|
||||
<i class="font-icon icon-paste"></i><?php echo LNG('past');?></a></li>
|
||||
<li data-action="search"><a href="javascript:void();">
|
||||
<i class="font-icon icon-search"></i><?php echo LNG('search');?></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
G.thisPath = "<?php echo clear_html($dir);?>";
|
||||
G.user = "<?php echo clear_html($_GET['user']);?>";
|
||||
|
|
|
@ -4,12 +4,7 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
$arr = array(8);
|
||||
$get = $arr[mt_rand(0,count($arr)-1)];
|
||||
$image = STATIC_PATH."images/wall_page/".$get.".jpg";
|
||||
echo '<style type="text/css">.aero:before,.aero:after,.background{background-image:url('.$image.')}</style>';
|
||||
?>
|
||||
<?php echo pageBackground();?>
|
||||
<div class="background"></div>
|
||||
<div class="loginbox box-install aero" >
|
||||
<div class="title">
|
||||
|
@ -32,7 +27,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form" style="padding: 10px 20px;">
|
||||
<div class="form" style="padding: 10px 20px 40px 20px;">
|
||||
<h3><?php echo LNG('php_env_check');?></h3>
|
||||
<?php
|
||||
$error = php_env_check();
|
||||
|
|
|
@ -3,27 +3,22 @@
|
|||
<link href="<?php echo STATIC_PATH;?>style/login.css?ver=<?php echo KOD_VERSION;?>" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
$arr = array(8);
|
||||
$get = $arr[mt_rand(0,count($arr)-1)];
|
||||
$image = STATIC_PATH."images/wall_page/".$get.".jpg";
|
||||
echo '<style type="text/css">.aero:before,.aero:after,.background{background-image:url('.$image.')}</style>';
|
||||
?>
|
||||
<body class="license-page">
|
||||
<?php echo pageBackground();?>
|
||||
<div class="background"></div>
|
||||
<div class="loginbox aero" >
|
||||
<div class="title">
|
||||
<div class="logo">License Register</div>
|
||||
<div class='info'>or contact kodcloud@qq.com</div>
|
||||
<div class="logo">升级为商业版</div>
|
||||
<div class='info'><?php echo LNG('copyright_contact');?></div>
|
||||
</div>
|
||||
<div class="form" style="padding: 10px 20px;">
|
||||
<div class="inputs admin-password"><input type="text" placeholder="LICENSE KEY" autocomplete="off"/></div>
|
||||
|
||||
<a href="javascript:void(0);" class="LICENSE_SUBMIT btn btn-primary">Register</a>
|
||||
<a href="javascript:void(0);" class="LICENSE_SUBMIT btn btn-primary">注册授权</a>
|
||||
<div class="links">
|
||||
<a href="./index.php?user/versionInstall&reset=1" class="btn btn-link"><?php echo LNG('use_free');?></a>
|
||||
<a href="http://kodcloud.com/buy.html#<?php echo I18n::getType();?>" target="_blank" class="btn btn-link"><?php echo LNG('learn_more');?></a>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
<?php $GLOBALS['loadCommonJs'] = true;?>
|
||||
|
|
|
@ -5,34 +5,31 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
$arr = array(2,3,6,8,9,11,12);
|
||||
$get = $arr[mt_rand(0,count($arr)-1)];
|
||||
$image = STATIC_PATH."images/wall_page/".$get.".jpg";
|
||||
echo '<style type="text/css">.aero:before,.aero:after,.background{background-image:url('.$image.')}</style>';
|
||||
?>
|
||||
<?php echo pageBackground();?>
|
||||
<div class="background"></div>
|
||||
<div class="init-loading"><div><img src="<?php echo STATIC_PATH;?>images/common/loading_simple.gif"/></div></div>
|
||||
<div class="loginbox animated-500 fadeInDown aero" >
|
||||
<div class="title">
|
||||
<div class="logo"><i class="icon-cloud"></i><?php echo strip_tags(LNG('kod_name'));?></div>
|
||||
<div class='info'>——<?php echo LNG('kod_name_desc');?></div>
|
||||
<?php if(count($config['settingAll']['language']) > 1){ ?>
|
||||
<div class="menu-group">
|
||||
<a id='footer-language' data-toggle="dropdown" href="javascript:void(0);" class="topbar-menu">
|
||||
<i class='font-icon icon-flag'></i>Language<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu footer-language pull-left animated menuShow" role="menu" aria-labelledby="footer-language">
|
||||
<?php
|
||||
$tpl = "";
|
||||
foreach ($config['settingAll']['language'] as $key => $value) {
|
||||
$name = $value[0];
|
||||
$select = I18n::getType() == $key ? "this":"";
|
||||
$tpl .= "<li><a href='javascript:core.language(\"{$key}\");' title=\"{$key}/{$value[1]}/{$value[2]}\" class='{$select}'><i class='lang-flag flag-{$key}'></i>{$name}</a></li>";
|
||||
}
|
||||
echo $tpl;
|
||||
?>
|
||||
<?php
|
||||
$tpl = "";
|
||||
foreach ($config['settingAll']['language'] as $key => $value) {
|
||||
$name = $value[0];
|
||||
$select = I18n::getType() == $key ? "this":"";
|
||||
$tpl .= "<li><a href='javascript:core.language(\"{$key}\");' title=\"{$key}/{$value[1]}/{$value[2]}\" class='{$select}'><i class='lang-flag flag-{$key}'></i>{$name}</a></li>";
|
||||
}
|
||||
echo $tpl;
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="form">
|
||||
<form action="#">
|
||||
|
|
|
@ -5,12 +5,7 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
$arr = array(2,3,6,8,9,11,12);
|
||||
$get = $arr[mt_rand(0,count($arr)-1)];
|
||||
$image = STATIC_PATH."images/wall_page/".$get.".jpg";
|
||||
echo '<style type="text/css">.aero:before,.aero:after,.background{background-image:url('.$image.')}</style>';
|
||||
?>
|
||||
<?php echo pageBackground();?>
|
||||
<div class="background"></div>
|
||||
<div class="loginbox login-wap aero" >
|
||||
<div class="title">
|
||||
|
|
|
@ -43,8 +43,8 @@ define('DEFAULT_PERRMISSIONS',0755); //新建文件、解压文件默认权限
|
|||
* 可以数据目录;移到web目录之外,可以使程序更安全, 就不用限制用户的扩展名权限了;
|
||||
* 1. 需要先将data文件夹移到别的地方 例如将data文件夹拷贝到D:/
|
||||
* 2. 在config文件夹下新建define.php 新增一行 <?php define('DATA_PATH','D:/data/');
|
||||
* 注意:路径不能写错;其次php需要有权限访问移动后的目录(设置了防跨站需要关闭)
|
||||
*/
|
||||
|
||||
if(file_exists(BASIC_PATH.'config/define.php')){
|
||||
include(BASIC_PATH.'config/define.php');
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ include(FUNCTION_DIR.'common.function.php');
|
|||
include(FUNCTION_DIR.'web.function.php');
|
||||
include(FUNCTION_DIR.'file.function.php');
|
||||
include(FUNCTION_DIR.'helper.function.php');
|
||||
include(CLASS_DIR.'I18n.class.php');
|
||||
|
||||
$config['appStartTime'] = mtime();
|
||||
$config['appCharset'] = 'utf-8';//该程序整体统一编码
|
||||
|
@ -83,20 +84,24 @@ if (strtoupper(substr(PHP_OS, 0,3)) === 'WIN') {
|
|||
$config['systemCharset']='utf-8';
|
||||
}
|
||||
|
||||
// 部分反向代理导致获取不到url的问题优化
|
||||
// 部分反向代理导致获取不到url的问题优化;忽略同域名http和https的情况
|
||||
if(isset($_COOKIE['APP_HOST'])){
|
||||
define('HOST',$_COOKIE['HOST']);
|
||||
define('APP_HOST',$_COOKIE['APP_HOST']);
|
||||
if(get_url_domain($_COOKIE['HOST']) != get_url_domain($_COOKIE['APP_HOST'])){
|
||||
define('HOST',$_COOKIE['HOST']);
|
||||
define('APP_HOST',$_COOKIE['APP_HOST']);
|
||||
}
|
||||
}
|
||||
if(!defined('HOST')){ define('HOST',get_host().'/');}
|
||||
if(!defined('HOST')){ define('HOST',rtrim(get_host(),'/').'/');}
|
||||
if(!defined('WEB_ROOT')){ define('WEB_ROOT',get_webroot(BASIC_PATH));}
|
||||
if(!defined('APP_HOST')){ define('APP_HOST',HOST.str_replace(WEB_ROOT,'',BASIC_PATH));} //程序根目录
|
||||
define('PLUGIN_HOST',APP_HOST.str_replace(BASIC_PATH,'',PLUGIN_DIR));//插件目录
|
||||
|
||||
include(CONTROLLER_DIR.'util.php');
|
||||
include(BASIC_PATH.'config/setting.php');
|
||||
include(BASIC_PATH.'config/version.php');
|
||||
|
||||
include(BASIC_PATH.'config/setting.php');
|
||||
if(file_exists(CONTROLLER_DIR.'debug.class.php')){
|
||||
include_once(CONTROLLER_DIR.'debug.class.php');
|
||||
}
|
||||
|
||||
init_common();
|
||||
$config['autorun'] = array(
|
||||
|
|
|
@ -14,7 +14,7 @@ return array(
|
|||
"setting_user_animate_desc" => "نافذة مفتوحة والرسوم المتحركة الأخرى",
|
||||
"setting_user_sound_desc" => "تشغيل الصوت",
|
||||
"setting_user_imageThumb" => "الصور المصغرة",
|
||||
"setting_user_imageThumb_desc" => "الموجهات وغيرها من المعدات منخفضة الأداء، يمكنك النظر في الإغلاق",
|
||||
"setting_user_imageThumb_desc" => "تجربة تصفح أفضل بعد الفتح",
|
||||
"setting_user_fileSelect" => "فتح الاختيار رمز الملف",
|
||||
"setting_user_fileSelect_desc" => "رمز الملف الاختيار مفتاح اليسار، انقر بزر الماوس الأيمن فوق القائمة اختصار الإدخال",
|
||||
"qrcode" => "URL رمز الاستجابة السريعة",
|
||||
|
@ -64,7 +64,7 @@ return array(
|
|||
"space_tips_full" => "دون الحد",
|
||||
"space_size" => "الفضاء",
|
||||
"space_size_use" => "استخدام الفضاء",
|
||||
"space_is_full" => "الفضاء هو كامل، يرجى الاتصال بمسؤول!",
|
||||
"space_is_full" => "لا توجد مساحة كافية متبقية ، يرجى الاتصال بالمسؤول!",
|
||||
"system_open_true_path" => "افتتح بنجاح في إدارة ملف!",
|
||||
"group_role_error" => "خطأ أذونات دور (أي إعدادات إذن)",
|
||||
"group_role_error_admin" => "أذونات غير كافية",
|
||||
|
@ -80,6 +80,7 @@ return array(
|
|||
"system_group_remove_tips" => "هل تريد بالتأكيد حذف القسم؟<br/>بعد حذف جزء من المستخدم سيتم إزالة، انتقل القطاع الفرعي إلى قطاع الجذر",
|
||||
"system_group_select" => "اختر قسم",
|
||||
"system_group_select_result" => "سوف الأعضاء تنتمي إلى القطاعات التالية",
|
||||
"system_role_admin_tips" => "ملاحظات: غير مصرح لمسؤولي النظام للتحكم",
|
||||
"system_member_action" => "إدارة المستخدم",
|
||||
"system_member_add" => "العضو الجديد",
|
||||
"system_member_role" => "أدوار إذن",
|
||||
|
@ -97,9 +98,12 @@ return array(
|
|||
"system_member_import_desc" => "مستخدم واحد في كل سطر،<br/>بالفعل موجودة يتم تجاهل بصمت",
|
||||
"system_member_use" => "تمكين",
|
||||
"system_member_unuse" => "تعطيل",
|
||||
"system_member_space" => "تعيين حجم مساحة المستخدم ",
|
||||
"system_member_space_tips" => " تعيين حجم مساحة المستخدم ",
|
||||
"system_member_space_number" => " يجب ان يكون رقم!",
|
||||
"system_member_group_config" => "دفعة إدارة الإعداد",
|
||||
"system_member_group_remove" => "تمت إزالتها من القسم",
|
||||
"system_member_group_insert" => "تمت الإضافة إلى القسم",
|
||||
"system_member_group_insert" => "أضف إلى القسم",
|
||||
"system_member_group_reset" => "إعادة تعيين القسم",
|
||||
"system_member_group_error" => "خطأ في الإدارة",
|
||||
"system_group_action" => "إدارة القسم",
|
||||
|
@ -109,7 +113,7 @@ return array(
|
|||
"system_setting_root_path" => "وصول الجذر",
|
||||
"system_setting_root_path_desc" => "مسؤول النظام فقط يمكن الوصول إلى كافة الدلائل، يمكن للجماعات حقوقية أخرى من المستخدمين ترى سوى دليل المستخدم الخاص بهم. إذا كنت ترغب في تشغيل أو إيقاف وصول المسؤول<br/>إلى الدلائل الأخرى، يمكنك تعديل فب open_basedir المعلمات مكافحة المواقع المشتركة،<a href=\"https://www.google.com.hk/search?&q=php+open_basedir\" target=\"_ |