summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2013-11-19 22:53:49 +0100
committerBenny Baumann <BenBE@geshi.org>2013-11-19 23:24:09 +0100
commit8c702e67919146c1a2e61b25d3609c4c32d987e0 (patch)
treec2947b88750a9c22555f2b3b88fb4c39abf08271 /pages
parentbe7573a378a88bdc8574a613a068097503f40d6d (diff)
downloadcacert-devel-8c702e67919146c1a2e61b25d3609c4c32d987e0.tar.gz
cacert-devel-8c702e67919146c1a2e61b25d3609c4c32d987e0.tar.xz
cacert-devel-8c702e67919146c1a2e61b25d3609c4c32d987e0.zip
bug 1221: changed delete assurance to update "deleted = NOW()", added `deleted` = 0 to all queries on notary
Diffstat (limited to 'pages')
-rw-r--r--pages/account/43.php10
-rw-r--r--pages/wot/10.php14
-rw-r--r--pages/wot/15.php2
3 files changed, 13 insertions, 13 deletions
diff --git a/pages/account/43.php b/pages/account/43.php
index 53b24d3..a81d9a3 100644
--- a/pages/account/43.php
+++ b/pages/account/43.php
@@ -23,11 +23,11 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php");
{
$assurance = mysql_escape_string(intval($_REQUEST['assurance']));
$row = 0;
- $res = mysql_query("select `to` from `notary` where `id`='$assurance'");
+ $res = mysql_query("select `to` from `notary` where `id`='$assurance' and `deleted` = 0");
if ($res) {
$row = mysql_fetch_assoc($res);
}
- mysql_query("delete from `notary` where `id`='$assurance'");
+ mysql_query("update `notary` set `deleted`=NOW() where `id`='$assurance'");
if ($row) {
fix_assurer_flag($row['to']);
}
@@ -108,7 +108,7 @@ include_once($_SESSION['_config']['filepath']."/includes/notary.inc.php");
echo _("I'm sorry, the user you were looking for seems to have disappeared! Bad things are a foot!");
} else {
$row = mysql_fetch_assoc($res);
- $query = "select sum(`points`) as `points` from `notary` where `to`='".intval($row['id'])."'";
+ $query = "select sum(`points`) as `points` from `notary` where `to`='".intval($row['id'])."' and `deleted` = 0";
$dres = mysql_query($query);
$drow = mysql_fetch_assoc($dres);
$alerts = mysql_fetch_assoc(mysql_query("select * from `alerts` where `memid`='".intval($row['id'])."'"));
@@ -828,7 +828,7 @@ function showassuredto()
<td class="DataTD"><b><?=_("Revoke")?></b></td>
</tr>
<?
- $query = "select * from `notary` where `to`='".intval($_GET['userid'])."'";
+ $query = "select * from `notary` where `to`='".intval($_GET['userid'])."' and `deleted` = 0";
$dres = mysql_query($query);
$points = 0;
while($drow = mysql_fetch_assoc($dres))
@@ -874,7 +874,7 @@ function showassuredby()
<td class="DataTD"><b><?=_("Revoke")?></b></td>
</tr>
<?
- $query = "select * from `notary` where `from`='".intval($_GET['userid'])."'";
+ $query = "select * from `notary` where `from`='".intval($_GET['userid'])."' and `deleted` = 0";
$dres = mysql_query($query);
$points = 0;
while($drow = mysql_fetch_assoc($dres))
diff --git a/pages/wot/10.php b/pages/wot/10.php
index bc76a86..d796789 100644
--- a/pages/wot/10.php
+++ b/pages/wot/10.php
@@ -24,7 +24,7 @@
<td colspan="5" class="title"><?=_("Assurer Ranking")?></td>
</tr>
<tr>
-<?
+<?// the rank calculation is not adjusted to the new deletion method
$query = "SELECT `users`. *, count(*) AS `list` FROM `users`, `notary`
WHERE `users`.`id` = `notary`.`from` AND `notary`.`from` != `notary`.`to`
AND `from`='".intval($_SESSION['profile']['id'])."' GROUP BY `notary`.`from`";
@@ -36,8 +36,8 @@
WHERE `users`.`id` = `notary`.`from` AND `notary`.`from` != `notary`.`to`
GROUP BY `notary`.`from` HAVING count(*) > '$rc' ORDER BY `notary`.`when` DESC";
*/
- $query = "SELECT count(*) AS `list` FROM `users`
- inner join `notary` on `users`.`id` = `notary`.`from`
+ $query = "SELECT count(*) AS `list` FROM `users`
+ inner join `notary` on `users`.`id` = `notary`.`from`
GROUP BY `notary`.`from` HAVING count(*) > '$rc'";
$rank = mysql_num_rows(mysql_query($query)) + 1;
@@ -64,11 +64,11 @@
<td class="DataTD"><b><?=_("Method")?></b></td>
</tr>
<?
- $query = "select * from `notary` where `to`='".intval($_SESSION['profile']['id'])."'";
+ $query = "select `id`, `date`, `points`, `location`, `method` from `notary` where `to`='".intval($_SESSION['profile']['id'])."' and `deleted`=0";
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
- $fromuser = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($row['from'])."'"));
+ $fromuser = mysql_fetch_assoc(mysql_query("select `fname`, `lname` from `users` where `id`='".intval($row['from'])."'"));
?>
<tr>
<td class="DataTD"><?=$row['id']?></td>
@@ -114,11 +114,11 @@ if ($thawte)
</tr>
<?
$points = 0;
- $query = "select * from `notary` where `from`='".intval($_SESSION['profile']['id'])."' and `to`!='".intval($_SESSION['profile']['id'])."'";
+ $query = "select `id`, `date`, `points`, `location`, `method` from `notary` where `from`='".intval($_SESSION['profile']['id'])."' and `to`!='".intval($_SESSION['profile']['id'])."' and `deleted`=0" ;
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
- $fromuser = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($row['to'])."'"));
+ $fromuser = mysql_fetch_assoc(mysql_query("select `fname`, `lname` from `users` where `id`='".intval($row['to'])."'"));
$points += $row['points'];
$name = trim($fromuser['fname']." ".$fromuser['lname']);
if($name == "")
diff --git a/pages/wot/15.php b/pages/wot/15.php
index cca2702..c1f3e0f 100644
--- a/pages/wot/15.php
+++ b/pages/wot/15.php
@@ -14,7 +14,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-*/
+*/
require_once($_SESSION['_config']['filepath']."/includes/notary.inc.php");