summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Dörre <felix@dogcraft.de>2015-05-12 22:29:51 +0200
committerFelix Dörre <felix@dogcraft.de>2015-05-12 22:44:26 +0200
commite2f72e63808feb0a2380d7e3fea85636b412427d (patch)
tree4f4897c5afe9419380bb53c1dd4a00a3f33313d0
parentb513efab245b17945e09ece0290f1d5f4fe13f85 (diff)
downloadcacert-devel-e2f72e63808feb0a2380d7e3fea85636b412427d.tar.gz
cacert-devel-e2f72e63808feb0a2380d7e3fea85636b412427d.tar.xz
cacert-devel-e2f72e63808feb0a2380d7e3fea85636b412427d.zip
bug 1316: split the revoke_assurance-function to have a function to recalculate the old points
-rw-r--r--includes/notary.inc.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index b6565b9..176f078 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -2153,7 +2153,15 @@ function revoke_assurance($assuranceid, $toid){
$query = "update `notary` set `deleted` = NOW() where `id` = '$assuranceid' LIMIT 1";
mysql_query($query);
+ recalculate_old_assurance_points($toid);
+ fix_assurer_flag($toid);
+}
+/**
+ * recalculates the old points of an assuree
+ * @param int $toid - id of the assuree
+ */
+function recalculate_old_assurance_points($toid){
$query = "select * from `notary` where `to` = '$toid' and `method` != 'Administrative Increase' and `deleted` = 0 order by `when`";
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res)){
@@ -2166,5 +2174,4 @@ function revoke_assurance($assuranceid, $toid){
mysql_query($query);
}
- fix_assurer_flag($toid);
}