diff --git a/includes/mysql.php.sample b/includes/mysql.php.sample index eb86401..10185fc 100644 --- a/includes/mysql.php.sample +++ b/includes/mysql.php.sample @@ -64,7 +64,8 @@ fputs($smtp, "DATA\r\n"); $InputBuffer = fgets($smtp, 1024); fputs($smtp, "X-Mailer: CAcert.org Website\r\n"); - fputs($smtp, "X-OriginatingIP: ".$_SERVER["REMOTE_ADDR"]."\r\n"); + if (array_key_exists("REMOTE_ADDR", $_SERVER)) + fputs($smtp, "X-OriginatingIP: ".$_SERVER["REMOTE_ADDR"]."\r\n"); fputs($smtp, "Sender: $errorsto\r\n"); fputs($smtp, "Errors-To: $errorsto\r\n"); if($replyto != "") diff --git a/includes/wot.inc.php b/includes/wot.inc.php index 6b3bcc8..9471bee 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'); +?>
=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."),"https://wiki.cacert.org/TTP/TTPuser","https://wiki.cacert.org/TTP/TTPAL")?>
-=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."),"support@cacert.org")?>
+ +// test for points <100 +if ($_SESSION['profile']['points']<100){ + // test for TTP assurances + if (get_number_of_ttpassurances(intval($_SESSION['profile']['id']))<2){?> +=_("If you want to ask for TTP assurances fill out the missing data and send the request to support@cacert.org to start the process. CAcert will then inform you about the next steps.")?>
+ + //" + } else { + /* As soon as the TPP TOPUP Programme is established this routine should be used +=_("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@cacert.org to start the process. CAcert will then inform you about the next steps.")?>
+ +*/ +?> +=_("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.")?>
+ + } +} else { +?> +=_("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.")?>
+ +} diff --git a/www/wot.php b/www/wot.php index 9e41891..551e485 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@cacert.org", "[CAcert.org] TTP request.", $body, "support@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@cacert.org", "", "", "CAcert Support"); + + } + + } if(($id == 5 || $oldid == 5 || $id == 6 || $oldid == 6)) if (!is_assurer($_SESSION['profile']['id'])) @@ -341,14 +376,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";