Merge branch 'bug-1042' into testserver-stable
authorBenny Baumann <BenBE@geshi.org>
Tue, 5 May 2015 17:09:30 +0000 (19:09 +0200)
committerBenny Baumann <BenBE@geshi.org>
Tue, 5 May 2015 17:09:30 +0000 (19:09 +0200)
1  2 
CommModule/client.pl
includes/account.php
includes/general.php
includes/notary.inc.php
pages/wot/1.php
pages/wot/9.php
scripts/cron/refresh_stats.php
www/index.php
www/wot.php

@@@ -441,12 -441,12 +441,12 @@@ sub calculateDays($
  {
    if($_[0])
    {
-     my @sum = $dbh->selectrow_array("select sum(`points`) as `total` from `notary` where `to`='".$_[0]."' and `deleted`=0 group by `to`");
+     my @sum = $dbh->selectrow_array("select sum(`awarded`) as `total` from `notary` where `to`='".$_[0]."' and `deleted`=0 AND `notary`.`method` != 'Administrative Increase' AND `notary`.`from` != `notary`.`to` group by `to`");
      SysLog("Summe: $sum[0]\n") if($debug);
  
 -    return ($sum[0]>=50)?730:180;
 +    return ($sum[0]>=50)?30:3;
    }
 -  return 180;
 +  return 3;
  }
  
  sub X509extractSAN($)
Simple merge
Simple merge
Simple merge
diff --cc pages/wot/1.php
Simple merge
diff --cc pages/wot/9.php
Simple merge
@@@ -130,18 -130,40 +130,18 @@@ function getDataFromLive() 
        $stats['users_50to99'] = number_format(tc(
                "select count(*) as `count` from (
                        select 1 from `notary`
-                               where `deleted` = 0
+                               where `deleted` = 0 AND `method` != 'Administrative Increase' AND `from` != `to`
                                group by `to`
-                               having sum(`points`) >= 50 and sum(`points`) < 100
+                               having sum(`awarded`) >= 50 and sum(`awarded`) < 100
                        ) as `high_points`"));
  
 -      $stats['assurer_candidates'] = number_format(tc(
 -              "select count(*) as `count` from `users`
 -                      where (
 -                              select sum(`awarded`) from `notary`
 -                                      where `to`=`users`.`id` AND `method` != 'Administrative Increase' AND `from` != `to`
 -                                      and `deleted` = 0
 -                              ) >= 100
 -                      and not exists(
 -                              select 1 from `cats_passed` as `cp`, `cats_variant` as `cv`
 -                                      where `cp`.`user_id`=`users`.`id`
 -                                      and `cp`.`variant_id`=`cv`.`id`
 -                                      and `cv`.`type_id`=1
 -                              )"
 -              ));
 -
 -      $stats['aussurers_with_test'] = number_format(tc(
 -              "select count(*) as `count` from `users`
 -                      where (
 -                              select sum(`awarded`) from `notary`
 -                                      where `to`=`users`.`id` AND `method` != 'Administrative Increase' AND `from` != `to`
 -                                      and `deleted` = 0
 -                              ) >= 100
 -                      and exists(
 -                              select 1 from `cats_passed` as `cp`, `cats_variant` as `cv`
 -                                      where `cp`.`user_id`=`users`.`id`
 -                                      and `cp`.`variant_id`=`cv`.`id`
 -                                      and `cv`.`type_id`=1
 -                              )"
 -              ));
 +      $startdate = date("Y-m-d", mktime(0, 0, 0, 1, 1, 2002));
 +      $enddate = date("Y-m-d", mktime(0, 0, 0, 1, 1, date("Y") + 1));
 +
-       $assurercount= assurer_count($startdate, $enddate,1);
++      $assurercount = assurer_count($startdate, $enddate, 1);
 +      $stats['assurer_with_test'] = number_format($assurercount);
 +
 +      $stats['assurer_candidates'] = number_format(assurer_count($startdate, $enddate,0) - $assurercount);
  
        $stats['points_issued'] = number_format(tc(
                "select sum(greatest(`points`, `awarded`)) as `count` from `notary`
diff --cc www/index.php
Simple merge
diff --cc www/wot.php
Simple merge