diff --git a/includes/account.php b/includes/account.php index 4a5a5f3..bb9c5cf 100644 --- a/includes/account.php +++ b/includes/account.php @@ -1878,6 +1878,119 @@ } } + if(($id == 51 || $id == 52 || $oldid == 52) && $_SESSION['profile']['tverify'] <= 0) + { + showheader(_("My CAcert.org Account!")); + echo _("You don't have access to this area."); + showfooter(); + exit; + } + + if($oldid == 52) + { + $uid = intval($_POST['uid']); + $query = "select * from `tverify` where `id`='$uid' and `modified`=0"; + $rc = mysql_num_rows(mysql_query($query)); + if($rc <= 0) + { + showheader(_("My CAcert.org Account!")); + echo _("Unable to find a valid tverify request for this ID."); + showfooter(); + exit; + } + } + + if($oldid == 52) + { + $query = "select * from `tverify-vote` where `tverify`='$uid' and `memid`='".$_SESSION['profile']['id']."'"; + $rc = mysql_num_rows(mysql_query($query)); + if($rc > 0) + { + showheader(_("My CAcert.org Account!")); + echo _("You have already voted on this request."); + showfooter(); + exit; + } + } + + if($oldid == 52 && ($_POST['agree'] != "" || $_POST['disagree'] != "")) + { + $vote = -1; + if($_POST['agree'] != "") + $vote = 1; + + $query = "insert into `tverify-vote` set + `tverify`='$uid', + `memid`='".$_SESSION['profile']['id']."', + `when`=NOW(), `vote`='$vote', + `comment`='".mysql_escape_string($_POST['comment'])."'"; + mysql_query($query); + + $rc = mysql_num_rows(mysql_query("select * from `tverify-vote` where `tverify`='$uid' and `vote`='1'")); + if($rc >= 4) + { + mysql_query("update `tverify` set `modified`=NOW() where `id`='$uid'"); + $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'")); + + $points = 0; + if($tverify['URL'] != "" && $tverify['photoid'] != "") + $points = 150 - intval($tmp['points']); + if($tverify['URL'] != "" && $tverify['photoid'] == "") + $points = 90 - intval($tmp['points']); + if($tverify['URL'] == "" && $tverify['photoid'] == "") + $points = 50 - intval($tmp['points']); + + if($points < 0) + $points = 0; + + if($points > 0) + { + mysql_query("insert into `notary` set `from`='0', `to`='$memid', `points`='$points', + `method`='Thawte Points Transfer', `when`=NOW()"); + } + $totalpoints = intval($tmp['points']) + $points; + + $body = _("Your request to have points transfered was sucessful. You were issued $points points as a result, and you now have $totalpoints in total")."\n\n"._("The following comments were made by reviewers")."\n\n"; + $res = mysql_query("select * from `tverify-vote` where `tverify`='$uid' and `vote`='1'"); + while($row = mysql_fetch_assoc($res)) + $body .= $row['comment']."\n"; + $body .= "\n"; + + $body .= _("Best regards")."\n"; + $body .= _("CAcert Support Team"); + sendmail($user['email'], "[CAcert.org] Thawte Notary Points Transfer", $body, "website-form@cacert.org", "returns@cacert.org", "", "CAcert Tverify"); + } + + $rc = mysql_num_rows(mysql_query("select * from `tverify-vote` where `tverify`='$uid' and `vote`='-1'")); + if($rc >= 4) + { + mysql_query("update `tverify` set `modified`=NOW() where `id`='$uid'"); + $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'")); + + $body = _("Unfortunately your request for a points increase has been denied, below is the comments from people that reviewed your request as to why they rejected your application.")."\n\n"; + $res = mysql_query("select * from `tverify-vote` where `tverify`='$uid' and `vote`='-1'"); + while($row = mysql_fetch_assoc($res)) + $body .= $row['comment']."\n"; + $body .= "\n"; + + $body .= _("You are welcome to try submitting another request at any time in the future, please make sure you take the reviewer comments into consideration or you risk having your application rejected again.")."\n\n"; + + $body .= _("Best regards")."\n"; + $body .= _("CAcert Support Team"); + sendmail($user['email'], "[CAcert.org] Thawte Notary Points Transfer", $body, "website-form@cacert.org", "returns@cacert.org", "", "CAcert Tverify"); + } + + showheader(_("My CAcert.org Account!")); + echo _("Your vote has been accepted."); + showfooter(); + exit; + } + if(intval($cert) > 0) $_SESSION['_config']['cert'] = intval($cert); if(intval($orgid) > 0) diff --git a/pages/account/40.php b/pages/account/40.php index 50ce311..758e4fa 100644 --- a/pages/account/40.php +++ b/pages/account/40.php @@ -17,7 +17,7 @@
=_("General Questions")?>
=_("PLEASE NOTE: Due to the large amounts of support questions, incorrectly directed emails may be ignored, this is a volunteer effort and directing general questions to the right place will help everyone, including yourself as you will get a speedier reply.")?>
=_("Before contacting us, be sure to read over the inforation on our official and unofficial HowTo and FAQ pages.")?> - =_("Go here for more details.")?>
-=_("General questions about CAcert should be sent to the general support list, this list has many more volunteers then those directly involved with the running of the website. While it's best if you sign up to the mailing list to get replied to, you don't have to, but please make sure you note this in your email, otherwise it might seem like you didn't get a reply to your question.")?>
+=_("General questions about CAcert should be sent to the general support list, please send all emails in ENGLISH only, this list has many more volunteers then those directly involved with the running of the website, everyone on the mailing list understands english, even if this isn't their native language this will increase your chance at a competent reply. While it's best if you sign up to the mailing list to get replied to, you don't have to, but please make sure you note this in your email, otherwise it might seem like you didn't get a reply to your question.")?>
=_("Click here to go to the Support List")?>
=_("You can alternatively use the form below, however joining the list is the prefered option to support your queries")?>