From 96594c54231547ce277957beed1d442948c30d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20T=C3=A4nzer?= Date: Tue, 30 Nov 2010 22:26:05 +0100 Subject: https://bugs.cacert.org/view.php?id=827 replace 10.php with supplied patch from bug (cherry picked from commit 5068904d912a09c23f99fb5370d7867596105444) Conflicts: pages/wot/10.php --- pages/wot/10.php | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'pages/wot') diff --git a/pages/wot/10.php b/pages/wot/10.php index 4a6afac..ccf8011 100644 --- a/pages/wot/10.php +++ b/pages/wot/10.php @@ -23,20 +23,13 @@ '$rc' ORDER BY `notary`.`when` DESC"; -*/ - $query = "SELECT count(*) AS `list` FROM `users` - inner join `notary` on `users`.`id` = `notary`.`from` - GROUP BY `notary`.`from` HAVING count(*) > '$rc'"; + $rc = intval($row['assurances']); + + $query = "SELECT COUNT(1) FROM `notary` GROUP BY `from` HAVING COUNT(1) > {$rc}"; $rank = mysql_num_rows(mysql_query($query)) + 1; ?> @@ -65,7 +58,7 @@ $maxpoints=intval($_SESSION['profile']['points'])-$row['apoints']; $points = 0; - $query = "select * from `notary` where `to`='".intval($_SESSION['profile']['id'])."' order by `id` desc "; + $query = "SELECT n.`id`, n.`date`, n.`awarded`, n.`from` as `from_id`, u.`fname` AS `from_fname`, u.`lname` AS `from_lname`, n.`location`, n.`method` FROM `notary` n LEFT JOIN `users` u ON n.`from`=u.`id` WHERE n.`to`=".intval($_SESSION['profile']['id'])." ORDER BY n.`when` DESC, n.`id` DESC"; $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) { @@ -73,12 +66,11 @@ if ($points+$awarded > $maxpoints) $awarded = $maxpoints-$points; $points = $points + $awarded; - $fromuser = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($row['from'])."'")); ?> - + @@ -105,17 +97,16 @@ '._("Deleted before Verification").''; else - $name = "$name"; + $name = "$name"; ?> -- cgit v1.2.1