From 5a03b6f6f2eb7ad3e2438035f9e70f1ab4277016 Mon Sep 17 00:00:00 2001 From: INOPIAE Date: Wed, 22 Jul 2015 21:37:16 +0200 Subject: [PATCH 1/2] bug 1391: removed insert of administrative increase entry for normal assurance --- manager/application/models/User.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/manager/application/models/User.php b/manager/application/models/User.php index 1e785f1..3085123 100644 --- a/manager/application/models/User.php +++ b/manager/application/models/User.php @@ -297,18 +297,6 @@ class Default_Model_User { $this->db->insert('notary', $assurance); $assuree->points += $rounddown; $assuree->fixAssurerFlag(); - - if ($this->getPoints() < 150) { - $addpoints = 0; - if ($this->getPoints() < 149 && $this->getPoints() >= 100) { - $addpoints = 2; - } elseif ($this->getPoints() === 149) { - $addpoints = 1; - } - - $this->adminIncrease($addpoints, $location, $date); - } - return $rounddown; } From 1c5bceeae7f572a975ed7c2c17fa4cffce4718a6 Mon Sep 17 00:00:00 2001 From: INOPIAE Date: Wed, 22 Jul 2015 21:40:31 +0200 Subject: [PATCH 2/2] bug 1391: adjusted query so that only the non administrative increase assurance are taken for the point calculation --- manager/application/models/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/application/models/User.php b/manager/application/models/User.php index 3085123..443dac5 100644 --- a/manager/application/models/User.php +++ b/manager/application/models/User.php @@ -108,8 +108,8 @@ class Default_Model_User { * user's points */ public function refreshPoints() { - $query = 'select sum(`points`) as `total` from `notary` '. - 'where `to` = :user'; + $query = "select sum(`points`) as `total` from `notary` " . + "where `to` = :user and method != 'Administrative Increase' and from != to"; $query_params['user'] = $this->id; $row = $this->db->query($query, $query_params)->fetch(); if ($row['total'] === null) $row['total'] = 0;