bug-1055: fix points calculation in includes/lib/account.php
authorFelix Dörre <felix@dogcraft.de>
Tue, 7 Apr 2015 20:12:23 +0000 (22:12 +0200)
committerBenny Baumann <BenBE@geshi.org>
Wed, 29 Apr 2015 18:40:05 +0000 (20:40 +0200)
includes/lib/account.php

index dd8afd3..9e795c8 100644 (file)
@@ -48,8 +48,9 @@ function fix_assurer_flag($userID = NULL)
                                        AND `cp`.`user_id` = `u`.`id`
                        )
                        AND (
-                               SELECT SUM(`points`) FROM `notary` AS `n`
+                               SELECT SUM(`awarded`) FROM `notary` AS `n`
                                WHERE `n`.`to` = `u`.`id`
+                                        AND `n`.`method` != 'Administrative Increase' AND `n`.`from` != `n`.`to`
                                        AND (`n`.`expire` > now()
                                             OR `n`.`expire` IS NULL)
                                        AND `n`.`deleted` = 0
@@ -81,8 +82,9 @@ function fix_assurer_flag($userID = NULL)
                                                AND `cp`.`user_id` = `u`.`id`
                                )
                                OR (
-                                       SELECT SUM(`points`) FROM `notary` AS `n`
+                                       SELECT SUM(`awarded`) FROM `notary` AS `n`
                                        WHERE `n`.`to` = `u`.`id`
+                                               AND `n`.`method` != 'Administrative Increase' AND `n`.`from` != `n`.`to`
                                                AND (
                                                        `n`.`expire` > now()
                                                        OR `n`.`expire` IS NULL