summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2013-09-11 00:20:54 +0200
committerMichael Tänzer <neo@nhng.de>2013-09-11 00:20:54 +0200
commite3a3015cf550207a4267462d2362f3f89bb63a11 (patch)
tree148d0739474112d36ea6a30d5f6914c3e90348d0
parent20163e4ce613dd0da91b11fb962a5bba31e84a67 (diff)
downloadcacert-devel-e3a3015cf550207a4267462d2362f3f89bb63a11.tar.gz
cacert-devel-e3a3015cf550207a4267462d2362f3f89bb63a11.tar.xz
cacert-devel-e3a3015cf550207a4267462d2362f3f89bb63a11.zip
Bug 1065: use a more readable name for $drow['total']
Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r--www/wot.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/www/wot.php b/www/wot.php
index cc70d06..e6fde89 100644
--- a/www/wot.php
+++ b/www/wot.php
@@ -259,13 +259,14 @@ $iecho= "c";
$query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['_config']['notarise']['id']."' group by `to`";
$res = mysql_query($query);
$drow = mysql_fetch_assoc($res);
+ $oldpoints = intval($drow['total']);
$_POST['expire'] = 0;
- if(($drow['total'] + $newpoints) > 100 && $max < 100)
- $newpoints = 100 - $drow['total'];
- if(($drow['total'] + $newpoints) > $max && $max >= 100)
- $newpoints = $max - $drow['total'];
+ if(($oldpoints + $newpoints) > 100 && $max < 100)
+ $newpoints = 100 - $oldpoints;
+ if(($oldpoints + $newpoints) > $max && $max >= 100)
+ $newpoints = $max - $oldpoints;
if($newpoints < 0)
$newpoints = 0;
@@ -331,16 +332,16 @@ $iecho= "c";
$assurer = $_SESSION['profile']['fname'].' '.$_SESSION['profile']['lname'];
$body = sprintf(_("You are receiving this email because you have been assured by %s (%s)."), $assurer, $_SESSION['profile']['email'])."\n\n";
if($_POST['points'] != $newpoints)
- $body .= sprintf(_("You were issued %s points however the system only counts up to 100 assurance points. You now have 100 countable assurance points and %s countable expierence points."), $_POST['points'], ($newpoints + $drow['total']-100))."\n\n";
+ $body .= sprintf(_("You were issued %s points however the system only counts up to 100 assurance points. You now have 100 countable assurance points and %s countable expierence points."), $_POST['points'], ($newpoints + $oldpoints-100))."\n\n";
else
- $body .= sprintf(_("You were issued %s points and you now have %s points in total."), $newpoints, ($newpoints + $drow['total']))."\n\n";
+ $body .= sprintf(_("You were issued %s points and you now have %s points in total."), $newpoints, ($newpoints + $oldpoints))."\n\n";
- if(($drow['total'] + $newpoints) < 100 && ($drow['total'] + $newpoints) >= 50)
+ if(($oldpoints + $newpoints) < 100 && ($oldpoints + $newpoints) >= 50)
{
$body .= _("You now have over 50 points, and can now have your name added to client certificates, and issue server certificates for up to 2 years.")."\n\n";
}
- if(($drow['total'] + $newpoints) >= 100 && $newpoints > 0)
+ if(($oldpoints + $newpoints) >= 100 && $newpoints > 0)
{
$body .= _("You have at least 100 Assurance Points. If you want ".
"to become an assurer try the Assurer Challenge").
@@ -368,9 +369,9 @@ $iecho= "c";
$assuree = $_SESSION['_config']['notarise']['fname'].' '.$_SESSION['_config']['notarise']['lname'];
$body = sprintf(_("You are receiving this email because you have assured %s (%s)."), $assuree, $_SESSION['_config']['notarise']['email'])."\n\n";
if($_POST['points'] != $newpoints)
- $body .= sprintf(_("You issued %s points however the system only counts up to 100 assurance points. %s has now 100 countable assurance points and %s countable expierence points."), $_POST['points'], $assuree, ($newpoints + $drow['total']-100))."\n\n";
+ $body .= sprintf(_("You issued %s points however the system only counts up to 100 assurance points. %s has now 100 countable assurance points and %s countable expierence points."), $_POST['points'], $assuree, ($newpoints + $oldpoints-100))."\n\n";
else
- $body .= sprintf(_("You issued %s points and %s now has %s points in total."), $newpoints, $assuree, ($newpoints + $drow['total']))."\n\n";
+ $body .= sprintf(_("You issued %s points and %s now has %s points in total."), $newpoints, $assuree, ($newpoints + $oldpoints))."\n\n";
if($_SESSION['profile']['board'] == 1 && intval($_POST['expire']) > 0)
$body .= sprintf(_("Please Note: this is a temporary increase for %s days only. After that time their points will be reduced to 150 points."), intval($_POST['expire']))."\n\n";