From d178200fb9d414be57e94f1e9f8fc172a37a0da3 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 28 Mar 2022 16:39:58 +0800 Subject: [PATCH 1/3] * Fix bug #11655 and add repo create check. --- module/repo/model.php | 6 ++++++ module/user/model.php | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/module/repo/model.php b/module/repo/model.php index 2b2389db14..bb0b28c688 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -1151,6 +1151,12 @@ class repoModel extends model if(!$this->config->features->checkClient) return true; if(!$this->post->client) return true; + if(strpos($this->post->client, ' ')) + { + dao::$errors['client'] = $this->lang->repo->error->clientPath; + return false; + } + $clientVersionFile = $this->session->clientVersionFile; if(empty($clientVersionFile)) { diff --git a/module/user/model.php b/module/user/model.php index 4ad6e0849c..9a3dc09e03 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -1269,7 +1269,7 @@ class userModel extends model $sessionFails = (int)$this->session->loginFails; $sessionFails += 1; $this->session->set('loginFails', $sessionFails); - if($sessionFails >= $this->config->user->failTimes) $this->session->set('loginLocked', date('Y-m-d H:i:s')); + if($sessionFails >= $this->config->user->failTimes) $this->session->set("{$account}.loginLocked", date('Y-m-d H:i:s')); $user = $this->dao->select('fails')->from(TABLE_USER)->where('account')->eq($account)->fetch(); if(empty($user)) return 0; @@ -1300,7 +1300,6 @@ class userModel extends model */ public function checkLocked($account) { - if($this->session->loginLocked and (time() - strtotime($this->session->loginLocked)) <= $this->config->user->lockMinutes * 60) return true; $user = $this->dao->select('locked')->from(TABLE_USER)->where('account')->eq($account)->fetch(); if(empty($user)) return false; @@ -1321,7 +1320,7 @@ class userModel extends model $this->dao->update(TABLE_USER)->set('fails')->eq(0)->set('locked')->eq('0000-00-00 00:00:00')->where('account')->eq($account)->exec(); unset($_SESSION['loginFails']); - unset($_SESSION['loginLocked']); + unset($_SESSION["{$account}.loginLocked"]); } /** From 3883bc56dc974ca08b6c99c00641f5ced215d066 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 28 Mar 2022 16:44:07 +0800 Subject: [PATCH 2/3] * Adjust code. --- module/user/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/user/model.php b/module/user/model.php index 9a3dc09e03..69c1da87ee 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -1300,6 +1300,7 @@ class userModel extends model */ public function checkLocked($account) { + if($this->session->{"{$account}.loginLocked"} and (time() - strtotime($this->session->{"{$account}.loginLocked"})) <= $this->config->user->lockMinutes * 60) return true; $user = $this->dao->select('locked')->from(TABLE_USER)->where('account')->eq($account)->fetch(); if(empty($user)) return false; From 589dbaff704a49666663077d279e8babd4fed72f Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 28 Mar 2022 17:25:36 +0800 Subject: [PATCH 3/3] * Fix bug #12791. --- module/product/view/all.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/product/view/all.html.php b/module/product/view/all.html.php index 53eff041ee..1365dd5449 100644 --- a/module/product/view/all.html.php +++ b/module/product/view/all.html.php @@ -195,7 +195,7 @@ createLink('product', 'browse', 'product=' . $product->id), $product->name); + $productLink = html::a($this->createLink('product', 'browse', 'productID=' . $product->id), $product->name); echo "" . $productLink; ?>