diff options
-rw-r--r-- | includes/account.php | 6 | ||||
-rw-r--r-- | includes/lib/account.php | 4 | ||||
-rw-r--r-- | includes/lib/general.php | 2 | ||||
-rw-r--r-- | includes/loggedin.php | 2 | ||||
-rw-r--r-- | pages/account/52.php | 2 | ||||
-rw-r--r-- | pages/account/55.php | 2 | ||||
-rw-r--r-- | pages/wot/1.php | 2 | ||||
-rw-r--r-- | pages/wot/9.php | 2 | ||||
-rw-r--r-- | stamp/common.php | 2 | ||||
-rw-r--r-- | www/api/ccsr.php | 2 | ||||
-rw-r--r-- | www/api/cemails.php | 2 | ||||
-rw-r--r-- | www/index.php | 2 | ||||
-rw-r--r-- | www/stats.php | 16 |
13 files changed, 23 insertions, 23 deletions
diff --git a/includes/account.php b/includes/account.php index 2addca1..1c9db57 100644 --- a/includes/account.php +++ b/includes/account.php @@ -1270,7 +1270,7 @@ if($oldid == 13 && $process != "") { - $ddquery = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' group by `to`"; + $ddquery = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' and `deleted` = 0 group by `to`"; $ddres = mysql_query($ddquery); $ddrow = mysql_fetch_assoc($ddres); $_SESSION['profile']['points'] = $ddrow['total']; @@ -1340,7 +1340,7 @@ $_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".$_SESSION['profile']['id']."'")); $_SESSION['profile']['loggedin'] = 1; - $ddquery = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' group by `to`"; + $ddquery = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['profile']['id']."' and `deleted` = 0 group by `to`"; $ddres = mysql_query($ddquery); $ddrow = mysql_fetch_assoc($ddres); $_SESSION['profile']['points'] = $ddrow['total']; @@ -3080,7 +3080,7 @@ $tverify = mysql_fetch_assoc(mysql_query("select * from `tverify` where `id`='$uid'")); $memid = $tverify['memid']; $user = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='$memid'")); - $tmp = mysql_fetch_assoc(mysql_query("select sum(`points`) as `points` from `notary` where `to`='$memid'")); + $tmp = mysql_fetch_assoc(mysql_query("select sum(`points`) as `points` from `notary` where `to`='$memid' and `deleted` = 0")); $points = 0; if($tverify['URL'] != "" && $tverify['photoid'] != "") diff --git a/includes/lib/account.php b/includes/lib/account.php index e311668..46bbcee 100644 --- a/includes/lib/account.php +++ b/includes/lib/account.php @@ -51,7 +51,7 @@ function fix_assurer_flag($userID = NULL) SELECT SUM(`points`) FROM `notary` AS `n` WHERE `n`.`to` = `u`.`id` AND (`n`.`expire` > now() - OR `n`.`expire` IS NULL) + OR `n`.`expire` IS NULL) and `n`.`deleted` = 0 ) >= 100'; $query = mysql_query($sql); @@ -85,7 +85,7 @@ function fix_assurer_flag($userID = NULL) AND ( `n`.`expire` > now() OR `n`.`expire` IS NULL - ) + ) and `n`.`deleted` = 0 ) < 100 )'; diff --git a/includes/lib/general.php b/includes/lib/general.php index 85b132d..cb73c51 100644 --- a/includes/lib/general.php +++ b/includes/lib/general.php @@ -146,7 +146,7 @@ function runCommand($command, $input = "", &$output = null, &$errors = true) { $Result |= 5; } - $query = mysql_query('SELECT SUM(`points`) AS `points` FROM `notary` AS `n` WHERE `n`.`to` = \''.(int)intval($userID).'\' AND `n`.`expire` < now()'); + $query = mysql_query('SELECT SUM(`points`) AS `points` FROM `notary` AS `n` WHERE `n`.`to` = \''.(int)intval($userID).'\' AND `n`.`expire` < now() and `deleted` = 0'); $row = mysql_fetch_assoc($query); if ($row['points'] < 100) { $Result |= 3; diff --git a/includes/loggedin.php b/includes/loggedin.php index 4f9b8e8..de61ee1 100644 --- a/includes/loggedin.php +++ b/includes/loggedin.php @@ -113,7 +113,7 @@ if($_SERVER['HTTP_HOST'] == $_SESSION['_config']['securehostname'] && $_SESSION['profile']['id'] > 0 && $_SESSION['profile']['loggedin'] > 0) { - $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 `deleted` = 0 group by `to`"; $res = mysql_query($query); $row = mysql_fetch_assoc($res); $_SESSION['profile']['points'] = $row['total']; diff --git a/pages/account/52.php b/pages/account/52.php index 77a3bae..73a8bae 100644 --- a/pages/account/52.php +++ b/pages/account/52.php @@ -35,7 +35,7 @@ exit; } - $query = "select sum(`points`) as `points` from `notary` where `to`='$memid'"; + $query = "select sum(`points`) as `points` from `notary` where `to`='$memid' and `deleted` = 0"; $notary = mysql_fetch_assoc(mysql_query($query)); $query = "select * from `users` where `id`='$memid'"; $user = mysql_fetch_assoc(mysql_query($query)); diff --git a/pages/account/55.php b/pages/account/55.php index ec401a0..402b7a8 100644 --- a/pages/account/55.php +++ b/pages/account/55.php @@ -87,7 +87,7 @@ <tr><td colspan="3" class="DataTD"><a href="account.php?id=43&userid=<?=$user_id ?>">back</a></td></tr>
<? } else {
$query = 'SELECT `u`.id, `u`.`assurer`, SUM(`points`) FROM `users` AS `u`, `notary` AS `n` '.
- ' WHERE `u`.`id` = \''.(int)intval($_SESSION['profile']['id']).'\' AND `n`.`to` = `u`.`id` AND `expire` < now() '.
+ ' WHERE `u`.`id` = \''.(int)intval($_SESSION['profile']['id']).'\' AND `n`.`to` = `u`.`id` AND `expire` < now() and and `n`.`deleted` = 0'. ' GROUP BY `u`.id, `u`.`assurer`';
$res = mysql_query($query);
if (!$res) {
diff --git a/pages/wot/1.php b/pages/wot/1.php index a45b5df..9e5d0f5 100644 --- a/pages/wot/1.php +++ b/pages/wot/1.php @@ -91,7 +91,7 @@ { $query = "select *, `users`.`id` as `id` from `users`,`notary` where `listme`='1' and `ccid`='".$ccid."' and `regid`='".$regid."' and - `locid`='".$locid."' and `users`.`id`=`notary`.`to` + `locid`='".$locid."' and `users`.`id`=`notary`.`to` and `notary`.`deleted`=0 group by `notary`.`to` HAVING SUM(`points`) >= 100 order by `points` desc"; $list = mysql_query($query); if(mysql_num_rows($list) > 0) diff --git a/pages/wot/9.php b/pages/wot/9.php index bfa7a98..0d9b22d 100644 --- a/pages/wot/9.php +++ b/pages/wot/9.php @@ -28,7 +28,7 @@ $user = mysql_fetch_array($res); $userlang = $user['language']; $points = mysql_num_rows(mysql_query("select sum(`points`) as `total` from `notary` - where `to`='".$user['id']."' group by `to` HAVING SUM(`points`) > 0")); + where `to`='".$user['id']."' and `deleted`=0 group by `to` HAVING SUM(`points`) > 0")); if($points <= 0) { echo _("Sorry, I was unable to locate that user."); diff --git a/stamp/common.php b/stamp/common.php index ff814dd..d0a71f4 100644 --- a/stamp/common.php +++ b/stamp/common.php @@ -117,7 +117,7 @@ if($org == 0) { $query = "SELECT *, sum(`points`) AS `total` FROM `users`, `notary` WHERE `users`.`id` = '$cert[memid]' AND - `notary`.`to` = `users`.`id` and `notary`.`when` <= '$cert[issued]' GROUP BY `notary`.`to`"; + `notary`.`to` = `users`.`id` and `notary`.`when` <= '$cert[issued]' and `notary`.`deleted`=0 GROUP BY `notary`.`to`"; $user = mysql_fetch_assoc(mysql_query($query)); } else { $query = "select * from `orginfo` where `id`='$cert[orgid]'"; 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%'"));
|