diff --git a/README.md b/README.md index 105e8a1..eb1df3f 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ > TaoLer是一个简单迅捷的轻论坛系统,适用于个人或组织区域型信息交流发布平台。 - * 官网:https://www.aieok.com + * 官网:https://www.aieok.com:8443 * 前台:http://bbs.aieok.com:888 * 后台:http://adm.aieok.com:888 * 账号:test * 密码:test123 - * 版本:TaoLer 1.8.8 - * 日期:2021.10.12 + * 版本:TaoLer 1.8.10 + * 日期:2021.11.2 #### 项目地址 @@ -97,6 +97,15 @@ #### 前后台独立域名的绑定 1. 手动修改`config/app.php`文件内的`'domain_bind'`对应的应用。 + ```html + // 域名绑定(自动多应用模式有效) + 'domain_bind' => [ + 'bbs' => 'index', //bbs.xxx.com 访问的是Index应用 + 'adm' => 'admin', //adm.xxx.com 访问的是Admin应用 + 'api' => 'api' //api.xxx.com 访问的是Admin应用 + 'www.test.com' => 'test' //www.test.com 访问的是Test应用 + ], + ``` 2. 后面会针对动态的设置绑定域名功能开发...此处待完成 diff --git a/app/404.html b/app/404.html new file mode 100644 index 0000000..046541c --- /dev/null +++ b/app/404.html @@ -0,0 +1,57 @@ + + + + + 404 - TaoLer社区 + + + + + + + + + +
+
+
+

+

页面或者数据被 纸飞机app 运到火星了,啥都看不到了…请返回首页

+
+
+
+ + + + + + + + + + + + + + + + + + + + + diff --git a/app/admin/controller/Addons.php b/app/admin/controller/Addons.php index fa3b546..75d2a0c 100644 --- a/app/admin/controller/Addons.php +++ b/app/admin/controller/Addons.php @@ -9,133 +9,131 @@ use think\facade\Config; use app\admin\model\Addons as AddonsModel; use taoler\com\Files; use taoler\com\Api; +use app\common\lib\SetConf; +use think\App; +use app\common\lib\ZipFile; class Addons extends AdminController { /** - * 显示资源列表 - * - * @return \think\Response + * @return string */ public function index() { - $type = input('type'); - //$filter = input('filter') ? input('filter') : 'public-list'; - //动态field - switch($type){ - //已安装 - case 'installed': - $col = [ - ['type' => 'numbers', 'fixed'=> 'left'], - ['field' => 'name','title'=> '插件', 'width'=> 150], - ['field'=> 'title','title'=> '标题', 'width'=> 100], - ['field'=> 'version','title'=> '版本', 'width'=> 100], - ['field' => 'author','title'=> '作者', 'width'=> 100], - ['field' => 'description','title'=> '简介', 'minWidth'=> 200], - ['field' => 'status','title'=> '状态', 'width'=> 100], - ['field' => 'install','title'=> '安装', 'width'=> 100], - ['field' => 'ctime','title'=> '到期时间', 'width'=> 150], - ['title' => '操作', 'width'=> 220, 'align'=>'center', 'toolbar'=> '#addons-installed-tool'] - ]; - break; - //在线 - case 'onlineAddons': - $col = [ - ['type' => 'numbers', 'fixed'=> 'left'], - ['field' => 'name','title'=> '插件', 'width'=> 150], - ['field'=> 'title','title'=> '标题', 'width'=> 100], - ['field'=> 'version','title'=> '版本', 'width'=> 100], - ['field' => 'author','title'=> '作者', 'width'=> 100], - ['field' => 'description','title'=> '简介', 'minWidth'=> 200], - ['field' => 'price','title'=> '价格(元)'], - ['field' => 'status','title'=> '状态', 'width'=> 100], - ['field' => 'install','title'=> '安装', 'width'=> 100], - ['field' => 'ctime','title'=> '时间', 'width'=> 150], - ['title' => '操作', 'width'=> 150, 'align'=>'center', 'toolbar'=> '#addons-tool'] - ]; - break; - default: - $col = [ - ['type' => 'numbers', 'fixed'=> 'left'], - ['field' => 'name','title'=> '插件', 'width'=> 150], - ['field'=> 'title','title'=> '标题', 'width'=> 100], - ['field'=> 'version','title'=> '版本', 'width'=> 100], - ['field' => 'author','title'=> '作者', 'width'=> 100], - ['field' => 'description','title'=> '简介', 'minWidth'=> 200], - ['field' => 'status','title'=> '状态', 'width'=> 100], - ['field' => 'install','title'=> '安装', 'width'=> 100], - ['field' => 'ctime','title'=> '到期时间', 'width'=> 150], - ['title' => '操作', 'width'=> 220, 'align'=>'center', 'toolbar'=> '#addons-installed-tool'] - ]; - } - - View::assign('col',$col); + //$conf = new \addons\social\model\Conf; + //$arr = $conf->getConf(); + //dump($arr); +//dump($arr[0]['value']['app_key']); return View::fetch(); } public function addonsList() { - $type = input('type') ? input('type') : 'installed'; + $type = input('type'); $res = []; - - switch($type){ - - //已安装 - case 'installed': - $addons = Files::getDirName('../addons/'); - if($addons){ - $res = ['code'=>0,'msg'=>'','count'=>5]; - foreach($addons as $v){ - $info_file = '../addons/'.$v.'/info.ini'; - $info = parse_ini_file($info_file); - $res['data'][] = $info; - } - } - - break; - //在线 - case 'onlineAddons': - $url = $this->getSystem()['api_url'].'/v1/addons'; - $addons = Api::urlPost($url,[]); - if( $addons->code !== -1){ - $res['code'] = 0; - $res['msg'] = ''; - $res['data'] = $addons->data; - } - - break; - //已安装 - default: - $addons = Files::getDirName('../addons/'); - if($addons){ - $res = ['code'=>0,'msg'=>'','count'=>5]; - foreach($addons as $v){ - $info_file = '../addons/'.$v.'/info.ini'; - $info = parse_ini_file($info_file); - $res['data'][] = $info; - } - } - break; - } - return json($res); - - + switch($type){ + //已安装 + case 'installed': + $addons = Files::getDirName('../addons/'); + if($addons){ + $res = ['code'=>0,'msg'=>'','count'=>5]; + foreach($addons as $v){ + $info_file = '../addons/'.$v.'/info.ini'; + $info = parse_ini_file($info_file); + $res['data'][] = $info; + } + $res['col'] = [ + ['type' => 'numbers'], + ['field' => 'name','title'=> '插件', 'width'=> 150], + ['field'=> 'title','title'=> '标题', 'width'=> 100], + ['field'=> 'version','title'=> '版本', 'width'=> 100], + ['field' => 'author','title'=> '作者', 'width'=> 100], + ['field' => 'description','title'=> '简介', 'minWidth'=> 200], + ['field' => 'status','title'=> '状态', 'width'=> 100], + ['field' => 'install','title'=> '安装', 'width'=> 100], + ['field' => 'ctime','title'=> '到期时间', 'width'=> 150], + ['title' => '操作', 'width'=> 220, 'align'=>'center', 'toolbar'=> '#addons-installed-tool'] + ]; + } else { + $res = ['code'=>-1,'msg'=>'没有安装任何插件']; + } + break; + //在线 + case 'onlineAddons': + $url = $this->getSystem()['api_url'].'/v1/addons'; + $addons = Api::urlPost($url,[]); + if( $addons->code !== -1){ + $res['code'] = 0; + $res['msg'] = ''; + $res['data'] = $addons->data; + $res['col'] = [ + ['type' => 'numbers'], + ['field' => 'name','title'=> '插件', 'width'=> 150], + ['field'=> 'title','title'=> '标题', 'width'=> 100], + ['field'=> 'version','title'=> '版本', 'width'=> 100], + ['field' => 'author','title'=> '作者', 'width'=> 100], + ['field' => 'description','title'=> '简介', 'minWidth'=> 200], + ['field' => 'price','title'=> '价格(元)'], + ['field' => 'status','title'=> '状态', 'width'=> 100], + ['field' => 'install','title'=> '安装', 'width'=> 100], + ['field' => 'ctime','title'=> '时间', 'width'=> 150], + ['title' => '操作', 'width'=> 150, 'align'=>'center', 'toolbar'=> '#addons-tool'] + ]; + } else { + $res = ['code'=>-1,'msg'=>'']; + } + break; + } + return json($res); } - /** * 显示创建资源表单页. * * @return \think\Response */ - public function install() + public function add() { - // + //添加版本 + if(Request::isAjax()){ + $data = Request::param(); + $result = AddonsModel::create($data); + if($result){ + $res = ['code'=>0,'msg'=>'添加成功']; + }else{ + $res = ['code'=>-1,'msg'=>'添加失败']; + } + return json($res); + } + + return View::fetch(); } + /** + * 编辑版本 + * + * @param int $id + * @return \think\Response + */ + public function edit($id) + { + $addons = AddonsModel::find($id); + if(Request::isAjax()){ + $data = Request::only(['id','addons_name','addons_version','addons_auther','addons_resume','addons_price','addons_src']); + $result = $addons->where('id',$id)->save($data); + if($result){ + $res = ['code'=>0,'msg'=>'编辑成功']; + }else{ + $res = ['code'=>-1,'msg'=>'编辑失败']; + } + return json($res); + } + View::assign('addons',$addons); + return View::fetch(); + } /** * 上传版本的zip资源 @@ -146,23 +144,193 @@ class Addons extends AdminController */ public function uploadZip() { - // + $id = Request::param(); + $file = request()->file('file'); + try { + validate(['file'=>'filesize:2048|fileExt:zip,rar,7z']) + ->check(array($file)); + $savename = \think\facade\Filesystem::disk('public')->putFile('addons',$file); + } catch (think\exception\ValidateException $e) { + echo $e->getMessage(); + } + $upload = Config::get('filesystem.disks.public.url'); + + if($savename){ + $name_path =str_replace('\\',"/",$upload.'/'.$savename); + $res = ['code'=>0,'msg'=>'插件上传成功','src'=>$name_path]; + } else { + $res = ['code'=>-1,'msg'=>'上传错误']; + } + return json($res); } - /** - * 删除指定资源 - * - * @param int $id - * @return \think\Response - */ - public function delete($id) + //安装插件 + public function install() { - $version = AddonsModel::find($id); - $res = $version->delete(); + $data = Request::param(); + $url = $this->getSystem()['api_url'].'/v1/getaddons'; + $addons = Api::urlPost($url,['name'=>$data['name'],'version'=>$data['version']]); + if( $addons->code == -1) { + return json(['code'=>$addons->code,'msg'=>$addons->msg]); + } + //是否安装? + $addInstalledVersion = get_addons_info($data['name']); + if(!empty($addInstalledVersion)){ + $verRes = version_compare($data['version'],$addInstalledVersion['version'],'>'); + if(!$verRes){ + return json(['code'=>-1,'msg'=>'不能降级,请选择正确版本']); + } + } + + $file_url = $addons->addons_src; + //判断远程文件是否可用存在 + $header = get_headers($file_url, true); + if(!isset($header[0]) && (strpos($header[0], '200') || strpos($header[0], '304'))){ + return json(['code'=>-1,'msg'=>'获取远程文件失败']); + } + + //把远程文件放入本地 + + //拼接路径 + $addons_dir = Files::getDirPath('../runtime/addons/'); + Files::mkdirs($addons_dir); + + $package_file = $addons_dir . $data['name'] .'.zip'; //升级的压缩包文件 +// halt($package_file); + $cpfile = copy($file_url,$package_file); + if(!$cpfile) + { + return json(['code'=>-1,'msg'=>'下载升级文件失败']); + } + + $uzip = new ZipFile(); + $zipDir = strstr($package_file, '.zip',true); //返回文件名后缀前的字符串 + $zipPath = Files::getDirPath($zipDir); //转换为带/的路径 压缩文件解压到的路径 + $unzip_res = $uzip->unzip($package_file,$zipPath,true); + + if(!$unzip_res) + { + return json(['code'=>-1,'msg'=>'解压失败']); + } + + //升级插件 + if(is_dir($zipPath)) + { + //升级前的写入文件权限检查 + $allUpdateFiles = Files::getAllFile($zipPath); + + if (empty($allUpdateFiles)) return json(['code' => -1, 'msg' => '无可更新文件。']); + $checkString = ''; + foreach ($allUpdateFiles as $updateFile) { + $coverFile = ltrim(str_replace($zipPath, '', $updateFile), DIRECTORY_SEPARATOR); + $dirPath = dirname('../'.$coverFile); + if (file_exists('../'.$coverFile)) { + if (!is_writable('../'.$coverFile)) $checkString .= $coverFile . ' [' . '无写入权限' . ']
'; + } else { + if (!is_dir($dirPath)) @mkdir($dirPath, 0777, true); + if (!is_writable($dirPath)) $checkString .= $dirPath . ' [' . '无写入权限' . ']
'; + } + } + + if (!empty($checkString)) return json(['code' => -1, 'msg' => $checkString]); + $addonsPath = '../'; + $cpRes = Files::copyDirs($zipPath,$addonsPath); + $cpData = $cpRes->getData(); + //更新失败 + if($cpData['code'] == -1) + { + return json(['code'=>-1,'msg'=>$cpData['msg']]); + } + + //清除 + Files::delDirAndFile('../runtime/addons/'); + + } + return json(['code'=>0,'msg'=>'插件安装成功!']); + + } + /** + * 卸载插件 + */ + public function delete() + { + $name = input('name'); + $addonsPath = '../addons/'.$name; + $staticPath = 'addons/'.$name; + + if (is_dir($staticPath)) { + Files::delDir($staticPath); + } + $res = Files::delDir($addonsPath); if($res){ - return json(['code'=>0,'msg'=>'删除成功']); + return json(['code'=>0,'msg'=>'卸载成功']); } else { - return json(['code'=>-1,'msg'=>'删除失败']); + return json(['code'=>-1,'msg'=>'卸载失败']); } } + + //启用插件 + public function start() + { + $name = input('name'); + $arr = ['status' => 1]; + //$res = get_addons_info($name); + //$res = get_addons_instance($name); + $res = set_addons_info($name,$arr); + return json(['code'=>0,'msg'=>$name.'插件已启用']); + + } + + //暂停插件 + public function shutDown() + { + $name = input('name'); + $arr = ['status' => 0]; + $res = set_addons_info($name,$arr); + var_dump($res); + return json(['code'=>-1,'msg'=>$name.'插件已禁用']); + + } + + //配置插件 + public function config($name) + { + $name = input('name'); + //var_dump($name); + $config = get_addons_config($name); + if(empty($config)) return json(['code'=>-1,'msg'=>'无配置项!']); + if(Request::isAjax()){ + $params = Request::param('params/a'); + if ($params) { + foreach ($config as $k => &$v) { + if (isset($params[$k])) { + if ($v['type'] == 'array') { + $arr = []; + $params[$k] = is_array($params[$k]) ? $params[$k] :[]; + foreach ($params[$k]['key'] as $kk=>$vv){ + $arr[$vv] = $params[$k]['value'][$kk]; + } + $params[$k] = $arr; + $value = $params[$k]; + $v['content'] = $value; + $v['value'] = $value; + } else { + $value = $params[$k]; + } + $v['value'] = $value; + } + } + unset($v); + set_addons_config($name,$config); + + } + return json(['code'=>0,'msg'=>'配置成功!']); + } + + //模板引擎初始化 + $view = ['formData'=>$config,'title'=>'title']; + View::assign($view); + return View::fetch(); + + } } diff --git a/app/admin/model/Admin.php b/app/admin/model/Admin.php index f3fac4d..c7ed036 100644 --- a/app/admin/model/Admin.php +++ b/app/admin/model/Admin.php @@ -78,6 +78,8 @@ class Admin extends Model //用户名密码正确返回1 return 1; - } + } else { + return "用户名或密码错误!"; + } } } diff --git a/app/admin/view/addons/add.html b/app/admin/view/addons/add.html new file mode 100644 index 0000000..16b4fef --- /dev/null +++ b/app/admin/view/addons/add.html @@ -0,0 +1,93 @@ +{extend name="public/base" /} + +{block name="body"} + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ +{/block} +{block name="js"} + +{/block} \ No newline at end of file diff --git a/app/admin/view/addons/config.html b/app/admin/view/addons/config.html new file mode 100644 index 0000000..1631b6c --- /dev/null +++ b/app/admin/view/addons/config.html @@ -0,0 +1,51 @@ +{extend name="public/base" /} +{block name="body"} + +
+ {foreach name="formData" item="vo" key="k"} + {php}$name = "params[".$k."]";{/php} + {switch name="$vo.type"} + {case value="text"} + {:form_input($name,'text',['label'=>$vo.title,'tip'=>$vo.tip],$vo.value)} + {/case} + {case value="textarea"} + {:form_textarea($name,['label'=>$vo.title,'tip'=>$vo.tip],$vo.value)} + {/case} + {case value="password"} + {:form_input($name,'password',['label'=>$vo.title,'tip'=>$vo.tip],$vo.value)} + {/case} + {case value="radio"} + {:form_radio($name,$vo.content,['label'=>$vo.title,'tip'=>$vo.tip],$vo.value)} + {/case} + {case value="select"} + {:form_select($name,$vo.content,['label'=>$vo.title,'verify'=>$vo.rule,'tip'=>$vo.tip,'search'=>1] ,[],$vo.value)} + {/case} + {case value="image"} + {:form_upload($name,$vo.value,['label'=>$vo.title,'tip'=>$vo.tip,'verify'=>$vo.rule,'type'=>'radio','num'=>'1','mime'=>'image'])} + {/case} + {case value="images"} + {:form_upload($name,$vo.value,['label'=>$vo.title,'tip'=>$vo.tip,'verify'=>$vo.rule,'type'=>'checkbox','num'=>$vo.num,'mime'=>'image'])} + {/case} + {case value="file"} + {:form_upload($name,$vo.value,['label'=>$vo.title,'tip'=>$vo.tip,'verify'=>$vo.rule,'type'=>'radio','num'=>$vo.num,'mime'=>'*'])} + {/case} + {case value="files"} + {:form_upload($name,$vo.value,['label'=>$vo.title,'tip'=>$vo.tip,'verify'=>$vo.rule,'type'=>'checkbox','num'=>$vo.num,'mime'=>'*'])} + {/case} + {case value="editor"} + {:form_editor($name,$name,2,['label'=>$vo.title,'tip'=>$vo.tip,'verify'=>$vo.rule])} + {/case} + {case value="array"} + {:form_arrays($name,['label'=>$vo.title,'tip'=>$vo.tip,'verify'=>$vo.rule],$vo.value?$vo.value:$vo.content)} + {/case} + {/switch} + {/foreach} + +
+ + +
+
+{/block} +{block name="js"} +{/block} \ No newline at end of file diff --git a/app/admin/view/addons/edit.html b/app/admin/view/addons/edit.html new file mode 100644 index 0000000..966e500 --- /dev/null +++ b/app/admin/view/addons/edit.html @@ -0,0 +1,93 @@ +{extend name="public/base" /} + +{block name="body"} + +
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+ +
+
+ +{/block} +{block name="js"} + +{/block} \ No newline at end of file diff --git a/app/admin/view/addons/index.html b/app/admin/view/addons/index.html index be0ccd4..6a86321 100644 --- a/app/admin/view/addons/index.html +++ b/app/admin/view/addons/index.html @@ -2,8 +2,9 @@ {block name="body"}
- -
+
+
+
插件分类 @@ -13,50 +14,55 @@ -
-
-
- +
+
+ + + - +
+
{/block} {block name="js"} + {/block} \ No newline at end of file diff --git a/app/admin/view/set/system/server.html b/app/admin/view/set/system/server.html index 553906f..b0a8c2c 100644 --- a/app/admin/view/set/system/server.html +++ b/app/admin/view/set/system/server.html @@ -9,14 +9,15 @@
    -
  • 积分设置
  • -
  • 用户等级
  • + {if hook('signstatushook') == 1} +
  • 签到规则
  • + {/if} +
  • 用户等级
-
+ {:hook('signadminhook')} + +
-
- +
@@ -85,18 +84,18 @@
+
-
@@ -132,7 +131,7 @@ var field = data.field; $.ajax({ type:"post", - url:"{:url('admin/Sign/add')}", + url: signAddAddons, data:field, daType:"json", success:function (data){ @@ -154,7 +153,7 @@ } }); return false; - }); + }); //添加VIP规则 form.on('submit(vip-rule-submit)',function(data){ diff --git a/app/install/data/taoler.sql b/app/install/data/taoler.sql index b8384ef..bbf5b8b 100644 --- a/app/install/data/taoler.sql +++ b/app/install/data/taoler.sql @@ -164,7 +164,7 @@ CREATE TABLE `tao_auth_rule` ( `pid` smallint(5) NOT NULL DEFAULT '0' COMMENT '父级ID', `level` tinyint(1) NOT NULL DEFAULT '1' COMMENT '菜单层级', `icon` varchar(50) NOT NULL DEFAULT '' COMMENT '图标', - `ishidden` enum('1','0') NOT NULL DEFAULT '1' COMMENT '0隐藏,1显示', + `ishidden` enum('1','0','-1') NOT NULL DEFAULT '1' COMMENT '0隐藏,1显示-1其它', `sort` tinyint(4) NOT NULL DEFAULT '50' COMMENT '排序', `condition` char(100) NOT NULL DEFAULT '', `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', @@ -177,11 +177,11 @@ CREATE TABLE `tao_auth_rule` ( -- ---------------------------- -- Records of tao_auth_rule -- ---------------------------- -INSERT INTO `tao_auth_rule` VALUES ('1', 'admin', '管理', '', '1', '1', '0', '0', 'layui-icon-user', '1', '3', '', '0', '0', '0'); -INSERT INTO `tao_auth_rule` VALUES ('2', 'set', '设置', '', '1', '1', '0', '0', 'layui-icon-set', '1', '4', '', '0', '0', '0'); -INSERT INTO `tao_auth_rule` VALUES ('3', 'administrator', '账户', '', '1', '1', '0', '0', 'layui-icon-username', '1', '5', '', '0', '1578980034', '0'); -INSERT INTO `tao_auth_rule` VALUES ('4', 'app', '应用', '', '1', '1', '0', '0', 'layui-icon-app', '1', '2', '', '0', '0', '0'); -INSERT INTO `tao_auth_rule` VALUES ('5', 'article', '内容', '', '1', '1', '0', '0', 'layui-icon-read', '1', '0', '', '0', '1578902321', '0'); +INSERT INTO `tao_auth_rule` VALUES ('1', 'admin', '管理', '', '1', '1', '0', '0', 'layui-icon-user', '1', '5', '', '0', '1635757559', '0'); +INSERT INTO `tao_auth_rule` VALUES ('2', 'set', '设置', '', '1', '1', '0', '0', 'layui-icon-set', '1', '6', '', '0', '1635757571', '0'); +INSERT INTO `tao_auth_rule` VALUES ('3', 'administrator', '账户', '', '1', '1', '0', '0', 'layui-icon-username', '1', '7', '', '0', '1635757594', '0'); +INSERT INTO `tao_auth_rule` VALUES ('4', 'app', '应用', '', '1', '1', '0', '0', 'layui-icon-app', '1', '4', '', '0', '1635757536', '0'); +INSERT INTO `tao_auth_rule` VALUES ('5', 'article', '内容', '', '1', '1', '0', '0', 'layui-icon-read', '1', '1', '', '0', '1635757294', '0'); INSERT INTO `tao_auth_rule` VALUES ('6', 'admin/User/list', '用户管理', '', '1', '1', '1', '1', '', '1', '1', '', '0', '1578901015', '0'); INSERT INTO `tao_auth_rule` VALUES ('7', 'admin/Admin/index', '管理员', '', '1', '1', '1', '1', '', '1', '6', '', '0', '1578901133', '0'); INSERT INTO `tao_auth_rule` VALUES ('8', 'admin/AuthGroup/list', '角色管理', '', '1', '1', '1', '1', '', '1', '11', '', '0', '1578901282', '0'); @@ -257,10 +257,13 @@ INSERT INTO `tao_auth_rule` VALUES ('89', 'admin/User/auth', '设置超级用户 INSERT INTO `tao_auth_rule` VALUES ('90', 'admin/Forum/tagshot', '开启热点', '', '1', '1', '16', '2', '', '0', '15', '', '1585841826', '1611997546', '0'); INSERT INTO `tao_auth_rule` VALUES ('91', 'admin/Admin/infoSet', '资料设置', '', '1', '1', '12', '2', '', '0', '62', '', '1586245669', '1611998517', '0'); INSERT INTO `tao_auth_rule` VALUES ('92', 'admin/Admin/repassSet', '密码设置', '', '1', '1', '13', '2', '', '0', '64', '', '1586245727', '1611998534', '0'); -INSERT INTO `tao_auth_rule` VALUES ('93', 'servers', '服务', '', '1', '1', '0', '0', 'layui-icon-cols', '1', '2', '', '1611286515', '1611997619', '0'); +INSERT INTO `tao_auth_rule` VALUES ('93', 'servers', '服务', '', '1', '1', '0', '0', 'layui-icon-cols', '1', '3', '', '1611286515', '1635757525', '0'); INSERT INTO `tao_auth_rule` VALUES ('94', 'admin/Database/index', '数据备份', '', '1', '1', '93', '1', '', '1', '9', '', '1611897141', '1611902589', '0'); INSERT INTO `tao_auth_rule` VALUES ('95', 'admin/Database/backup', '进行备份', '', '1', '1', '94', '2', '', '0', '10', '', '1611897285', '1611902610', '0'); INSERT INTO `tao_auth_rule` VALUES ('96', 'admin/Database/delete', '备份删除', '', '1', '1', '94', '2', '', '0', '0', '', '1611902429', '0', '0'); +INSERT INTO `tao_auth_rule` VALUES ('97', 'addons', '插件', '', '1', '1', '0', '0', 'layui-icon-flag', '1', '2', '', '1635757328', '1635757632', '0'); +INSERT INTO `tao_auth_rule` VALUES ('98', 'admin/Addons/index', '插件市场', '', '1', '1', '97', '1', '', '1', '0', '', '1635757426', '0', '0'); +INSERT INTO `tao_auth_rule` VALUES ('99', 'admin/Addons/addonsList', '插件列表', '', '1', '1', '98', '2', '', '', '0', '', '1635758251', '0', '0'); -- ---------------------------- -- Table structure for tao_cate @@ -471,7 +474,7 @@ CREATE TABLE `tao_system` ( `cache` tinyint(5) NOT NULL DEFAULT '0' COMMENT '缓存时间分钟', `upsize` int(5) NOT NULL DEFAULT '0' COMMENT '上传文件大小KB', `uptype` varchar(255) NOT NULL DEFAULT '0' COMMENT '上传文件类型', - `copyright` varchar(80) NOT NULL DEFAULT '' COMMENT '版权', + `copyright` varchar(100) NOT NULL DEFAULT '' COMMENT '版权', `keywords` tinytext NOT NULL COMMENT '网站关键字', `descript` tinytext NOT NULL COMMENT '网站描述', `is_open` enum('0','1') NOT NULL DEFAULT '1' COMMENT '是否开启站点1开启0关闭', diff --git a/app/middleware/AddonsLang.php b/app/middleware/AddonsLang.php new file mode 100644 index 0000000..2da6891 --- /dev/null +++ b/app/middleware/AddonsLang.php @@ -0,0 +1,18 @@ +app->getRootPath() . '/vendor/zzstudio/think-addons/src/lang/zh-cn.php', + app()->getRootPath().'addons/sign/lang/zh-cn.php', + ]); + + return $next($request); + } +} diff --git a/app/middleware/Auth.php b/app/middleware/Auth.php index 52a792f..da3cd98 100644 --- a/app/middleware/Auth.php +++ b/app/middleware/Auth.php @@ -18,7 +18,7 @@ class Auth public function handle($request, \Closure $next) { $path = app('http')->getName().'/'.stristr($request->pathinfo(),".html",true); - +//var_dump($path); //没有登录及当前非登录页重定向登录页 if(!Session::has('admin_id') && $path !== 'admin/login/index' && !stristr($request->pathinfo(),"captcha.html") ) { @@ -31,14 +31,16 @@ class Auth } // 排除公共权限 - $not_check = ['admin/','admin/login/index','admin/index/index','admin/index/home','admin/Admin/info','admin/Admin/repass','admin/Admin/logout','admin/Index/news','admin/Index/cunsult','admin/Index/replys','admin/Index/reply','admin/captcha']; + $not_check = ['admin/','admin/login/index','admin/index/index','admin/index/home','admin/Admin/info','admin/Admin/repass','admin/Admin/logout','admin/Index/news','admin/Index/cunsult','admin/Index/replys','admin/Index/reply','admin/captcha','addons/socail/']; if (!in_array($path, $not_check)) { $auth = new UserAuth(); $admin_id = Session::get('admin_id'); //登录用户的id if (!$auth->check($path, $admin_id) && $admin_id != 1) { - return view('public/auth'); + //return view('public/auth'); + //return response(""); + return json(['code'=>-1,'msg'=>'无权限']); } } return $next($request); diff --git a/app/middleware/CheckRegister.php b/app/middleware/CheckRegister.php index ad91129..9456d9b 100644 --- a/app/middleware/CheckRegister.php +++ b/app/middleware/CheckRegister.php @@ -8,13 +8,14 @@ class CheckRegister { public function handle($request, \Closure $next) { - //排除特殊注册用户名 + //排除禁止注册用户名的字段 if($request->action(true)=='reg'){ + $name = $request->param('name'); $disname = Db::name('system')->where('id',1)->value('blackname'); $data = explode("|",$disname); foreach($data as $v){ - if ($request->param('name') == $v) { - return json(['msg'=>'该用户名禁止注册,请更换名称']); + if(stripos($name,$v) !== false){ + return json(['msg'=>'非法字段或该用户名禁止注册,请更换']); } } } diff --git a/composer.json b/composer.json index de22082..fde31a5 100644 --- a/composer.json +++ b/composer.json @@ -24,10 +24,10 @@ "topthink/think-view": "^1.0", "topthink/think-captcha": "^3.0", "phpmailer/phpmailer": "^6.1", - "zzstudio/think-addons": "^2.0", "firebase/php-jwt": "^5.2", "lotofbadcode/phpspirit_databackup": "^1.1", - "wamkj/thinkphp6.0-databackup": "^1.0" + "wamkj/thinkphp6.0-databackup": "^1.0", + "taoser/think-addons": "^1.0" }, "require-dev": { "symfony/var-dumper": "^4.2", @@ -39,7 +39,10 @@ }, "psr-0": { "": "extend/" - } + }, + "files": [ + "extend/taoler/com/form.php" + ] }, "config": { "preferred-install": "dist" diff --git a/composer.lock b/composer.lock index 8be5759..e34f891 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c6dc1dcd45b2b2cd2e7bd36c0e76eb04", + "content-hash": "3ef61427e5d1c98f5ca1e197d25ef688", "packages": [ { "name": "firebase/php-jwt", @@ -71,16 +71,16 @@ }, { "name": "league/flysystem", - "version": "1.1.4", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32" + "reference": "18634df356bfd4119fe3d6156bdb990c414c14ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3ad69181b8afed2c9edf7be5a2918144ff4ea32", - "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/18634df356bfd4119fe3d6156bdb990c414c14ea", + "reference": "18634df356bfd4119fe3d6156bdb990c414c14ea", "shasum": "", "mirrors": [ { @@ -159,7 +159,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.1.4" + "source": "https://github.com/thephpleague/flysystem/tree/1.1.5" }, "funding": [ { @@ -167,7 +167,7 @@ "type": "other" } ], - "time": "2021-06-23T21:56:05+00:00" + "time": "2021-08-17T13:49:42+00:00" }, { "name": "league/flysystem-cached-adapter", @@ -228,16 +228,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.7.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3" + "reference": "b38b25d7b372e9fddb00335400467b223349fd7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b38b25d7b372e9fddb00335400467b223349fd7e", + "reference": "b38b25d7b372e9fddb00335400467b223349fd7e", "shasum": "", "mirrors": [ { @@ -274,7 +274,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.7.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.8.0" }, "funding": [ { @@ -286,7 +286,7 @@ "type": "tidelift" } ], - "time": "2021-01-18T20:58:21+00:00" + "time": "2021-09-25T08:23:19+00:00" }, { "name": "lotofbadcode/phpspirit_databackup", @@ -340,16 +340,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.5.0", + "version": "v6.5.1", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c" + "reference": "dd803df5ad7492e1b40637f7ebd258fee5ca7355" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c", - "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/dd803df5ad7492e1b40637f7ebd258fee5ca7355", + "reference": "dd803df5ad7492e1b40637f7ebd258fee5ca7355", "shasum": "", "mirrors": [ { @@ -367,10 +367,12 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "doctrine/annotations": "^1.2", + "php-parallel-lint/php-console-highlighter": "^0.5.0", + "php-parallel-lint/php-parallel-lint": "^1.3", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.5.6", - "yoast/phpunit-polyfills": "^0.2.0" + "squizlabs/php_codesniffer": "^3.6.0", + "yoast/phpunit-polyfills": "^1.0.0" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", @@ -410,7 +412,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.1" }, "funding": [ { @@ -418,7 +420,7 @@ "type": "github" } ], - "time": "2021-06-16T14:33:43+00:00" + "time": "2021-08-18T09:14:16+00:00" }, { "name": "psr/cache", @@ -642,6 +644,68 @@ }, "time": "2017-10-23T01:57:42+00:00" }, + { + "name": "taoser/think-addons", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/taoser/think-addons.git", + "reference": "bd8b0bfa4543fe8d2da65355c134250f78c0d457" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/taoser/think-addons/zipball/bd8b0bfa4543fe8d2da65355c134250f78c0d457", + "reference": "bd8b0bfa4543fe8d2da65355c134250f78c0d457", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1.0", + "topthink/framework": "^6.0", + "topthink/think-helper": "^3.0.0", + "topthink/think-view": "^1.0" + }, + "type": "library", + "extra": { + "think": { + "services": [ + "taoser\\addons\\Service" + ], + "config": { + "addons": "src/config.php" + } + } + }, + "autoload": { + "psr-4": { + "taoser\\": "src/" + }, + "files": [ + "src/helper.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "mit" + ], + "authors": [ + { + "name": "taoler", + "email": "changlin_zhao@qq.com" + } + ], + "description": "The ThinkPHP6 Addons Package", + "support": { + "issues": "https://github.com/taoser/think-addons/issues", + "source": "https://github.com/taoser/think-addons/tree/v1.0.1" + }, + "time": "2021-09-18T08:41:10+00:00" + }, { "name": "taoser/think-auth", "version": "v1.0.0", @@ -1139,68 +1203,6 @@ "source": "https://github.com/wamkj/thinkphp6.0-databackup/tree/v1.0" }, "time": "2020-02-15T13:04:16+00:00" - }, - { - "name": "zzstudio/think-addons", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/zz-studio/think-addons.git", - "reference": "7eb740cb219a111d593a05ad88248a74f640fe5c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zz-studio/think-addons/zipball/7eb740cb219a111d593a05ad88248a74f640fe5c", - "reference": "7eb740cb219a111d593a05ad88248a74f640fe5c", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1.0", - "topthink/framework": "^6.0", - "topthink/think-helper": "^3.0.0", - "topthink/think-view": "^1.0" - }, - "type": "library", - "extra": { - "think": { - "services": [ - "think\\addons\\Service" - ], - "config": { - "addons": "src/config.php" - } - } - }, - "autoload": { - "psr-4": { - "think\\": "src/" - }, - "files": [ - "src/helper.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "byron", - "email": "xiaobo.sun@qq.com" - } - ], - "description": "The ThinkPHP6 Addons Package", - "support": { - "issues": "https://github.com/zz-studio/think-addons/issues", - "source": "https://github.com/zz-studio/think-addons/tree/2.0.5" - }, - "time": "2020-01-06T06:42:39+00:00" } ], "packages-dev": [ @@ -1463,16 +1465,16 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.27", + "version": "v4.4.33", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "391d6d0e7a06ab54eb7c38fab29b8d174471b3ba" + "reference": "50286e2b7189bfb4f419c0731e86632cddf7c5ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/391d6d0e7a06ab54eb7c38fab29b8d174471b3ba", - "reference": "391d6d0e7a06ab54eb7c38fab29b8d174471b3ba", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/50286e2b7189bfb4f419c0731e86632cddf7c5ee", + "reference": "50286e2b7189bfb4f419c0731e86632cddf7c5ee", "shasum": "", "mirrors": [ { @@ -1538,7 +1540,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.27" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.33" }, "funding": [ { @@ -1554,7 +1556,7 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:41:52+00:00" + "time": "2021-10-25T20:24:58+00:00" }, { "name": "topthink/think-trace", diff --git a/config/app.php b/config/app.php index c0953dd..26bf926 100644 --- a/config/app.php +++ b/config/app.php @@ -21,7 +21,7 @@ return [ 'app_map' => [], // 域名绑定(自动多应用模式有效) 'domain_bind' => [ - //'www' => 'index', + //'bbs' => 'index', //'adm' => 'admin', //'api' => 'api' ], @@ -29,15 +29,16 @@ return [ 'deny_app_list' => [], // 异常页面的模板文件 - 'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl', - + //'exception_tmpl' => app()->getThinkPath() . 'tpl/think_exception.tpl', + 'exception_tmpl' => app()->getAppPath() . '404.html', + // 错误显示信息,非调试模式有效 'error_message' => '页面错误!请稍后再试~', // 显示错误信息 - 'show_error_msg' => true, + 'show_error_msg' => false, //异常页面模板 'http_exception_template' => [ - 404 => '404.html', - 500 => '404.html' + 404 => \think\facade\App::getAppPath() . '404.html', + 500 => \think\facade\App::getAppPath() . '404.html', ] ]; diff --git a/config/taoler.php b/config/taoler.php index 27c25b7..51d81de 100644 --- a/config/taoler.php +++ b/config/taoler.php @@ -7,7 +7,7 @@ return [ //应用名,此项不可更改 'appname' => 'TaoLer', //版本配置 - 'version' => '1.8.9', + 'version' => '1.8.10', //加盐 'salt' => 'taoler', //数据库备份目录 diff --git a/extend/taoler/com/form.php b/extend/taoler/com/form.php new file mode 100644 index 0000000..0661204 --- /dev/null +++ b/extend/taoler/com/form.php @@ -0,0 +1,223 @@ +*{display: inline-block; vertical-align: middle; margin-right: 10px; font-size: 14px;} -.layadmin-user-login-other .layui-icon{position: relative; top: 2px; font-size: 26px;} -.layadmin-user-login-other a:hover{opacity: 0.8;} - -.layadmin-user-jump-change{float: right;} - -.layadmin-user-login-footer{position: absolute; left: 0; bottom: 0; width: 100%; line-height: 30px; padding: 20px; text-align: center; box-sizing: border-box; color: rgba(0,0,0,.5)} -.layadmin-user-login-footer span{padding: 0 5px;} -.layadmin-user-login-footer a{padding: 0 5px; color: rgba(0,0,0,.5);} -.layadmin-user-login-footer a:hover{color: rgba(0,0,0,1);} - -/* 有背景图时 */ -.layadmin-user-login-main[bgimg]{background-color: #fff; box-shadow: 0 0 5px rgba(0,0,0,0.05);} - -/* 主题背景 */ -.ladmin-user-login-theme{position: fixed; bottom: 0; left: 0; width: 100%; text-align: center;} -.ladmin-user-login-theme ul{display: inline-block; padding: 5px; background-color: #fff;} -.ladmin-user-login-theme ul li{display: inline-block; vertical-align: top; width: 64px; height: 43px; cursor: pointer; transition: all .3s; -webkit-transition: all .3s; background-color: #f2f2f2;} -.ladmin-user-login-theme ul li:hover{opacity: 0.9} - -@media screen and (max-width: 768px) { - .layadmin-user-login{padding-top: 60px;} - .layadmin-user-login-main{width: 300px;} - .layadmin-user-login-box{padding: 10px;} -} - - - diff --git a/public/admin/style/res/bg.jpg b/public/admin/style/res/bg.jpg deleted file mode 100644 index 308e1ff..0000000 Binary files a/public/admin/style/res/bg.jpg and /dev/null differ diff --git a/public/admin/style/res/bg1.jpg b/public/admin/style/res/bg1.jpg deleted file mode 100644 index 7c7a6f9..0000000 Binary files a/public/admin/style/res/bg1.jpg and /dev/null differ diff --git a/public/static/admin/modules/addons.js b/public/static/admin/modules/addons.js index 8e522e2..eb5bd3e 100644 --- a/public/static/admin/modules/addons.js +++ b/public/static/admin/modules/addons.js @@ -6,86 +6,66 @@ layui.define(['table', 'form','upload'], function(exports){ ,form = layui.form ,upload = layui.upload; - //安装插件 - table.render({ - elem: '#addons-list', - toolbar: '#toolbar', - url: addonsList, - cols:[ - col - ] - ,page: true - ,limit: 10 - ,height: 'full-220' - ,text: '对不起,加载出现异常!' - }); +function addList(type) + { + $.ajax({ + type: 'post', + url: addonsList , + data: {type:type}, + dataType: 'json', + success: function (res) { + //渲染表格 + table.render({ + elem: '#addons-list', + toolbar: '#toolbar', + defaultToolbar: [], + url: addonsList + '?type='+ type, + cols: [ + res['col'] + ] + , page: true + , limit: 10 + , height: 'full-220' + , text: '对不起,加载出现异常!' + }); + } + }); +} + +addList('installed'); //头工具栏事件 table.on('toolbar(addons-list)', function(obj){ var checkStatus = table.checkStatus(obj.config.id); switch(obj.event){ case 'installed': - $.post(addonsIndex + '?type=installed',function(){ - location.href = addonsIndex + '?type=installed'; - }); - $.post(addonsList + '?type=installed',{"type":"installed"}); - table.reload('addons-list', { - where: {"type":"installed"} - }); //数据刷新 + addList("installed"); break; case 'onlineAddons': - $.post(addonsIndex + '?type=onlineAddons',function(){ - location.href = addonsIndex + '?type=onlineAddons'; - }); - $.post(addonsList + '?type=onlineAddons',{"type":"onlineAddons"}); - table.reload('addons-list', { - where: {"type":"onlineAddons"} - }); //数据刷新 + addList("onlineAddons"); break; - case 'isAll': - layer.msg(checkStatus.isAll ? '全选': '未全选'); - break; - - //自定义头工具栏右侧图标 - 提示 - case 'LAYTABLE_TIPS': - layer.alert('这是工具栏右侧自定义的一个图标按钮'); - break; - }; + } }); //监听工具条 table.on('tool(addons-list)', function(obj){ var data = obj.data; + if(obj.event === 'del'){ layer.prompt({ formType: 1 ,title: '敏感操作,请验证口令' }, function(value, index){ layer.close(index); - layer.confirm('真的删除行么', function(index){ - //obj.del(); - $.ajax({ - type:'post', - url:addonsDelete, - data:{id:data.id}, - dataType:'json', - success:function(data){ - if(data.code == 0){ - layer.msg(data.msg,{ - icon:6, - time:2000 - }); - } else { - layer.open({ - title:'删除失败', - content:data.msg, - icon:5, - adim:6 - }) - } - } - }); + $.post(addonsDelete,{name:data.name},function (res) { + if (res.code == 0) { + layer.msg(res.msg,{icon:6,time:2000}); + } else { + layer.open({tiele:'修改失败',content:res.msg,icon:5,anim:6}); + } + }); + table.reload('addons-list'); layer.close(index); }); @@ -100,7 +80,6 @@ layui.define(['table', 'form','upload'], function(exports){ ,area: ['400px', '620px'] ,btn: ['确定', '取消'] ,yes: function(index, layero){ - var iframeWindow = window['layui-layer-iframe'+ index] ,submitID = 'LAY-addons-submit' ,submit = layero.find('iframe').contents().find('#'+ submitID); @@ -117,17 +96,9 @@ layui.define(['table', 'form','upload'], function(exports){ daType:"json", success:function (res){ if (res.code == 0) { - layer.msg(res.msg,{ - icon:6, - time:2000 - }); + layer.msg(res.msg,{icon:6,time:2000}); } else { - layer.open({ - tiele:'修改失败', - content:res.msg, - icon:5, - anim:6 - }); + layer.open({tiele:'修改失败',content:res.msg,icon:5,anim:6}); } } }); @@ -142,7 +113,106 @@ layui.define(['table', 'form','upload'], function(exports){ } }); - } + } else if (obj.event === 'start'){ + //提交 Ajax 成功后,静态更新表格中的数据 + $.ajax({ + type:"post", + url:addonsStart, + data:{name:data.name}, + daType:"json", + success:function (res){ + if (res.code == 0) { + layer.msg(res.msg,{icon:6,time:2000}); + } else { + layer.open({tiele:'修改失败',content:res.msg,icon:5,anim:6}); + } + } + }); + } else if(obj.event === 'shutdown'){ + //提交 Ajax 成功后,静态更新表格中的数据 + $.ajax({ + type:"post", + url:addonsShut, + data:{name:data.name}, + daType:"json", + success:function (res){ + if (res.code == 0) { + layer.msg(res.msg,{icon:6,time:2000}); + } else { + layer.open({tiele:'修改失败',content:res.msg,icon:5,anim:6}); + } + } + }); + } else if(obj.event === 'install'){ + //安装插件 + $.post(addonsInstall,{name:data.name,version:data.version},function (res) { + if (res.code == 0) { + layer.msg(res.msg,{icon:6,time:2000}); + } else { + layer.open({tiele:'修改失败',content:res.msg,icon:5,anim:6}); + } + }); + } else if(obj.event === 'config'){ + layer.open({ + type: 2 + ,title: '配置插件' + ,content: addonsConfig + '?name='+ data.name + ,maxmin: true + ,area: ['780px', '90%'] + ,btn: ['确定', '取消'] + ,yes: function(index, layero){ + var iframeWindow = window['layui-layer-iframe'+ index] + ,submitID = 'LAY-addons-config-submit' + ,submit = layero.find('iframe').contents().find('#'+ submitID); + //监听提交 + iframeWindow.layui.form.on('submit('+ submitID +')', function(data){ + var field = data.field; //获取提交的字段 + $.ajax({ + type:"post", + url:addonsConfig, + data:field, + daType:"json", + success:function (res){ + if (res.code == 0) { + layer.msg(res.msg,{icon:6,time:2000}); + } else { + layer.open({tiele:'修改失败',content:res.msg,icon:5,anim:6}); + } + } + }); + layer.close(index); //关闭弹层 + }); + submit.trigger('click'); + } + ,success: function(layero, index){ + var forms = layero.find('iframe').contents().find('.layui-form'); + var button = forms.find('button'); + //事件委托 + forms.on('click','button',function (data) { + var even = this.getAttribute('lay-event'); + var names = this.dataset.name; + if(even == 'addInput'){ + var html = '
\n' + + ' \n' + + '
\n' + + ' \n' + + '
\n' + + ' \n' + + '
'; + + $(this).parent().parent().append(html); + } else { + $(this).parent().remove(); + } + }); + + } + }); + + } + table.reload('addons-list'); //数据刷新 }); exports('addons', {}) diff --git a/public/static/admin/style/login.css b/public/static/admin/style/login.css index 30fb615..a85bc77 100644 --- a/public/static/admin/style/login.css +++ b/public/static/admin/style/login.css @@ -6,14 +6,14 @@ @License:GPL-2 */ - + html,body,#LAY_app{height:100%;} .layui-layout-body{overflow: auto;} #LAY-user-login, .layadmin-user-display-show{display: block !important;} .layadmin-user-login{position: relative; left: 0; top: 0; padding: 110px 0; min-height: 100%; box-sizing: border-box;} -.layadmin-user-login-main{width: 375px; margin: 0 auto; box-sizing: border-box;} +.layadmin-user-login-main{width: 375px; margin-top: 0px; margin-left: 5%; box-sizing: border-box; background-color:rgba(0,0,0,.3); border:1px solid; border-radius:15px} .layadmin-user-login-box{padding: 20px;} .layadmin-user-login-header{text-align: center;} .layadmin-user-login-header h2{margin-bottom: 10px; font-weight: 300; font-size: 30px; color: #000;} diff --git a/public/static/res/images/logo-m.png b/public/static/res/images/logo-m.png new file mode 100644 index 0000000..3876c1b Binary files /dev/null and b/public/static/res/images/logo-m.png differ diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index ad4475a..3220968 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -35,12 +35,12 @@ private static $installed = array ( ), 'league/flysystem' => array ( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', + 'pretty_version' => '1.1.5', + 'version' => '1.1.5.0', 'aliases' => array ( ), - 'reference' => 'f3ad69181b8afed2c9edf7be5a2918144ff4ea32', + 'reference' => '18634df356bfd4119fe3d6156bdb990c414c14ea', ), 'league/flysystem-cached-adapter' => array ( @@ -53,12 +53,12 @@ private static $installed = array ( ), 'league/mime-type-detection' => array ( - 'pretty_version' => '1.7.0', - 'version' => '1.7.0.0', + 'pretty_version' => '1.8.0', + 'version' => '1.8.0.0', 'aliases' => array ( ), - 'reference' => '3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3', + 'reference' => 'b38b25d7b372e9fddb00335400467b223349fd7e', ), 'lotofbadcode/phpspirit_databackup' => array ( @@ -71,12 +71,12 @@ private static $installed = array ( ), 'phpmailer/phpmailer' => array ( - 'pretty_version' => 'v6.5.0', - 'version' => '6.5.0.0', + 'pretty_version' => 'v6.5.1', + 'version' => '6.5.1.0', 'aliases' => array ( ), - 'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c', + 'reference' => 'dd803df5ad7492e1b40637f7ebd258fee5ca7355', ), 'psr/cache' => array ( @@ -143,12 +143,12 @@ private static $installed = array ( ), 'symfony/var-dumper' => array ( - 'pretty_version' => 'v4.4.27', - 'version' => '4.4.27.0', + 'pretty_version' => 'v4.4.33', + 'version' => '4.4.33.0', 'aliases' => array ( ), - 'reference' => '391d6d0e7a06ab54eb7c38fab29b8d174471b3ba', + 'reference' => '50286e2b7189bfb4f419c0731e86632cddf7c5ee', ), 'taoser/taoler' => array ( @@ -159,6 +159,15 @@ private static $installed = array ( ), 'reference' => NULL, ), + 'taoser/think-addons' => + array ( + 'pretty_version' => 'v1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => 'bd8b0bfa4543fe8d2da65355c134250f78c0d457', + ), 'taoser/think-auth' => array ( 'pretty_version' => 'v1.0.0', @@ -249,15 +258,6 @@ private static $installed = array ( ), 'reference' => '28a0e406d827132942723a3c9f69bb20c98e652f', ), - 'zzstudio/think-addons' => - array ( - 'pretty_version' => '2.0.5', - 'version' => '2.0.5.0', - 'aliases' => - array ( - ), - 'reference' => '7eb740cb219a111d593a05ad88248a74f640fe5c', - ), ), ); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index c158ae2..bf855c7 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -11,7 +11,8 @@ return array( '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', + '223fa6f9b46fbe5d6b44c5ff847bfceb' => $vendorDir . '/taoser/think-addons/src/helper.php', '1cfd2761b63b0a29ed23657ea394cb2d' => $vendorDir . '/topthink/think-captcha/src/helper.php', - '39594db8502267d6df2fe2dca5f3914d' => $vendorDir . '/zzstudio/think-addons/src/helper.php', + '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', + 'd421242fd42b2ea6cd13f802bcf18a6e' => $baseDir . '/extend/taoler/com/form.php', ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index cd4ff01..423d0f9 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -11,8 +11,9 @@ return array( 'think\\trace\\' => array($vendorDir . '/topthink/think-trace/src'), 'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'), 'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'), - 'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src', $vendorDir . '/zzstudio/think-addons/src'), + 'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src'), 'taoser\\think\\' => array($vendorDir . '/taoser/think-auth/src'), + 'taoser\\' => array($vendorDir . '/taoser/think-addons/src'), 'phpspirit\\databackup\\' => array($vendorDir . '/lotofbadcode/phpspirit_databackup/src'), 'app\\' => array($baseDir . '/app'), 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 90bae3d..c6fd617 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -12,9 +12,10 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2 '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', + '223fa6f9b46fbe5d6b44c5ff847bfceb' => __DIR__ . '/..' . '/taoser/think-addons/src/helper.php', '1cfd2761b63b0a29ed23657ea394cb2d' => __DIR__ . '/..' . '/topthink/think-captcha/src/helper.php', - '39594db8502267d6df2fe2dca5f3914d' => __DIR__ . '/..' . '/zzstudio/think-addons/src/helper.php', + '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', + 'd421242fd42b2ea6cd13f802bcf18a6e' => __DIR__ . '/../..' . '/extend/taoler/com/form.php', ); public static $prefixLengthsPsr4 = array ( @@ -30,6 +31,7 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2 'think\\app\\' => 10, 'think\\' => 6, 'taoser\\think\\' => 13, + 'taoser\\' => 7, ), 'p' => array ( @@ -93,12 +95,15 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2 1 => __DIR__ . '/..' . '/topthink/think-helper/src', 2 => __DIR__ . '/..' . '/topthink/think-orm/src', 3 => __DIR__ . '/..' . '/topthink/think-template/src', - 4 => __DIR__ . '/..' . '/zzstudio/think-addons/src', ), 'taoser\\think\\' => array ( 0 => __DIR__ . '/..' . '/taoser/think-auth/src', ), + 'taoser\\' => + array ( + 0 => __DIR__ . '/..' . '/taoser/think-addons/src', + ), 'phpspirit\\databackup\\' => array ( 0 => __DIR__ . '/..' . '/lotofbadcode/phpspirit_databackup/src', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index d71fc07..0dd6329 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -68,17 +68,17 @@ }, { "name": "league/flysystem", - "version": "1.1.4", - "version_normalized": "1.1.4.0", + "version": "1.1.5", + "version_normalized": "1.1.5.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32" + "reference": "18634df356bfd4119fe3d6156bdb990c414c14ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3ad69181b8afed2c9edf7be5a2918144ff4ea32", - "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/18634df356bfd4119fe3d6156bdb990c414c14ea", + "reference": "18634df356bfd4119fe3d6156bdb990c414c14ea", "shasum": "", "mirrors": [ { @@ -114,7 +114,7 @@ "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" }, - "time": "2021-06-23T21:56:05+00:00", + "time": "2021-08-17T13:49:42+00:00", "type": "library", "extra": { "branch-alias": { @@ -159,7 +159,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.1.4" + "source": "https://github.com/thephpleague/flysystem/tree/1.1.5" }, "funding": [ { @@ -227,17 +227,17 @@ }, { "name": "league/mime-type-detection", - "version": "1.7.0", - "version_normalized": "1.7.0.0", + "version": "1.8.0", + "version_normalized": "1.8.0.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3" + "reference": "b38b25d7b372e9fddb00335400467b223349fd7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", - "reference": "3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b38b25d7b372e9fddb00335400467b223349fd7e", + "reference": "b38b25d7b372e9fddb00335400467b223349fd7e", "shasum": "", "mirrors": [ { @@ -255,7 +255,7 @@ "phpstan/phpstan": "^0.12.68", "phpunit/phpunit": "^8.5.8 || ^9.3" }, - "time": "2021-01-18T20:58:21+00:00", + "time": "2021-09-25T08:23:19+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -276,7 +276,7 @@ "description": "Mime-type detection for Flysystem", "support": { "issues": "https://github.com/thephpleague/mime-type-detection/issues", - "source": "https://github.com/thephpleague/mime-type-detection/tree/1.7.0" + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.8.0" }, "funding": [ { @@ -345,17 +345,17 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.5.0", - "version_normalized": "6.5.0.0", + "version": "v6.5.1", + "version_normalized": "6.5.1.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c" + "reference": "dd803df5ad7492e1b40637f7ebd258fee5ca7355" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c", - "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/dd803df5ad7492e1b40637f7ebd258fee5ca7355", + "reference": "dd803df5ad7492e1b40637f7ebd258fee5ca7355", "shasum": "", "mirrors": [ { @@ -373,10 +373,12 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "doctrine/annotations": "^1.2", + "php-parallel-lint/php-console-highlighter": "^0.5.0", + "php-parallel-lint/php-parallel-lint": "^1.3", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.5.6", - "yoast/phpunit-polyfills": "^0.2.0" + "squizlabs/php_codesniffer": "^3.6.0", + "yoast/phpunit-polyfills": "^1.0.0" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", @@ -386,7 +388,7 @@ "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" }, - "time": "2021-06-16T14:33:43+00:00", + "time": "2021-08-18T09:14:16+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -418,7 +420,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.1" }, "funding": [ { @@ -924,17 +926,17 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.27", - "version_normalized": "4.4.27.0", + "version": "v4.4.33", + "version_normalized": "4.4.33.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "391d6d0e7a06ab54eb7c38fab29b8d174471b3ba" + "reference": "50286e2b7189bfb4f419c0731e86632cddf7c5ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/391d6d0e7a06ab54eb7c38fab29b8d174471b3ba", - "reference": "391d6d0e7a06ab54eb7c38fab29b8d174471b3ba", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/50286e2b7189bfb4f419c0731e86632cddf7c5ee", + "reference": "50286e2b7189bfb4f419c0731e86632cddf7c5ee", "shasum": "", "mirrors": [ { @@ -964,7 +966,7 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2021-07-23T15:41:52+00:00", + "time": "2021-10-25T20:24:58+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -1002,7 +1004,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.27" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.33" }, "funding": [ { @@ -1020,6 +1022,71 @@ ], "install-path": "../symfony/var-dumper" }, + { + "name": "taoser/think-addons", + "version": "v1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/taoser/think-addons.git", + "reference": "bd8b0bfa4543fe8d2da65355c134250f78c0d457" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/taoser/think-addons/zipball/bd8b0bfa4543fe8d2da65355c134250f78c0d457", + "reference": "bd8b0bfa4543fe8d2da65355c134250f78c0d457", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "php": ">=7.1.0", + "topthink/framework": "^6.0", + "topthink/think-helper": "^3.0.0", + "topthink/think-view": "^1.0" + }, + "time": "2021-09-18T08:41:10+00:00", + "type": "library", + "extra": { + "think": { + "services": [ + "taoser\\addons\\Service" + ], + "config": { + "addons": "src/config.php" + } + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "taoser\\": "src/" + }, + "files": [ + "src/helper.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "mit" + ], + "authors": [ + { + "name": "taoler", + "email": "changlin_zhao@qq.com" + } + ], + "description": "The ThinkPHP6 Addons Package", + "support": { + "issues": "https://github.com/taoser/think-addons/issues", + "source": "https://github.com/taoser/think-addons/tree/v1.0.1" + }, + "install-path": "../taoser/think-addons" + }, { "name": "taoser/think-auth", "version": "v1.0.0", @@ -1584,67 +1651,6 @@ "source": "https://github.com/wamkj/thinkphp6.0-databackup/tree/v1.0" }, "install-path": "../wamkj/thinkphp6.0-databackup" - }, - { - "name": "zzstudio/think-addons", - "version": "2.0.5", - "version_normalized": "2.0.5.0", - "source": { - "type": "git", - "url": "https://github.com/zz-studio/think-addons.git", - "reference": "7eb740cb219a111d593a05ad88248a74f640fe5c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zz-studio/think-addons/zipball/7eb740cb219a111d593a05ad88248a74f640fe5c", - "reference": "7eb740cb219a111d593a05ad88248a74f640fe5c", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "php": ">=7.1.0", - "topthink/framework": "^6.0", - "topthink/think-helper": "^3.0.0", - "topthink/think-view": "^1.0" - }, - "time": "2020-01-06T06:42:39+00:00", - "type": "library", - "extra": { - "think": { - "services": [ - "think\\addons\\Service" - ], - "config": { - "addons": "src/config.php" - } - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "think\\": "src/" - }, - "files": [ - "src/helper.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "byron", - "email": "xiaobo.sun@qq.com" - } - ], - "description": "The ThinkPHP6 Addons Package", - "install-path": "../zzstudio/think-addons" } ], "dev": true diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 99ac1bb..945c599 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -22,12 +22,12 @@ ), 'league/flysystem' => array ( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', + 'pretty_version' => '1.1.5', + 'version' => '1.1.5.0', 'aliases' => array ( ), - 'reference' => 'f3ad69181b8afed2c9edf7be5a2918144ff4ea32', + 'reference' => '18634df356bfd4119fe3d6156bdb990c414c14ea', ), 'league/flysystem-cached-adapter' => array ( @@ -40,12 +40,12 @@ ), 'league/mime-type-detection' => array ( - 'pretty_version' => '1.7.0', - 'version' => '1.7.0.0', + 'pretty_version' => '1.8.0', + 'version' => '1.8.0.0', 'aliases' => array ( ), - 'reference' => '3b9dff8aaf7323590c1d2e443db701eb1f9aa0d3', + 'reference' => 'b38b25d7b372e9fddb00335400467b223349fd7e', ), 'lotofbadcode/phpspirit_databackup' => array ( @@ -58,12 +58,12 @@ ), 'phpmailer/phpmailer' => array ( - 'pretty_version' => 'v6.5.0', - 'version' => '6.5.0.0', + 'pretty_version' => 'v6.5.1', + 'version' => '6.5.1.0', 'aliases' => array ( ), - 'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c', + 'reference' => 'dd803df5ad7492e1b40637f7ebd258fee5ca7355', ), 'psr/cache' => array ( @@ -130,12 +130,12 @@ ), 'symfony/var-dumper' => array ( - 'pretty_version' => 'v4.4.27', - 'version' => '4.4.27.0', + 'pretty_version' => 'v4.4.33', + 'version' => '4.4.33.0', 'aliases' => array ( ), - 'reference' => '391d6d0e7a06ab54eb7c38fab29b8d174471b3ba', + 'reference' => '50286e2b7189bfb4f419c0731e86632cddf7c5ee', ), 'taoser/taoler' => array ( @@ -146,6 +146,15 @@ ), 'reference' => NULL, ), + 'taoser/think-addons' => + array ( + 'pretty_version' => 'v1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => 'bd8b0bfa4543fe8d2da65355c134250f78c0d457', + ), 'taoser/think-auth' => array ( 'pretty_version' => 'v1.0.0', @@ -236,14 +245,5 @@ ), 'reference' => '28a0e406d827132942723a3c9f69bb20c98e652f', ), - 'zzstudio/think-addons' => - array ( - 'pretty_version' => '2.0.5', - 'version' => '2.0.5.0', - 'aliases' => - array ( - ), - 'reference' => '7eb740cb219a111d593a05ad88248a74f640fe5c', - ), ), ); diff --git a/vendor/league/flysystem/src/Adapter/Ftp.php b/vendor/league/flysystem/src/Adapter/Ftp.php index b009210..8694376 100644 --- a/vendor/league/flysystem/src/Adapter/Ftp.php +++ b/vendor/league/flysystem/src/Adapter/Ftp.php @@ -160,7 +160,7 @@ class Ftp extends AbstractFtpAdapter { if ($this->utf8) { $response = ftp_raw($this->connection, "OPTS UTF8 ON"); - if (substr($response[0], 0, 3) !== '200') { + if (!in_array(substr($response[0], 0, 3), ['200', '202'])) { throw new ConnectionRuntimeException( 'Could not set UTF-8 mode for connection: ' . $this->getHost() . '::' . $this->getPort() ); diff --git a/vendor/league/mime-type-detection/CHANGELOG.md b/vendor/league/mime-type-detection/CHANGELOG.md index d9eab90..ad24408 100644 --- a/vendor/league/mime-type-detection/CHANGELOG.md +++ b/vendor/league/mime-type-detection/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.8.0 - 2021-09-25 + +### Added + +- Added the decorator `OverridingExtensionToMimeTypeMap` which allows you to override values. + ## 1.7.0 - 2021-01-18 ### Added diff --git a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php index 698e276..13a97f9 100644 --- a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php +++ b/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php @@ -45,6 +45,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'air' => 'application/vnd.adobe.air-application-installer-package+zip', 'ait' => 'application/vnd.dvb.ait', 'ami' => 'application/vnd.amiga.ami', + 'amr' => 'audio/amr', 'apk' => 'application/vnd.android.package-archive', 'apng' => 'image/apng', 'appcache' => 'text/cache-manifest', @@ -265,6 +266,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'evy' => 'application/x-envoy', 'exe' => 'application/octet-stream', 'exi' => 'application/exi', + 'exp' => 'application/express', 'exr' => 'image/aces', 'ext' => 'application/vnd.novadigm.ext', 'ez' => 'application/andrew-inset', @@ -351,8 +353,8 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'gv' => 'text/vnd.graphviz', 'gxf' => 'application/gxf', 'gxt' => 'application/vnd.geonext', - 'gz' => 'application/x-gzip', - 'gzip' => 'application/x-gzip', + 'gz' => 'application/gzip', + 'gzip' => 'application/gzip', 'h' => 'text/x-c', 'h261' => 'video/h261', 'h263' => 'video/h263', @@ -457,7 +459,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'karbon' => 'application/vnd.kde.karbon', 'kdb' => 'application/octet-stream', 'kdbx' => 'application/x-keepass2', - 'key' => 'application/vnd.apple.keynote', + 'key' => 'application/x-iwork-keynote-sffkey', 'kfo' => 'application/vnd.kde.kformula', 'kia' => 'application/vnd.kidspiration', 'kml' => 'application/vnd.google-earth.kml+xml', @@ -507,6 +509,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'm3u8' => 'application/vnd.apple.mpegurl', 'm4a' => 'audio/x-m4a', 'm4p' => 'application/mp4', + 'm4s' => 'video/iso.segment', 'm4u' => 'application/vnd.mpegurl', 'm4v' => 'video/x-m4v', 'm13' => 'application/x-msmediaview', @@ -608,6 +611,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'musd' => 'application/mmt-usd+xml', 'musicxml' => 'application/vnd.recordare.musicxml+xml', 'mvb' => 'application/x-msmediaview', + 'mvt' => 'application/vnd.mapbox-vector-tile', 'mwf' => 'application/vnd.mfer', 'mxf' => 'application/mxf', 'mxl' => 'application/vnd.recordare.musicxml', @@ -635,7 +639,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'nsf' => 'application/vnd.lotus-notes', 'nt' => 'application/n-triples', 'ntf' => 'application/vnd.nitf', - 'numbers' => 'application/vnd.apple.numbers', + 'numbers' => 'application/x-iwork-numbers-sffnumbers', 'nzb' => 'application/x-nzb', 'oa2' => 'application/vnd.fujitsu.oasys2', 'oa3' => 'application/vnd.fujitsu.oasys3', @@ -696,7 +700,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'p10' => 'application/x-pkcs10', 'p12' => 'application/x-pkcs12', 'pac' => 'application/x-ns-proxy-autoconfig', - 'pages' => 'application/vnd.apple.pages', + 'pages' => 'application/x-iwork-pages-sffpages', 'pas' => 'text/x-pascal', 'paw' => 'application/vnd.pawaafile', 'pbd' => 'application/vnd.powerbuilder6', @@ -921,6 +925,9 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'sti' => 'application/vnd.sun.xml.impress.template', 'stk' => 'application/hyperstudio', 'stl' => 'model/stl', + 'stpx' => 'model/step+xml', + 'stpxz' => 'model/step-xml+zip', + 'stpz' => 'model/step+zip', 'str' => 'application/vnd.pg.format', 'stw' => 'application/vnd.sun.xml.writer.template', 'styl' => 'text/stylus', @@ -977,6 +984,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'tpt' => 'application/vnd.trid.tpt', 'tr' => 'text/troff', 'tra' => 'application/vnd.trueapp', + 'trig' => 'application/trig', 'trm' => 'application/x-msterminal', 'ts' => 'video/mp2t', 'tsd' => 'application/timestamped-data', @@ -1047,6 +1055,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'vcs' => 'text/x-vcalendar', 'vcx' => 'application/vnd.vcx', 'vdi' => 'application/x-virtualbox-vdi', + 'vds' => 'model/vnd.sap.vds', 'vhd' => 'application/x-virtualbox-vhd', 'vis' => 'application/vnd.visionary', 'viv' => 'video/vnd.vivo', @@ -1136,7 +1145,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'xdw' => 'application/vnd.fujixerox.docuworks', 'xel' => 'application/xcap-el+xml', 'xenc' => 'application/xenc+xml', - 'xer' => 'application/xcap-error+xml', + 'xer' => 'application/patch-ops-error+xml', 'xfdf' => 'application/vnd.adobe.xfdf', 'xfdl' => 'application/vnd.xfdl', 'xht' => 'application/xhtml+xml', @@ -1195,7 +1204,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'z7' => 'application/x-zmachine', 'z8' => 'application/x-zmachine', 'zaz' => 'application/vnd.zzazz.deck+xml', - 'zip' => 'application/x-zip', + 'zip' => 'application/zip', 'zir' => 'application/vnd.zul', 'zirz' => 'application/vnd.zul', 'zmm' => 'application/vnd.handheld-entertainment+xml', diff --git a/vendor/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php new file mode 100644 index 0000000..0c71e4d --- /dev/null +++ b/vendor/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php @@ -0,0 +1,30 @@ + $overrides + */ + public function __construct(ExtensionToMimeTypeMap $innerMap, array $overrides) + { + $this->innerMap = $innerMap; + $this->overrides = $overrides; + } + + public function lookupMimeType(string $extension): ?string + { + return $this->overrides[$extension] ?? $this->innerMap->lookupMimeType($extension); + } +} diff --git a/vendor/phpmailer/phpmailer/README.md b/vendor/phpmailer/phpmailer/README.md index fa27d2f..81b0897 100644 --- a/vendor/phpmailer/phpmailer/README.md +++ b/vendor/phpmailer/phpmailer/README.md @@ -2,7 +2,12 @@ # PHPMailer – A full-featured email creation and transfer class for PHP -[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) [![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) [![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) [![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/) +[![Test status](https://github.com/PHPMailer/PHPMailer/workflows/Tests/badge.svg)](https://github.com/PHPMailer/PHPMailer/actions) +[![codecov.io](https://codecov.io/gh/PHPMailer/PHPMailer/branch/master/graph/badge.svg?token=iORZpwmYmM)](https://codecov.io/gh/PHPMailer/PHPMailer) +[![Latest Stable Version](https://poser.pugx.org/phpmailer/phpmailer/v/stable.svg)](https://packagist.org/packages/phpmailer/phpmailer) +[![Total Downloads](https://poser.pugx.org/phpmailer/phpmailer/downloads)](https://packagist.org/packages/phpmailer/phpmailer) +[![License](https://poser.pugx.org/phpmailer/phpmailer/license.svg)](https://packagist.org/packages/phpmailer/phpmailer) +[![API Docs](https://github.com/phpmailer/phpmailer/workflows/Docs/badge.svg)](https://phpmailer.github.io/PHPMailer/) ## Features - Probably the world's most popular code for sending email from PHP! @@ -17,7 +22,7 @@ - Protects against header injection attacks - Error messages in over 50 languages! - DKIM and S/MIME signing support -- Compatible with PHP 5.5 and later, including PHP 8.0 +- Compatible with PHP 5.5 and later, including PHP 8.1 - Namespaced to prevent name clashes - Much more! @@ -39,7 +44,7 @@ This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lg PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: ```json -"phpmailer/phpmailer": "^6.2" +"phpmailer/phpmailer": "^6.5" ``` or run @@ -89,7 +94,7 @@ use PHPMailer\PHPMailer\Exception; //Load Composer's autoloader require 'vendor/autoload.php'; -//Instantiation and passing `true` enables exceptions +//Create an instance; passing `true` enables exceptions $mail = new PHPMailer(true); try { @@ -100,8 +105,8 @@ try { $mail->SMTPAuth = true; //Enable SMTP authentication $mail->Username = 'user@example.com'; //SMTP username $mail->Password = 'secret'; //SMTP password - $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged - $mail->Port = 587; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above + $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption + $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` //Recipients $mail->setFrom('from@example.com', 'Mailer'); diff --git a/vendor/phpmailer/phpmailer/VERSION b/vendor/phpmailer/phpmailer/VERSION index 4be2c72..3d5762e 100644 --- a/vendor/phpmailer/phpmailer/VERSION +++ b/vendor/phpmailer/phpmailer/VERSION @@ -1 +1 @@ -6.5.0 \ No newline at end of file +6.5.1 \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/composer.json b/vendor/phpmailer/phpmailer/composer.json index 58393b2..28557f5 100644 --- a/vendor/phpmailer/phpmailer/composer.json +++ b/vendor/phpmailer/phpmailer/composer.json @@ -34,10 +34,12 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "doctrine/annotations": "^1.2", + "php-parallel-lint/php-console-highlighter": "^0.5.0", + "php-parallel-lint/php-parallel-lint": "^1.3", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.5.6", - "yoast/phpunit-polyfills": "^0.2.0" + "squizlabs/php_codesniffer": "^3.6.0", + "yoast/phpunit-polyfills": "^1.0.0" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", @@ -60,6 +62,10 @@ "license": "LGPL-2.1-only", "scripts": { "check": "./vendor/bin/phpcs", - "test": "./vendor/bin/phpunit" + "test": "./vendor/bin/phpunit --no-coverage", + "coverage": "./vendor/bin/phpunit", + "lint": [ + "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php,phps --exclude vendor --exclude .git --exclude build" + ] } } diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php index eee7989..c76f526 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php @@ -5,24 +5,25 @@ * @package PHPMailer * @author Mitsuhiro Yoshida * @author Yoshi Sakai + * @author Arisophy */ $PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; $PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; +$PHPMAILER_LANG['empty_message'] = 'メール本文が空です。'; $PHPMAILER_LANG['encoding'] = '不明なエンコーディング: '; $PHPMAILER_LANG['execute'] = '実行できませんでした: '; $PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; $PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; $PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: '; $PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; -//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; +$PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: '; $PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; $PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: '; -//$PHPMAILER_LANG['signing'] = 'Signing Error: '; -//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; -//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; +$PHPMAILER_LANG['signing'] = '署名エラー: '; +$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。'; +$PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: '; +$PHPMAILER_LANG['variable_set'] = '変数が存在しません: '; +$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php index bf41ade..8229d5e 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php @@ -7,23 +7,28 @@ */ $PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.'; +$PHPMAILER_LANG['buggy_php'] = 'PHP versie gededecteerd die onderhavig is aan een bug die kan resulteren in gecorrumpeerde berichten. Om dit te voorkomen, gebruik SMTP voor het verzenden van berichten, zet de mail.add_x_header optie in uw php.ini file uit, gebruik MacOS of Linux, of pas de gebruikte PHP versie aan naar versie 7.0.17+ or 7.1.3+.'; $PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.'; $PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.'; $PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg'; $PHPMAILER_LANG['encoding'] = 'Onbekende codering: '; $PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: '; +$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; $PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: '; $PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: '; $PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: '; $PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.'; $PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: '; +$PHPMAILER_LANG['invalid_header'] = 'Ongeldige header naam of waarde'; $PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: '; $PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.'; $PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: '; $PHPMAILER_LANG['signing'] = 'Signeerfout: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP code: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Aanvullende SMTP informatie: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detail: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: '; $PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; diff --git a/vendor/phpmailer/phpmailer/phpunit.xml.dist b/vendor/phpmailer/phpmailer/phpunit.xml.dist deleted file mode 100644 index c68df96..0000000 --- a/vendor/phpmailer/phpmailer/phpunit.xml.dist +++ /dev/null @@ -1,35 +0,0 @@ - - - - - ./test/ - - - - - - - - languages - pop3 - - - - - ./src - - - - - - - - diff --git a/vendor/phpmailer/phpmailer/src/Exception.php b/vendor/phpmailer/phpmailer/src/Exception.php index a50a899..52eaf95 100644 --- a/vendor/phpmailer/phpmailer/src/Exception.php +++ b/vendor/phpmailer/phpmailer/src/Exception.php @@ -35,6 +35,6 @@ class Exception extends \Exception */ public function errorMessage() { - return '' . htmlspecialchars($this->getMessage()) . "
\n"; + return '' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "
\n"; } } diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php index eb4b742..5b6dcfa 100644 --- a/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -103,14 +103,14 @@ class PHPMailer * * @var string */ - public $From = 'root@localhost'; + public $From = ''; /** * The From name of the message. * * @var string */ - public $FromName = 'Root User'; + public $FromName = ''; /** * The envelope sender of the message. @@ -689,7 +689,7 @@ class PHPMailer protected $boundary = []; /** - * The array of available languages. + * The array of available text strings for the current language. * * @var array */ @@ -750,7 +750,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.5.0'; + const VERSION = '6.5.1'; /** * Error severity: message only, continue processing. @@ -1188,25 +1188,33 @@ class PHPMailer * * @return array */ - public static function parseAddresses($addrstr, $useimap = true) + public static function parseAddresses($addrstr, $useimap = true, $charset = self::CHARSET_ISO88591) { $addresses = []; if ($useimap && function_exists('imap_rfc822_parse_adrlist')) { //Use this built-in parser if it's available $list = imap_rfc822_parse_adrlist($addrstr, ''); + // Clear any potential IMAP errors to get rid of notices being thrown at end of script. + imap_errors(); foreach ($list as $address) { if ( - ('.SYNTAX-ERROR.' !== $address->host) && static::validateAddress( - $address->mailbox . '@' . $address->host - ) + '.SYNTAX-ERROR.' !== $address->host && + static::validateAddress($address->mailbox . '@' . $address->host) ) { //Decode the name part if it's present and encoded if ( property_exists($address, 'personal') && - extension_loaded('mbstring') && - preg_match('/^=\?.*\?=$/', $address->personal) + //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled + defined('MB_CASE_UPPER') && + preg_match('/^=\?.*\?=$/s', $address->personal) ) { + $origCharset = mb_internal_encoding(); + mb_internal_encoding($charset); + //Undo any RFC2047-encoded spaces-as-underscores + $address->personal = str_replace('_', '=20', $address->personal); + //Decode the name $address->personal = mb_decode_mimeheader($address->personal); + mb_internal_encoding($origCharset); } $addresses[] = [ @@ -1234,9 +1242,16 @@ class PHPMailer $email = trim(str_replace('>', '', $email)); $name = trim($name); if (static::validateAddress($email)) { + //Check for a Mbstring constant rather than using extension_loaded, which is sometimes disabled //If this name is encoded, decode it - if (preg_match('/^=\?.*\?=$/', $name)) { + if (defined('MB_CASE_UPPER') && preg_match('/^=\?.*\?=$/s', $name)) { + $origCharset = mb_internal_encoding(); + mb_internal_encoding($charset); + //Undo any RFC2047-encoded spaces-as-underscores + $name = str_replace('_', '=20', $name); + //Decode the name $name = mb_decode_mimeheader($name); + mb_internal_encoding($origCharset); } $addresses[] = [ //Remove any surrounding quotes and spaces from the name @@ -1508,12 +1523,7 @@ class PHPMailer && ini_get('mail.add_x_header') === '1' && stripos(PHP_OS, 'WIN') === 0 ) { - trigger_error( - 'Your version of PHP is affected by a bug that may result in corrupted messages.' . - ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . - ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', - E_USER_WARNING - ); + trigger_error($this->lang('buggy_php'), E_USER_WARNING); } try { @@ -1724,7 +1734,7 @@ class PHPMailer fwrite($mail, $header); fwrite($mail, $body); $result = pclose($mail); - $addrinfo = static::parseAddresses($toAddr); + $addrinfo = static::parseAddresses($toAddr, true, $this->charSet); $this->doCallback( ($result === 0), [[$addrinfo['address'], $addrinfo['name']]], @@ -1884,7 +1894,7 @@ class PHPMailer if ($this->SingleTo && count($toArr) > 1) { foreach ($toArr as $toAddr) { $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); - $addrinfo = static::parseAddresses($toAddr); + $addrinfo = static::parseAddresses($toAddr, true, $this->charSet); $this->doCallback( $result, [[$addrinfo['address'], $addrinfo['name']]], @@ -2181,14 +2191,15 @@ class PHPMailer /** * Set the language for error messages. - * Returns false if it cannot load the language file. * The default language is English. * * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") + * Optionally, the language code can be enhanced with a 4-character + * script annotation and/or a 2-character country annotation. * @param string $lang_path Path to the language file directory, with trailing separator (slash).D * Do not set this from user input! * - * @return bool + * @return bool Returns true if the requested language was loaded, false otherwise. */ public function setLanguage($langcode = 'en', $lang_path = '') { @@ -2211,44 +2222,77 @@ class PHPMailer //Define full set of translatable strings in English $PHPMAILER_LANG = [ 'authenticate' => 'SMTP Error: Could not authenticate.', + 'buggy_php' => 'Your version of PHP is affected by a bug that may result in corrupted messages.' . + ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' . + ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.', 'connect_host' => 'SMTP Error: Could not connect to SMTP host.', 'data_not_accepted' => 'SMTP Error: data not accepted.', 'empty_message' => 'Message body empty', 'encoding' => 'Unknown encoding: ', 'execute' => 'Could not execute: ', + 'extension_missing' => 'Extension missing: ', 'file_access' => 'Could not access file: ', 'file_open' => 'File Error: Could not open file: ', 'from_failed' => 'The following From address failed: ', 'instantiate' => 'Could not instantiate mail function.', 'invalid_address' => 'Invalid address: ', + 'invalid_header' => 'Invalid header name or value', 'invalid_hostentry' => 'Invalid hostentry: ', 'invalid_host' => 'Invalid host: ', 'mailer_not_supported' => ' mailer is not supported.', 'provide_address' => 'You must provide at least one recipient email address.', 'recipients_failed' => 'SMTP Error: The following recipients failed: ', 'signing' => 'Signing Error: ', + 'smtp_code' => 'SMTP code: ', + 'smtp_code_ex' => 'Additional SMTP info: ', 'smtp_connect_failed' => 'SMTP connect() failed.', + 'smtp_detail' => 'Detail: ', 'smtp_error' => 'SMTP server error: ', 'variable_set' => 'Cannot set or reset variable: ', - 'extension_missing' => 'Extension missing: ', ]; if (empty($lang_path)) { //Calculate an absolute path so it can work if CWD is not here $lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR; } + //Validate $langcode - if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) { + $foundlang = true; + $langcode = strtolower($langcode); + if ( + !preg_match('/^(?P[a-z]{2})(?P +{/block} \ No newline at end of file diff --git a/view/taoler/index/article/detail/posts.html b/view/taoler/index/article/detail/posts.html new file mode 100644 index 0000000..87eec9b --- /dev/null +++ b/view/taoler/index/article/detail/posts.html @@ -0,0 +1,318 @@ +{extend name="public/base" /} + +{block name="title"}{$article.title}-{$sysInfo.webname}{/block} +{block name="keywords"}{$article.title},{$article.tags}{/block} +{block name="description"}{$article.title},{:getArtContent($article.content)}{/block} +{block name="link"}{/block} +{block name="column"}
{include file="/public/column" /}
{/block} +{block name="content"} +
+
+
+
+ {//标题} +

{$article.title} +
+

+ {//图标} +
+ {:cookie('think_lang') == 'en-us' ? $article.cate.ename : $article.cate.catename} + {if ($article.is_top == 1)}{:lang('top')}{/if} + {if ($article.is_hot == 1)}{:lang('hot')}{/if} + + + {$comments->count()}{$pv} + +
+ {//作者} + +
{$article.content|raw}
+ {//管理} + {if (($article.upzip !== '') || session('?user_name'))} +
+ {notempty name="$article.upzip"} + + {/notempty} +
+ {if ($user.auth ?? '')} + + {if($article.is_top == 0)} + {else /}{:lang('cancel topping')}{/if} + {if($article.is_hot == 0)} + + {else /} + {:lang('cancel hoting')} + {/if} + {if($article.is_reply == 1)} + + {else /} + {:lang('enable reply')} + {/if} + {:lang('title color')} + {/if} + {if(session('user_name')==$article.user.name || ($user.auth ?? ''))} + {:lang('edit')} + {/if} +
+
+ {/if} +
+ {//评论} +
+ 评论 {$comments->count()} + +
{$comments|raw}
+ {if condition="$article.is_reply == 1"} +
+
+ +
+ +
+
+
+ + + +
+
+ {else /} +
本帖已设置禁止回复
+ {/if} +
+
+
+
+
{:lang('sponsor')}- + {:lang('i want to join')} +
+
+ {volist name="ad_comm" id="vo"} + {$vo.slid_name} + {/volist} +
+
+
+
{:lang('hot post list')}
+ {volist name="artHot" id="vo"} +
+ {$vo.title} + {$vo.comments_count} +
+ {/volist} +
+
+ {volist name="ad_art" id="vo"} + + {/volist} +
+
+
+ +
+
+
+
+{include file="public/menu" /} +{/block} +{block name="script"} + +{/block} \ No newline at end of file diff --git a/view/taoler/index/article/edit.html b/view/taoler/index/article/edit.html index 9bb2f86..6deb53e 100644 --- a/view/taoler/index/article/edit.html +++ b/view/taoler/index/article/edit.html @@ -73,7 +73,7 @@
- +
diff --git a/view/taoler/index/article/posts/detail.html b/view/taoler/index/article/posts/detail.html index e268920..13a9b79 100644 --- a/view/taoler/index/article/posts/detail.html +++ b/view/taoler/index/article/posts/detail.html @@ -11,9 +11,8 @@
{//标题} -

{$article.title} -
-

+

{$article.title}

+
{//图标}
{:cookie('think_lang') == 'en-us' ? $article.cate.ename : $article.cate.catename} @@ -43,7 +42,7 @@
-
{$article.content}
+
{$article.content}
{//管理} {if (($article.upzip !== '') || session('?user_name'))}
@@ -280,7 +279,11 @@ layui.use(['fly', 'face','colorpicker','plyr'], function(){ plyr.setup(); }); + +{:hook('markdownhook')} + + + {/block} \ No newline at end of file diff --git a/view/taoler/index/article/posts/detail.html- b/view/taoler/index/article/posts/detail.html- new file mode 100644 index 0000000..459e790 --- /dev/null +++ b/view/taoler/index/article/posts/detail.html- @@ -0,0 +1,315 @@ +{extend name="public/base" /} + +{block name="title"}{$article.title}-{$sysInfo.webname}{/block} +{block name="keywords"}{$article.title},{$article.tags}{/block} +{block name="description"}{$article.title},{:getArtContent($article.content)}{/block} +{block name="link"}{/block} +{block name="column"}
{include file="/public/column" /}
{/block} +{block name="content"} +
+
+
+
+ {//标题} +

{$article.title} +
+

+ {//图标} +
+ {:cookie('think_lang') == 'en-us' ? $article.cate.ename : $article.cate.catename} + {if ($article.is_top == 1)}{:lang('top')}{/if} + {if ($article.is_hot == 1)}{:lang('hot')}{/if} + + + {$comments->count()}{$pv} + +
+ {//作者} + +
{$article.content|raw}
+ {//管理} + {if (($article.upzip !== '') || (session('user_id')==$article.user_id) OR ($user.auth ?? ''))} +
+ {notempty name="$article.upzip"} + + {/notempty} +
+ {if ($user.auth ?? '')} + + {if($article.is_top == 0)} + {else /}{:lang('cancel topping')}{/if} + {if($article.is_hot == 0)} + + {else /} + {:lang('cancel hoting')} + {/if} + {if($article.is_reply == 1)} + + {else /} + {:lang('enable reply')} + {/if} + {:lang('title color')} + {/if} + {if(session('user_name')==$article.user.name || ($user.auth ?? ''))} + {:lang('edit')} + {/if} +
+
+ {/if} +
+ {//评论} +
+ 评论 {$comments->count()} + +
{$comments|raw}
+ {if condition="$article.is_reply == 1"} +
+
+ +
+ +
+
+
+ + + +
+
+ {else /} +
本帖已设置禁止回复
+ {/if} +
+
+
+
+
{:lang('sponsor')}- + {:lang('i want to join')} +
+
+ {volist name="ad_comm" id="vo"} + {$vo.slid_name} + {/volist} +
+
+
+
{:lang('hot post list')}
+ {volist name="artHot" id="vo"} +
+ {$vo.title} + {$vo.comments_count} +
+ {/volist} +
+
+ {volist name="ad_art" id="vo"} + + {/volist} +
+
+
+ +
+
+
+
+{include file="public/menu" /} +{/block} +{block name="script"} + +{/block} \ No newline at end of file diff --git a/view/taoler/index/error/404.html b/view/taoler/index/error/404.html new file mode 100644 index 0000000..458c228 --- /dev/null +++ b/view/taoler/index/error/404.html @@ -0,0 +1,46 @@ +{extend name="public/base" /} + +{block name="title"}404 - {$sysInfo.webname}{/block} +{block name="keywords"}{$sysInfo.keywords}{/block} +{block name="description"}{$sysInfo.descript}{/block} +{block name="column"}{include file="public/column" /}{/block} +{block name="content"} +
+
+
+

+

页面或者数据被 纸飞机 运到火星了,啥都看不到了…

+
+
+
+{/block} + +{block name="script"} + +{/block} + + + + + + + + + + + diff --git a/view/taoler/index/index/index.html b/view/taoler/index/index/index.html index 86deb69..932222f 100644 --- a/view/taoler/index/index/index.html +++ b/view/taoler/index/index/index.html @@ -41,11 +41,8 @@
- - - + {:hook('signhook', ['id'=>1])} +

{:lang('links list')}

diff --git a/view/taoler/index/login/login.html b/view/taoler/index/login/login.html index 435f800..63fa02c 100644 --- a/view/taoler/index/login/login.html +++ b/view/taoler/index/login/login.html @@ -44,11 +44,7 @@ {:lang('forget password')}?
- + {:hook('socialhook')}
diff --git a/view/taoler/index/public/.gitignore b/view/taoler/index/public/.gitignore new file mode 100644 index 0000000..28f97bf --- /dev/null +++ b/view/taoler/index/public/.gitignore @@ -0,0 +1 @@ +user-nav.html \ No newline at end of file diff --git a/view/taoler/index/public/footer.html b/view/taoler/index/public/footer.html index 2b63d81..b6fbb86 100644 --- a/view/taoler/index/public/footer.html +++ b/view/taoler/index/public/footer.html @@ -1,5 +1,5 @@ -