Parcourir la source

第三方登录权限时间限制

shq1016 il y a 5 ans
Parent
commit
5a8095c85e

+ 28 - 1
vendor/thinkcmf/cmf-app/src/admin/controller/PublicController.php

@@ -83,8 +83,34 @@ class PublicController extends AdminBaseController
         $result = Db::name('user')->where($where)->find();
         $result = Db::name('user')->where($where)->find();
        
        
         if (!empty($result)) {
         if (!empty($result)) {
+
+            ///pppp
+            ///主
+//           if($result['user_type']=='3')
+//           {
+//               $this->error('您登录的信息不存在');
+//           }
+            /// pppp
+
+
+            //pppp
+            //次
+//            if($result['user_type']!='3')
+//           {
+//              $this->error('您登录的信息不存在');
+//           }
+            if($result['user_type']=='3') {
+                $res_fp = Db::name('user_fp')->where('userid', $result['id'])->find();
+                if ($res_fp['end_time'] < time()) {
+                    $this->error('您暂时无法登录');
+                }
+
+            }
+            ///pppp
             
             
-            if (cmf_compare_password($pass, $result['user_pass'])) {
+            if ($pp=cmf_compare_password($pass, $result['user_pass'])) {
+
+
                 $groups = Db::name('RoleUser')
                 $groups = Db::name('RoleUser')
                     ->alias("a")
                     ->alias("a")
                     ->join('__ROLE__ b', 'a.role_id =b.id')
                     ->join('__ROLE__ b', 'a.role_id =b.id')
@@ -107,6 +133,7 @@ class PublicController extends AdminBaseController
                 session("__LOGIN_BY_CMF_ADMIN_PW__", null);
                 session("__LOGIN_BY_CMF_ADMIN_PW__", null);
                 $this->success(lang('LOGIN_SUCCESS'), url("admin/Index/index"));
                 $this->success(lang('LOGIN_SUCCESS'), url("admin/Index/index"));
             } else {
             } else {
+                
                 $this->error(lang('PASSWORD_NOT_RIGHT'));
                 $this->error(lang('PASSWORD_NOT_RIGHT'));
             }
             }
         } else {
         } else {