diff options
author | Michael Tänzer <neo@nhng.de> | 2014-04-22 00:08:09 +0200 |
---|---|---|
committer | Michael Tänzer <neo@nhng.de> | 2014-04-22 00:08:09 +0200 |
commit | a5876e5a860e0e855b5e8a0e3895af7d8b891224 (patch) | |
tree | 140df60a72ecabc725a709eb187c33a2c6964fb2 | |
parent | 2982bea5f3d3427463627d37dbcc0415480ed1a8 (diff) | |
download | cacert-devel-a5876e5a860e0e855b5e8a0e3895af7d8b891224.tar.gz cacert-devel-a5876e5a860e0e855b5e8a0e3895af7d8b891224.tar.xz cacert-devel-a5876e5a860e0e855b5e8a0e3895af7d8b891224.zip |
bug 1221: Rename function to better reflect its use
Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r-- | includes/notary.inc.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php index 42f5e5c..a8ec208 100644 --- a/includes/notary.inc.php +++ b/includes/notary.inc.php @@ -114,7 +114,15 @@ } - 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) @@ -164,7 +172,7 @@ function calc_assurances ($row,&$points,&$experience,&$sumexperience,&$awarded,&$revoked) { - $awarded = calc_points($row); + $awarded = calc_awarded($row); $revoked = false; if ($awarded > 100) @@ -486,7 +494,7 @@ $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) { |