summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2013-11-19 23:02:00 +0100
committerBenny Baumann <BenBE@geshi.org>2013-11-19 23:24:09 +0100
commitb8b0d0044fcac7402bba19bfd601339bf61f1a69 (patch)
tree3f3a822ec0d60e2ed3119fa65244aee19528e6f1 /www
parent1d4a0decbddcb0a1c78203720e7a7dcfd702590b (diff)
downloadcacert-devel-b8b0d0044fcac7402bba19bfd601339bf61f1a69.tar.gz
cacert-devel-b8b0d0044fcac7402bba19bfd601339bf61f1a69.tar.xz
cacert-devel-b8b0d0044fcac7402bba19bfd601339bf61f1a69.zip
bug 1221: added `deleted` = 0
Diffstat (limited to 'www')
-rw-r--r--www/api/ccsr.php2
-rw-r--r--www/api/cemails.php2
-rw-r--r--www/index.php2
-rw-r--r--www/stats.php16
4 files changed, 11 insertions, 11 deletions
diff --git a/www/api/ccsr.php b/www/api/ccsr.php
index 7efdf8d..a0f36e2 100644
--- a/www/api/ccsr.php
+++ b/www/api/ccsr.php
@@ -42,7 +42,7 @@ require_once '../../includes/lib/check_weak_key.php';
}
if(count($emails) <= 0)
die("404,Wasn't able to match any emails sent against your account");
- $query = "select sum(`points`) as `points` from `notary` where `to`='$memid' group by `to`";
+ $query = "select sum(`points`) as `points` from `notary` where `to`='$memid' and `notary`.`deleted`=0 group by `to`";
$row = mysql_fetch_assoc(mysql_query($query));
$points = $row['points'];
diff --git a/www/api/cemails.php b/www/api/cemails.php
index 0d067ea..260ca4f 100644
--- a/www/api/cemails.php
+++ b/www/api/cemails.php
@@ -25,7 +25,7 @@
echo "200,Authentication Ok\n";
$user = mysql_fetch_assoc($res);
$memid = $user['id'];
- $query = "select sum(`points`) as `points` from `notary` where `to`='$memid' group by `to`";
+ $query = "select sum(`points`) as `points` from `notary` where `to`='$memid' and `notary`.`deleted`=0 group by `to`";
$row = mysql_fetch_assoc(mysql_query($query));
$points = $row['points'];
echo "CS=".intval($user['codesign'])."\n";
diff --git a/www/index.php b/www/index.php
index c7cc03e..d680f38 100644
--- a/www/index.php
+++ b/www/index.php
@@ -319,7 +319,7 @@ require_once('../includes/lib/l10n.php');
L10n::set_translation($_SESSION['profile']['language']);
L10n::init_gettext();
}
- $query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' group by `to`";
+ $query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' and `notary`.`deleted`=0 group by `to`";
$res = mysql_query($query);
$row = mysql_fetch_assoc($res);
$_SESSION['profile']['points'] = $row['total'];
diff --git a/www/stats.php b/www/stats.php
index 93f693e..b119c07 100644
--- a/www/stats.php
+++ b/www/stats.php
@@ -82,16 +82,16 @@
$certs += tc(mysql_query("select count(`id`) as `count` from `orgdomaincerts` where `revoked`=0 and `expire`>NOW()"));
$certs += tc(mysql_query("select count(`id`) as `count` from `orgemailcerts` where `revoked`=0 and `expire`>NOW()"));
$stats['valid_certificates'] = number_format($certs);
- $stats['assurances_made'] = number_format(tc(mysql_query("select count(`id`) as `count` from `notary`")));
- $stats['users_1to49'] = number_format(mysql_num_rows(mysql_query("select `to` from `notary` group by `to` having sum(`points`) > 0 and sum(`points`) < 50")));
- $stats['users_50to99'] = number_format(mysql_num_rows(mysql_query("select `to` from `notary` group by `to` having sum(`points`) >= 50 and sum(`points`) < 100")));
+ $stats['assurances_made'] = number_format(tc(mysql_query("select count(`id`) as `count` from `notary` where `notary`.`deleted`=0")));
+ $stats['users_1to49'] = number_format(mysql_num_rows(mysql_query("select `to` from `notary` where `notary`.`deleted`=0 group by `to` having sum(`points`) > 0 and sum(`points`) < 50")));
+ $stats['users_50to99'] = number_format(mysql_num_rows(mysql_query("select `to` from `notary` where `notary`.`deleted`=0 group by `to` having sum(`points`) >= 50 and sum(`points`) < 100")));
$stats['assurer_candidates'] = number_format(tc(mysql_query("select count(*) as `count` from `users` where ".
"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) and ".
- "(select sum(`points`) from `notary` where `to`=`users`.`id`) >= 100")));
+ "(select sum(`points`) from `notary` where `to`=`users`.`id` and `notary`.`deleted`=0) >= 100 ")));
$stats['aussurers_with_test'] = number_format(tc(mysql_query("select count(*) as `count` from `users` where ".
"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) and ".
- "(select sum(`points`) from `notary` where `to`=`users`.`id`) >= 100")));
- $stats['points_issued'] = number_format(tc(mysql_query("select sum(`points`) as `count` from `notary`")));
+ "(select sum(`points`) from `notary` where `to`=`users`.`id` and where `notary`.`deleted`=0) >= 100")));
+ $stats['points_issued'] = number_format(tc(mysql_query("select sum(`points`) as `count` from `notary` where `notary`.`deleted`=0")));
$totalusers=0;
$totassurers=0;
@@ -101,7 +101,7 @@
$tmp_arr['date'] = date("Y-m", mktime(0,0,0,date("m") - $i,1,date("Y")));
$date = date("Y-m", mktime(0,0,0,date("m") - $i,1,date("Y")));
$totalusers += $users = tc(mysql_query("select count(`id`) as `count` from `users` where `created` like '$date%' and `verified`=1"));
- $totassurers += $assurers = mysql_num_rows(mysql_query("select `to` from `notary` where `when` like '$date%' and `method`!='Administrative Increase' group by `to` having sum(`points`) >= 100"));
+ $totassurers += $assurers = mysql_num_rows(mysql_query("select `to` from `notary` where `when` like '$date%' and `method`!='Administrative Increase' and `notary`.`deleted`=0 group by `to` having sum(`points`) >= 100"));
$certs = tc(mysql_query("select count(`id`) as `count` from `domaincerts` where `created` like '$date%'"));
$certs += tc(mysql_query("select count(`id`) as `count` from `emailcerts` where `created` like '$date%'"));
$certs += tc(mysql_query("select count(`id`) as `count` from `gpg` where `issued` like '$date%'"));
@@ -126,7 +126,7 @@
$tmp_arr = array();
$tmp_arr['date'] = $i;
$totalusers += $users = tc(mysql_query("select count(`id`) as `count` from `users` where `created` like '$i%' and `verified`=1"));
- $totassurers += $assurers = mysql_num_rows(mysql_query("select `to` from `notary` where `when` like '$i%' and `method`!='Administrative Increase' group by `to` having sum(`points`) >= 100"));
+ $totassurers += $assurers = mysql_num_rows(mysql_query("select `to` from `notary` where `when` like '$i%' and `method`!='Administrative Increase' and `notary`.`deleted`=0 group by `to` having sum(`points`) >= 100"));
$certs = tc(mysql_query("select count(`id`) as `count` from `domaincerts` where `created` like '$i%'"));
$certs += tc(mysql_query("select count(`id`) as `count` from `emailcerts` where `created` like '$i%'"));
$certs += tc(mysql_query("select count(`id`) as `count` from `gpg` where `issued` like '$i%'"));