Skip to Content.
Sympa Menu

cacert-devel - Patch request: Bug #1112

Subject: CAcert Code Development list.

List archive

Patch request: Bug #1112


Chronological Thread 
  • From: Michael Tänzer <michael.taenzer AT cacert.org>
  • To: "critical-admin AT cacert.org" <critical-admin AT cacert.org>
  • Cc: cacert-devel AT lists.cacert.org, Ulrich Schröter CAce rt <ulrich AT cacert.org>, Benny Baumann <benbe AT cacert.org>, Marcus Mängel <inopiae AT cacert.org>, Werner Dworak <werner.dworak AT cacert.org>
  • Subject: Patch request: Bug #1112
  • Date: Tue, 16 Apr 2013 19:07:57 +0200
  • Openpgp: id=9940BEF1

Hi folks,

We have a fix for https://bugs.cacert.org/view.php?id=1112
"Exchange the text on the TTP page according to the new TTP programm"

The fix was reviewed by Benny Baumann (BenBE) and me (NEOatNHNG) and
tested by Werner Dworak, Martin Gummi and Marcus Mängel (INOPIAE).

Diff is attached. Please also run the locale makefile so that our
translators see the new strings (if present) on
https://translations.cacert.org and new translations get imported into
the system.

Changed files:
/includes/wot.inc.php
/pages/wot/4.php
/www/wot.php

-- 
Have a nice day,
Michael Tänzer
diff --git a/includes/wot.inc.php b/includes/wot.inc.php
index edc442a..1c36df0 100644
--- a/includes/wot.inc.php
+++ b/includes/wot.inc.php
@@ -40,6 +40,15 @@
 
 		return intval($row['list']);
 	}
+	
+	function get_number_of_ttpassurances ($userid)
+	{
+		$res = query_init ("SELECT count(*) AS `list` FROM `notary`
+			WHERE (`method`='Trusted Third Parties' or `method`='TTP-Assisted') AND `to`='".intval($userid)."' ");
+		$row = query_getnextrow($res);
+
+		return intval($row['list']);
+	}
 
 	function get_number_of_assurees ($userid)
 	{
diff --git a/pages/wot/4.php b/pages/wot/4.php
index 04997ba..befdfe4 100644
--- a/pages/wot/4.php
+++ b/pages/wot/4.php
@@ -14,7 +14,9 @@
     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(dirname(__FILE__).'/../../includes/wot.inc.php');
+?>
 
 <h3><?=_("Trusted Third Parties")?></h3>
 
@@ -32,4 +34,49 @@
 
 <p><?=sprintf(_("If you are interested in the TTP programme, read the pages %s for the basic way how the TTP programme works for you, and %s whether the TTP programme affects the country where you are located."),"<a href='//wiki.cacert.org/TTP/TTPuser'>https://wiki.cacert.org/TTP/TTPuser</a>","<a href='//wiki.cacert.org/TTP/TTPAL'>https://wiki.cacert.org/TTP/TTPAL</a>")?> </p>
 
-<p><?=sprintf(_("If you want to take part in the TTP programme, send an email to %s with your name, the main email address of your CAcert account and the country that you want to see the TTP. CAcert will then send you the needed forms and guide you through the process."),"<a href='mailto:support AT cacert.org'>support AT cacert.org</a>")?></p>
+<?
+// test for points <100
+if ($_SESSION['profile']['points']<100){
+	// test for TTP assurances
+	if (get_number_of_ttpassurances(intval($_SESSION['profile']['id']))<2){?>
+		<p><?=_("If you want to ask for TTP assurances fill out the missing data and send the request to support AT cacert.org to start the process. CAcert will then inform you about the next steps.")?></p>
+		<form method="post" action="wot.php">
+		<table align="center" valign="middle" border="0" cellspacing="0" cellpadding="0" class="wrapper">
+			<tr>
+				<td class="DataTD"><?=_("Country where you want to visit the TTP")?></td>
+				<td class="DataTD"><select size="1" name="country">
+						<option>Australia</option>
+						<option>Puerto Rico</option>
+						<option>USA</option>
+					</select></td>
+			</tr>
+			<tr>
+				<td class="DataTD"><?=_("I want to take part in the TTP Topup programme")?></td>
+				<td class="DataTD"><input type="checkbox" name="ttptopup" value="1"></td>
+			</tr>
+			<tr>
+				<td colspan="2" >
+					<input type="hidden" name="oldid" value="<?=intval($id)?>">
+					<input type="submit" name="ttp" value="<?=_("I need a TTP assurance")?>">
+				</td>
+			</tr>
+		</table>
+	</form>
+<? //"
+	} else {
+	/* As soon as the TPP TOPUP Programme is established this routine should be used
+	<p><?=_("As you have already got 2 TTP assurances you can only take part in the TTP TOPUP programme. If you want to ask for the TTP TOPUP programme use the submit button to send the request to support AT cacert.org to start the process. CAcert will then inform you about the next steps.")?></p>
+		<form method="post" action="wot.php">
+			<input type="hidden" name="oldid" value="<?=intval($id)?>">
+			<input type="submit" name="ttptopup" value="<?=_("I need a TTP TOPUP")?>">
+		</form>
+*/
+?>
+	<p><?=_("We are working to develop the TTP TOPUP process to be able to fill the gap of the missing 30 assurance points to 100 assurance points. Meanwhile you have to close this gap with face to face assurances from CAcert Assurers. Think not only travelling to populated countries, but as well to assurers visiting your country or area.")?></p>  
+<?
+	}
+} else {
+?>
+	<p><?=_("You reached the maximum points that can be granted by the TTP programme and therefore you cannot take part in the TTP programme any more.")?></p>
+<?
+}
diff --git a/www/wot.php b/www/wot.php
index c6c0568..36d25b9 100644
--- a/www/wot.php
+++ b/www/wot.php
@@ -115,6 +115,7 @@ function send_reminder()
 
 
 
+
 	loadem("account");
 	if(array_key_exists('date',$_POST) && $_POST['date'] != "")
 		$_SESSION['_config']['date'] = $_POST['date'];
@@ -126,6 +127,40 @@ function send_reminder()
 
 	if($oldid == 12)
 		$id = $oldid;
+		
+	if($oldid == 4)
+	{
+		if ($_POST['ttp']!='') {
+			//This mail does not need to be translated
+			$body = "Hi TTP adminstrators,\n\n";
+			$body .= "User ".$_SESSION['profile']['fname']." ".
+			$_SESSION['profile']['lname']." with email address '".
+			$_SESSION['profile']['email']."' is requesting a TTP assurances for ".
+			mysql_escape_string(stripslashes($_POST['country'])).".\n\n";
+			if ($_POST['ttptopup']=='1') {
+				$body .= "The user is also requesting TTP TOPUP.\n\n";
+			}else{
+				$body .= "The user is NOT requesting TTP TOPUP.\n\n";
+			}
+			$body .= "The user received ".intval($_SESSION['profile']['points'])." assurance points up to today.\n\n";
+			$body .= "Please start the TTP assurance process.";
+			sendmail("support AT cacert.org", "[CAcert.org] TTP request.", $body, "support AT cacert.org", "", "", "CAcert Website");
+
+			//This mail needs to be translated
+			$body  =_("You are receiving this email because you asked for TTP assurance.")."\n\n";
+			if ($_POST['ttptopup']=='1') {
+				$body .=_("You are requesting TTP TOPUP.")."\n\n";
+			}else{
+				$body .=_("You are NOT requesting TTP TOPUP.")."\n\n";
+			}
+			$body .= _("Best regards")."\n";
+			$body .= _("CAcert Support Team");
+
+			sendmail($_SESSION['profile']['email'], "[CAcert.org] "._("You requested TTP assurances"), $body, "support AT cacert.org", "", "", "CAcert Support");
+
+		}
+
+	}
 
 	if(($id == 5 || $oldid == 5 || $id == 6 || $oldid == 6))
 		if (!is_assurer($_SESSION['profile']['id'])) 
@@ -333,14 +368,8 @@ $iecho= "c";
 
 		if(($drow['total'] + $newpoints) >= 100 && $newpoints > 0)
 		{
-			$body .= _("You have at least 100 Assurance Points. If you want ".
-					"to become an assurer try the Assurer Challenge").
-					" ( https://cats.cacert.org ).\n\n";
-			$body .= _("To make it easier for others in your area to find ".
-					"you, it's helpful to list yourself as an assurer (this ".
-					"is voluntary), as well as a physical location where you ".
-					"live or work the most. You can flag your account to be ".
-					"listed, and add a comment to the display by going to:")."\n";
+			$body .= _("You have at least 100 Assurance Points, if you want to become an assurer try the Assurer Challenge")." ( https://cats.cacert.org )\n\n";
+			$body .= _("To make it easier for others in your area to find you, it's helpful to list yourself as an assurer (this is voluntary), as well as a physical location where you live or work the most. You can flag your account to be listed, and add a comment to the display by going to:")."\n";
 			$body .= "https://www.cacert.org/wot.php?id=8\n\n";;
 			$body .= _("You can list your location by going to:")."\n";
 			$body .= "https://www.cacert.org/wot.php?id=13\n\n";;

Attachment: signature.asc
Description: OpenPGP digital signature




Archive powered by MHonArc 2.6.16.

Top of Page