From f97cb26f07258d26bec347ce048d2118ee88b487 Mon Sep 17 00:00:00 2001 From: INOPIAE Date: Fri, 31 Jul 2015 09:12:31 +0200 Subject: [PATCH 1/2] bug 1391: corrected value check --- manager/application/models/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manager/application/models/User.php b/manager/application/models/User.php index 24b27ed..0cb345e 100644 --- a/manager/application/models/User.php +++ b/manager/application/models/User.php @@ -126,7 +126,7 @@ class Default_Model_User { $row = $this->db->query($query, $query_params)->fetch(); if ($row['total'] === null) $row['total'] = 0; - $this->points += ($row['total'] > 25) ? 50 : $row['total']; + $this->points += ($row['total'] > 25) ? 50 : $row['total'] * 2; } From e33a8de01c1548d155bf08d362de241906ef16c3 Mon Sep 17 00:00:00 2001 From: INOPIAE Date: Fri, 31 Jul 2015 09:32:56 +0200 Subject: [PATCH 2/2] bug 1391: Ensure current number of assurer's points used for determining maximum points for an assurance. --- manager/application/models/User.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manager/application/models/User.php b/manager/application/models/User.php index 0cb345e..8f9d3da 100644 --- a/manager/application/models/User.php +++ b/manager/application/models/User.php @@ -162,12 +162,16 @@ class Default_Model_User { '`expire` < now()) >= 100'; $query_params['user'] = $this->id; $this->db->query($query, $query_params); + + $this->refreshPoints(); } /** * @return boolean */ public function getAssurerStatus() { + $this->refreshPoints(); + $query = 'SELECT 1 FROM `users` WHERE `users`.`id` = :user AND '. '`assurer_blocked` = 0 AND '.