bug 1221: Rename function to better reflect its use
authorMichael Tänzer <neo@nhng.de>
Mon, 21 Apr 2014 22:08:09 +0000 (00:08 +0200)
committerMichael Tänzer <neo@nhng.de>
Mon, 21 Apr 2014 22:08:09 +0000 (00:08 +0200)
Signed-off-by: Michael Tänzer <neo@nhng.de>
includes/notary.inc.php

index 42f5e5c..a8ec208 100644 (file)
        }
 
 
-       function calc_points($row)
+       /**
+        * Calculate awarded points (corrects some issues like out of range points
+        * or points that were issued by means that have been deprecated)
+        *
+        * @param array $row - associative array containing the data from the
+        *     `notary` table
+        * @return int - the awarded points for this assurance
+        */
+       function calc_awarded($row)
        {
                $awarded = intval($row['awarded']);
                if (intval($row['points']) < $awarded)
 
        function calc_assurances ($row,&$points,&$experience,&$sumexperience,&$awarded,&$revoked)
        {
-               $awarded = calc_points($row);
+               $awarded = calc_awarded($row);
                $revoked = false;
 
                if ($awarded > 100)
                $res = get_received_assurances_summary($userid);
                while($row = mysql_fetch_assoc($res))
                {
-                       $points = calc_points ($row);
+                       $points = calc_awarded($row);
 
                        if ($points > $max_points)                      // limit to 100 points, above is experience (needs to be fixed)
                        {