summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Dörre <felix@dogcraft.de>2015-04-21 22:45:31 +0200
committerFelix Dörre <felix@dogcraft.de>2015-04-28 09:40:10 +0200
commit5fb63af8c95f8b65dd9345bcefa2b10d0d1cfe7a (patch)
tree2b0416c5c0a28056e8acd930ec00a68f21f22aa4
parent9edbfedb3b84f217c2c16cdf2b7bb5bfb97b0028 (diff)
downloadcacert-devel-5fb63af8c95f8b65dd9345bcefa2b10d0d1cfe7a.tar.gz
cacert-devel-5fb63af8c95f8b65dd9345bcefa2b10d0d1cfe7a.tar.xz
cacert-devel-5fb63af8c95f8b65dd9345bcefa2b10d0d1cfe7a.zip
bug 1050: expunge the old, rounded points from www/wot.php
-rw-r--r--www/wot.php31
1 files changed, 10 insertions, 21 deletions
diff --git a/www/wot.php b/www/wot.php
index 08c6357..79c897a 100644
--- a/www/wot.php
+++ b/www/wot.php
@@ -336,23 +336,14 @@ function send_reminder()
{
$max = maxpoints();
- $awarded = $newpoints = intval($_POST['points']);
- if($newpoints > $max)
- $newpoints = $awarded = $max;
- if($newpoints < 0)
- $newpoints = $awarded = 0;
+ $awarded = intval($_POST['points']);
+ if($awarded > $max)
+ $awarded = $max;
+ if($awarded < 0)
+ $awarded = 0;
$drow_points = get_received_total_points(intval($_SESSION['_config']['notarise']['id']));
- $_POST['expire'] = 0;
-
- if(($drow_points + $newpoints) > 100 && $max < 100)
- $newpoints = 100 - $drow_points;
- if(($drow_points + $newpoints) > $max && $max >= 100)
- $newpoints = $max - $drow_points;
- if($newpoints < 0)
- $newpoints = 0;
-
if(mysql_real_escape_string(stripslashes($_POST['date'])) == "")
$_POST['date'] = date("Y-m-d H:i:s");
@@ -374,7 +365,7 @@ function send_reminder()
{
$query = "insert into `notary` set `from`='".intval($_SESSION['profile']['id'])."',
`to`='".intval($_SESSION['_config']['notarise']['id'])."',
- `points`='".intval($newpoints)."', `awarded`='".intval($awarded)."',
+ `points`='0', `awarded`='".intval($awarded)."',
`location`='".mysql_real_escape_string(stripslashes($_POST['location']))."',
`date`='".mysql_real_escape_string(stripslashes($_POST['date']))."',
`when`=NOW()";
@@ -414,17 +405,15 @@ function send_reminder()
L10n::set_translation($_SESSION['_config']['notarise']['language']);
$body = sprintf(_("You are receiving this email because you have been assured by %s %s (%s)."), $_SESSION['profile']['fname'], $_SESSION['profile']['lname'], $_SESSION['profile']['email'])."\n\n";
- if($_POST['points'] != $newpoints)
- $body .= sprintf(_("You were issued %s points however the system has rounded this down to %s and you now have %s points in total."), $_POST['points'], $newpoints, ($newpoints + $drow['total']))."\n\n";
- else
- $body .= sprintf(_("You were issued %s points and you now have %s points in total."), $newpoints, ($newpoints + $drow['total']))."\n\n";
- if(($drow['total'] + $newpoints) < 100 && ($drow['total'] + $newpoints) >= 50)
+ $body .= sprintf(_("You were issued %s assurance points and you now have %s assurance points in total."), $newpoints, ($newpoints + $drow_total))."\n\n";
+
+ if(($drow_total + $awarded) < 100 && ($drow_total + $awarded) >= 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(($drow_total + $newpoints) >= 100 && $drow_total < 0 && !is_assurer(intval($_SESSION['_config']['notarise']['id'])) )
{
$body .= _("You have at least 100 Assurance Points, if you want to become an assurer try the Assurer Challenge")." ( https://cats.cacert.org )\n\n";
$body .= _("To make it easier for others in your area to find you, it's helpful to list yourself as an assurer (this is voluntary), as well as a physical location where you live or work the most. You can flag your account to be listed, and add a comment to the display by going to:")."\n";