bug 1221: Ignore deleted assurances when calculating the cert validity
authorMichael Tänzer <neo@nhng.de>
Fri, 21 Mar 2014 15:30:06 +0000 (16:30 +0100)
committerMichael Tänzer <neo@nhng.de>
Fri, 21 Mar 2014 15:30:06 +0000 (16:30 +0100)
period

Signed-off-by: Michael Tänzer <neo@nhng.de>
CommModule/client.pl
CommModule/usbclient.pl

index bf92b27..1d87adb 100755 (executable)
@@ -441,7 +441,7 @@ sub calculateDays($)
 {
   if($_[0])
   {
-    my @sum = $dbh->selectrow_array("select sum(`points`) as `total` from `notary` where `to`='".$_[0]."' group by `to`");
+    my @sum = $dbh->selectrow_array("select sum(`points`) as `total` from `notary` where `to`='".$_[0]."' and `deleted`=0 group by `to`");
     SysLog("Summe: $sum[0]\n") if($debug);
 
     return ($sum[0]>=50)?730:180;
index 3cbe2c3..6cbc111 100755 (executable)
@@ -425,7 +425,7 @@ sub calculateDays($)
 {
   if($_[0])
   {
-    my @sum = $dbh->selectrow_array("select sum(`points`) as `total` from `notary` where `to`='".$_[0]."' group by `to`");
+    my @sum = $dbh->selectrow_array("select sum(`points`) as `total` from `notary` where `to`='".$_[0]."' and `deleted`=0 group by `to`");
     SysLog("Summe: $sum[0]\n") if($debug);
 
     return ($sum[0]>=50)?730:180;