Browse Source

1,修复发送邮件问题。
2,修复部分语言包显示问题。
3,其他细节。

magicblack 4 years ago
parent
commit
dcbc4fa05a

+ 39 - 35
application/admin/controller/Base.php

@@ -58,43 +58,47 @@ class Base extends All
 
     public function _cache_clear()
     {
-        //播放器配置缓存
-        $vodplayer = config('vodplayer');
-        $voddowner = config('voddowner');
-        $vodserver = config('vodserver');
-        $player = [];
-        foreach($vodplayer as  $k=>$v){
-            $player[$k] = [
-                'show'=>(string)$v['show'],
-                'des'=>(string)$v['des'],
-                'ps'=>(string)$v['ps'],
-                'parse'=>(string)$v['parse'],
-            ];
-        }
-        $downer = [];
-        foreach($voddowner as  $k=>$v){
-            $downer[$k] = [
-                'show'=>(string)$v['show'],
-                'des'=>(string)$v['des'],
-                'ps'=>(string)$v['ps'],
-                'parse'=>(string)$v['parse'],
-            ];
-        }
+        if(ENTRANCE=='admin') {
+            //播放器配置缓存
+            $vodplayer = config('vodplayer');
+            $voddowner = config('voddowner');
+            $vodserver = config('vodserver');
+            $player = [];
+            foreach ($vodplayer as $k => $v) {
+                $player[$k] = [
+                    'show' => (string)$v['show'],
+                    'des' => (string)$v['des'],
+                    'ps' => (string)$v['ps'],
+                    'parse' => (string)$v['parse'],
+                ];
+            }
+            $downer = [];
+            foreach ($voddowner as $k => $v) {
+                $downer[$k] = [
+                    'show' => (string)$v['show'],
+                    'des' => (string)$v['des'],
+                    'ps' => (string)$v['ps'],
+                    'parse' => (string)$v['parse'],
+                ];
+            }
 
-        $server = [];
-        foreach($vodserver as  $k=>$v){
-            $server[$k] = [
-                'show'=>(string)$v['show'],
-                'des'=>(string)$v['des']
-            ];
+            $server = [];
+            foreach ($vodserver as $k => $v) {
+                $server[$k] = [
+                    'show' => (string)$v['show'],
+                    'des' => (string)$v['des']
+                ];
+            }
+            $content = 'MacPlayerConfig.player_list=' . json_encode($player) . ',MacPlayerConfig.downer_list=' . json_encode($downer) . ',MacPlayerConfig.server_list=' . json_encode($server) . ';';
+            $path = './static/js/playerconfig.js';
+            if (!file_exists($path)) {
+                $path .= '.bak';
+            }
+            $fc = @file_get_contents($path);
+            $jsb = mac_get_body($fc, '//缓存开始', '//缓存结束');
+            $fc = str_replace($jsb, "\r\n" . $content . "\r\n", $fc);
+            @fwrite(fopen('./static/js/playerconfig.js', 'wb'), $fc);
         }
-        $content = 'MacPlayerConfig.player_list='.json_encode($player) . ',MacPlayerConfig.downer_list='.json_encode($downer) . ',MacPlayerConfig.server_list='.json_encode($server) .';';
-        $path = './static/js/playerconfig.js';
-        if(!file_exists($path)){ $path .= '.bak'; }
-        $fc = @file_get_contents( $path );
-        $jsb = mac_get_body($fc,'//缓存开始','//缓存结束');
-        $fc = str_replace($jsb,"\r\n".$content."\r\n",$fc);
-        @fwrite(fopen('./static/js/playerconfig.js','wb'),$fc);
 
         Dir::delDir(RUNTIME_PATH.'cache/');
         Dir::delDir(RUNTIME_PATH.'log/');

+ 15 - 6
application/admin/controller/System.php

@@ -12,15 +12,24 @@ class System extends Base
     {
         $post = input();
         $conf = [
-            'host' => $post['host'],
-            'username' => $post['username'],
-            'password' => $post['password'],
-            'port' => $post['port'],
             'nick' => $post['nick'],
-            'test' => $post['test'],
         ];
+        $type = strtolower($post['type']);
+        $to = $post['test'];
+        $conf['host'] = $GLOBALS['config']['email'][$type]['host'];
+        $conf['port'] = $GLOBALS['config']['email'][$type]['port'];
+        $conf['username'] = $GLOBALS['config']['email'][$type]['username'];
+        $conf['password'] = $GLOBALS['config']['email'][$type]['password'];
+        $conf['secure'] = $GLOBALS['config']['email'][$type]['secure'];
         $this->label_maccms();
-        $res = mac_send_mail($conf['test'], $GLOBALS['config']['email']['tpl']['test_title'], $GLOBALS['config']['email']['tpl']['test_body'], $conf);
+
+        $title = $GLOBALS['config']['email']['tpl']['test_title'];
+        $msg = $GLOBALS['config']['email']['tpl']['test_body'];
+        $code = mac_get_rndstr(6,'num');
+        View::instance()->assign(['code'=>$code,'time'=>$GLOBALS['config']['email']['time']]);
+        $title =  View::instance()->display($title);
+        $msg =  View::instance()->display($msg);
+        $res = mac_send_mail($to, $title, $msg, $conf);
         if ($res['code']==1) {
             return json(['code' => 1, 'msg' => lang('test_ok')]);
         }

+ 17 - 7
application/admin/view/addon/config.html

@@ -1,6 +1,6 @@
 {include file="../../../application/admin/view/public/head" /}
 <div class="page-container p10">
-    <div class="showpic" style="display:none;"><img class="showpic_img" width="120" height="160" referrerPolicy="no-referrer"></div>
+    <div class="showpic" style="display:none;"><img class="showpic_img" width="120" height="160"></div>
 
     <form class="layui-form layui-form-pane" method="post" action="">
         <input id="admin_id" name="name" type="hidden" value="{$info.name}">
@@ -20,12 +20,22 @@
                 </div>
                 {/case}
                 {case array}
-                    {foreach name="item.value" item="vo" }
-
-            <div class="layui-input-inline w700 ">
-                {$key}:<input type="text" name="row[{$item.name}][{$key}]" value="{$vo}" class="layui-input w500"  />
-            </div>
-                {/foreach}
+                  <!-- 数组类型标签开始 -->
+                  <div class="layui-input-inline w700 ">
+                     <div style="padding-left: 10px;">
+                        {foreach name="item.value" item="vo" }
+                           <div class=" w700 ">
+                              <div class="layui-form-item">
+                                 <label class="layui-form-label">{$key}:</label>
+                                 <div class="layui-input-block">
+                                    <input type="text" name="row[{$item.name}][{$key}]" value="{$vo}" class="layui-input w500"  />
+                                 </div>
+                              </div>
+                           </div>
+                        {/foreach}
+                     </div>
+                  </div>
+                  <!-- 数组类型标签结束 -->
 
                 {/case}
                 {case datetime}

+ 2 - 5
application/admin/view/system/configemail.html

@@ -135,19 +135,16 @@
 
     });
     function test_email() {
-        var host = $("#host").val();
-        var username = $("#username").val();
-        var password = $("#password").val();
+        var type = $('#ac').val();
         var test = $("#test").val();
         var nick = $("#nick").val();
-        var port = $('#port').val();
 
         layer.msg("{:lang('wait_submit')}",{time:500000});
         $.ajax({
             url: "{:url('system/test_email')}",
             type: "post",
             dataType: "json",
-            data: {host:host,username:username,password:password,port:port,nick:nick,test:test},
+            data: {type:type,nick:nick,test:test},
             beforeSend: function () {
             },
             error:function(r){

+ 1 - 1
application/admin/view/urlsend/index.html

@@ -27,7 +27,7 @@
 
     <form class="layui-form layui-form-pane" method="post" action="" target="_blank" id="form_post">
         <blockquote class="layui-elem-quote">
-            {:lang('admin/urlsend/tip2')}
+            {:lang('admin/urlsend/tip2')}{$GLOBALS['http_type'].$GLOBALS['config']['site']['site_url']}<br>
         </blockquote>
 
         <div class="layui-form-item">

+ 4 - 10
application/common.php

@@ -401,14 +401,6 @@ function mac_send_mail($to,$title,$body,$conf=[])
         return ['code'=>997,'msg'=>lang('body_not_empty')];
     }
 
-    View::instance()->assign(['time'=>$GLOBALS['config']['email']['time']]);
-    $title =  View::instance()->display($title);
-    $body =  View::instance()->display($body);
-
-    if(!empty($conf)){
-        $config = $conf;
-    }
-
     $cp = 'app\\common\\extend\\email\\' . ucfirst($GLOBALS['config']['email']['type']);
     if (class_exists($cp)) {
         $c = new $cp;
@@ -1483,9 +1475,11 @@ function mac_url_content_img($content)
 
 function mac_alphaID($in, $to_num=false, $pad_up=false, $passKey='')
 {
-    $key = 'abcdefghijklmnopqrstuvwxyz0123456789';
-    $i = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9');
+    $key = 'abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
     if (!empty($passKey)) {
+        for ($n = 0; $n<strlen($key); $n++) {
+            $i[] = substr($key,$n ,1);
+        }
         $len = strlen($key);
         $passhash = hash('sha256',$passKey);
         $passhash = (strlen($passhash) < $len)

+ 5 - 5
application/common/extend/email/Phpmailer.php

@@ -10,19 +10,19 @@ class Phpmailer {
     {
         if(empty($config)) {
             $config = $GLOBALS['config']['email']['phpmailer'];
+            $config['nick'] =  $GLOBALS['config']['email']['nick'];
         }
-
         $mail = new \phpmailer\src\PHPMailer();
         //$mail->SMTPDebug = 2;
         $mail->isSMTP();
+        $mail->SMTPAuth = true;
         $mail->CharSet = "UTF-8";
         $mail->Host = $config['host'];
-        $mail->SMTPAuth = true;
-        $mail->Username = $config['username'];
-        $mail->Password = $config['password'];
         $mail->SMTPSecure = $config['secure'];
         $mail->Port = $config['port'];
-        $mail->setFrom(  $config['username'] , $config['nick'] );
+        $mail->Username = $config['username'];
+        $mail->Password = $config['password'];
+        $mail->setFrom($config['username'] , $config['nick']);
         $mail->addAddress($to);
         $mail->isHTML(true);
         $mail->Subject = $title;

+ 7 - 6
application/common/model/Cash.php

@@ -62,9 +62,10 @@ class Cash extends Base {
         return ['code'=>1,'msg'=>lang('obtain_ok'),'info'=>$info];
     }
 
-    public function saveData($data)
+    public function saveData($param)
     {
-        $data['cash_money']  = floatval($data['cash_money']);
+        $data=[];
+        $data['cash_money']  = floatval($param['cash_money']);
 
         if($GLOBALS['config']['user']['cash_status'] !='1'){
             return ['code'=>1005,'msg'=>lang('model/cash/not_open')];
@@ -78,10 +79,10 @@ class Cash extends Base {
         if($tx_points > $GLOBALS['user']['user_points']){
             return ['code'=>1007,'msg'=>lang('model/cash/mush_money_err')];
         }
-
-        $data['cash_bank_name'] = htmlspecialchars(urldecode(trim($data['cash_bank_name'])));
-        $data['cash_bank_no'] = htmlspecialchars(urldecode(trim($data['cash_bank_no'])));
-        $data['cash_payee_name'] = htmlspecialchars(urldecode(trim($data['cash_payee_name'])));
+        $data['user_id'] = $GLOBALS['user']['user_id'];
+        $data['cash_bank_name'] = htmlspecialchars(urldecode(trim($param['cash_bank_name'])));
+        $data['cash_bank_no'] = htmlspecialchars(urldecode(trim($param['cash_bank_no'])));
+        $data['cash_payee_name'] = htmlspecialchars(urldecode(trim($param['cash_payee_name'])));
         $data['cash_points'] = $tx_points;
         $data['cash_time'] = time();
 

+ 2 - 1
application/common/model/User.php

@@ -666,7 +666,8 @@ class User extends Base
         if($param['ac']=='email'){
             $title = $GLOBALS['config']['email']['tpl']['user_'.$type_flag.'_title'];
             $msg = $GLOBALS['config']['email']['tpl']['user_'.$type_flag.'_body'];
-            View::instance()->assign(['code'=>$code]);
+            View::instance()->assign(['code'=>$code,'time'=>$GLOBALS['config']['email']['time']]);
+            $title =  View::instance()->display($title);
             $msg =  View::instance()->display($msg);
             $res_send = mac_send_mail($to, $title, $msg);
             $res_code = $res_send['code'];

+ 1 - 1
application/extra/version.php

@@ -3,7 +3,7 @@ return array (
     'name' => '苹果CMS内容管理系统',
     'copyright' => 'MacCMS',
     'url' => '//github.com/magicblack',
-    'code' => '2020.1000.1058',
+    'code' => '2020.1000.1059',
     'license' => '免费版',
 );
 ?>

+ 6 - 6
application/lang/zh-cn.php

@@ -5,10 +5,9 @@
 *模块key:开头  admin/ 、 install/ 、只在模块内使用
 *后台菜单key:开头menu/
 *内部处理key:开头 model/、controller/、只在模块内使用
-*last update 0917
 */
 return [
-    'lang_ver'=>'1055+',
+    'lang_ver'=>'1059+',
     'hello'  => '欢迎使用',
     'maccms_name'=>'苹果CMS-v10',
     'maccms_copyright'=>'© MacCMS All Rights Reserved.',
@@ -1033,7 +1032,7 @@ return [
 
     'admin/system/configemail/title'=>'邮件发送配置',
     'admin/system/configemail/tip'=>'提示信息:<br>
-                        修改后请先点击保存然后再测试发送。内容支持{literal}{$maccms.***}标签,  {$user.***}标签, {$code}验证码, {$time}有效时间{/literal}。',
+                        修改后请先点击保存然后再测试发送。内容支持{$maccms.***}标签,  {$user.***}标签, {$code}验证码, {$time}有效时间。',
     'admin/system/configemail/type'=>'发送方式',
     'admin/system/configemail/time'=>'有效期限',
     'admin/system/configemail/time_tip'=>'邮件验证码多少分钟后失效',
@@ -1426,6 +1425,7 @@ return [
     'admin/vod/select_copyright'=>'选择版权',
     'admin/vod/is_end'=>'已完结',
     'admin/vod/no_end'=>'未完结',
+    'admin/vod/del_player'=>'删播放组',
     'admin/vod/del_downer'=>'删下载组',
     'admin/vod/episode_plot'=>'分集剧情',
     'admin/vod/plot'=>'分集剧情',
@@ -1807,9 +1807,9 @@ return [
     'admin/urlsend/no_data'=>'没有获取到数据',
     'admin/urlsend/tip'=>'共%s条数据等待推送,分%s页推送,当前第%s页',
     'admin/urlsend/complete'=>'数据推送完毕',
-    'admin/urlsend/tip2'=>'断点会记录在缓存中,更新缓存后断点将消失。
-            当前站点配置域名:{$GLOBALS[\'http_type\'].$GLOBALS[\'config\'][\'site\'][\'site_url\']}<br>
-            开始推送之前请先填写好上面的所需配置项。',
+    'admin/urlsend/tip2'=>'断点会记录在缓存中,更新缓存后断点将消失。<br>
+            开始推送之前请先填写好上面的所需配置项。<br>
+            当前站点配置域名:',
     'admin/urlsend/send_genre'=>'推送类型',
     'admin/urlsend/page_send_num'=>'每页推送数',
     'admin/urlsend/start_page'=>'起始页码',

+ 6 - 6
application/lang/zh-tw.php

@@ -5,10 +5,9 @@
 *模塊key:開頭  admin/ 、 install/ 、只在模塊內使用
 *後臺菜單key:開頭menu/
 *內部處理key:開頭 model/、controller/、只在模塊內使用
-*last update 0917
 */
 return [
-    'lang_ver'=>'1055+',
+    'lang_ver'=>'1059+',
     'hello'  => '歡迎使用',
     'maccms_name'=>'蘋果CMS-v10',
     'maccms_copyright'=>'© MacCMS All Rights Reserved.',
@@ -1033,7 +1032,7 @@ return [
 
     'admin/system/configemail/title'=>'郵件發送配置',
     'admin/system/configemail/tip'=>'提示信息:<br>
-                        修改後請先點擊保存然後再測試發送。內容支持{literal}{$maccms.***}標簽,  {$user.***}標簽, {$code}驗證碼, {$time}有效時間{/literal}。',
+                        修改後請先點擊保存然後再測試發送。內容支持{$maccms.***}標簽,  {$user.***}標簽, {$code}驗證碼, {$time}有效時間。',
     'admin/system/configemail/type'=>'發送方式',
     'admin/system/configemail/time'=>'有效期限',
     'admin/system/configemail/time_tip'=>'郵件驗證碼多少分鐘後失效',
@@ -1426,6 +1425,7 @@ return [
     'admin/vod/select_copyright'=>'選擇版權',
     'admin/vod/is_end'=>'已完結',
     'admin/vod/no_end'=>'未完結',
+    'admin/vod/del_player'=>'刪播放組',
     'admin/vod/del_downer'=>'刪下載組',
     'admin/vod/episode_plot'=>'分集劇情',
     'admin/vod/plot'=>'分集劇情',
@@ -1807,9 +1807,9 @@ return [
     'admin/urlsend/no_data'=>'沒有獲取到數據',
     'admin/urlsend/tip'=>'共%s條數據等待推送,分%s頁推送,當前第%s頁',
     'admin/urlsend/complete'=>'數據推送完畢',
-    'admin/urlsend/tip2'=>'斷點會記錄在緩存中,更新緩存後斷點將消失。
-            當前站點配置域名:{$GLOBALS[\'http_type\'].$GLOBALS[\'config\'][\'site\'][\'site_url\']}<br>
-            開始推送之前請先填寫好上面的所需配置項。',
+    'admin/urlsend/tip2'=>'斷點會記錄在緩存中,更新緩存後斷點將消失。<br>
+            開始推送之前請先填寫好上面的所需配置項。<br>
+            當前站點配置域名:',
     'admin/urlsend/send_genre'=>'推送類型',
     'admin/urlsend/page_send_num'=>'每頁推送數',
     'admin/urlsend/start_page'=>'起始頁碼',