Merge branch 'release' into bug-1221
[cacert-devel.git] / www / wot.php
index 9b6bd27..dec4246 100644 (file)
@@ -225,7 +225,7 @@ function send_reminder()
                }
 
                $query = "select * from `notary` where `from`='".$_SESSION['profile']['id']."' and
-                                                       `to`='".$_SESSION['_config']['notarise']['id']."'";
+                       `to`='".$_SESSION['_config']['notarise']['id']."' and `deleted` = 0";
                $res = mysql_query($query);
                if(mysql_num_rows($res) > 0)
                {
@@ -277,7 +277,7 @@ $iecho= "c";
                        exit;
                }
 
-               //met assuree in person, not appliciable fot TTP / TTP Topup assurances
+               //met assuree in person, not appliciable for TTP / TTP Topup assurances
                if((!array_key_exists('certify',$_POST) || $_POST['certify'] != 1 )  && $_REQUEST['method'] != "Trusted 3rd Parties")
                {
                        show_page("VerifyData","",_("You failed to check all boxes to validate your adherence to the rules and policies of CAcert"));
@@ -332,7 +332,7 @@ $iecho= "c";
                if($newpoints < 0)
                        $newpoints = $awarded = 0;
 
-               $query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['_config']['notarise']['id']."' group by `to`";
+               $query = "select sum(`points`) as `total` from `notary` where `to`='".$_SESSION['_config']['notarise']['id']."' and `deleted` = 0 group by `to`";
                $res = mysql_query($query);
                $drow = mysql_fetch_assoc($res);
 
@@ -352,7 +352,8 @@ $iecho= "c";
                                                `to`='".$_SESSION['_config']['notarise']['id']."' AND
                                                `awarded`='$awarded' AND
                                                `location`='".mysql_escape_string(stripslashes($_POST['location']))."' AND
-                                               `date`='".mysql_escape_string(stripslashes($_POST['date']))."'";
+                                               `date`='".mysql_escape_string(stripslashes($_POST['date']))."' AND
+                                               `deleted`=0";
                $res = mysql_query($query);
                if(mysql_num_rows($res) > 0)
                {
@@ -371,7 +372,8 @@ $iecho= "c";
                                                `when`=NOW()";
                //record active acceptance by Assurer
                if (check_date_format(trim($_REQUEST['date']),2010)) {
-                       write_user_agreement($_SESSION['profile']['id'], "CCA", "Assurance", "Assurer", 1, $_SESSION['_config']['notarise']['id']);
+                       write_user_agreement($_SESSION['profile']['id'], "CCA", "assurance", "Assuring", 1, $_SESSION['_config']['notarise']['id']);
+                       write_user_agreement($_SESSION['_config']['notarise']['id'], "CCA", "assurance", "Being assured", 0, $_SESSION['profile']['id']);
                }
                if($_SESSION['profile']['ttpadmin'] == 1 && ($_POST['method'] == 'Trusted 3rd Parties' || $_POST['method'] == 'Trusted Third Parties')) {
                        $query .= ",\n`method`='TTP-Assisted'";
@@ -379,10 +381,6 @@ $iecho= "c";
                mysql_query($query);
                fix_assurer_flag($_SESSION['_config']['notarise']['id']);
                include_once("../includes/notary.inc.php");
-/*to be activated after CCA accept option is implemented in form
-               write_user_agreement($_SESSION['profile']['id'], "CCA", "assurance", "Assuring", 1, $_SESSION['_config']['notarise']['id']);}*/
-/* to be activated after the CCA recording is announced
-               write_user_agreement($_SESSION['_config']['notarise']['id'], "CCA", "assurance", "Being assured", 0, $_SESSION['profile']['id']); */
 
                if($_SESSION['profile']['points'] < 150)
                {
@@ -512,7 +510,7 @@ $iecho= "c";
                        $userid = intval($_REQUEST['userid']);
                        $user = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='$userid' and `listme`=1"));
                        $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)
                        {
                                $my_translation = L10n::get_translation();