summaryrefslogtreecommitdiff
path: root/www/wot.php
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2011-10-16 06:09:25 +0200
committerMichael Tänzer <neo@nhng.de>2011-10-16 06:09:25 +0200
commit147cce7acd3ce673c494dc9b30f36b3d5554abea (patch)
tree28ef84874a81cd92558200c2a9c7a522cb94d906 /www/wot.php
parent6e0ae5b60fdb53fccfa90519522fb9b1cbd44e45 (diff)
downloadcacert-devel-147cce7acd3ce673c494dc9b30f36b3d5554abea.tar.gz
cacert-devel-147cce7acd3ce673c494dc9b30f36b3d5554abea.tar.xz
cacert-devel-147cce7acd3ce673c494dc9b30f36b3d5554abea.zip
bug 985: replace occurences of $_SESSION['_config']['translations']
this includes a little rewrite of reminder handling Signed-off-by: Michael Tänzer <neo@nhng.de>
Diffstat (limited to 'www/wot.php')
-rw-r--r--www/wot.php47
1 files changed, 22 insertions, 25 deletions
diff --git a/www/wot.php b/www/wot.php
index 7fa572f..33ce4bb 100644
--- a/www/wot.php
+++ b/www/wot.php
@@ -17,6 +17,7 @@
*/ ?>
<?
require_once("../includes/loggedin.php");
+ require_once("../includes/lib/l10n.php");
loadem("account");
@@ -52,34 +53,30 @@
if($oldid == 5 && array_key_exists('reminder',$_POST) && $_POST['reminder'] != "")
{
$body = "";
- if($_POST['reminder-lang'] != "" && $_POST['reminder-lang'] != "en_AU")
- {
- $userlang = $_POST['reminder-lang'];
- $_SESSION['_config']['reminder-lang'] = $_POST['reminder-lang'];
- putenv("LANG=".$userlang);
- setlocale(LC_ALL, $userlang);
-
- $body .= $_SESSION['_config']['translations'][$userlang].":\n\n";
+
+ $my_translation = L10n::get_translation();
+
+ $_SESSION['_config']['reminder-lang'] = $_POST['reminder-lang'];
+
+ $reminder_translations[] = $_POST['reminder-lang'];
+ if ( !in_array("en", $reminder_translations, $strict=true) ) {
+ $reminder_translations[] = "en";
+ }
+
+ foreach ($reminder_translations as $translation) {
+ L10n::set_translation($translation);
+
+ $body .= L10n::$translations[$translation].":\n\n";
$body .= sprintf(_("This is a short reminder that you filled out forms to become trusted with CAcert.org, and %s has attempted to issue you points. Please create your account at %s as soon as possible and then notify %s so that the points can be issued."), $_SESSION['profile']['fname']." (".$_SESSION['profile']['email'].")", "http://www.cacert.org", $_SESSION['profile']['fname'])."\n\n";
$body .= _("Best regards")."\n";
- $body .= _("CAcert Support Team");
-
- $body .= "\n\nEnglish:\n\n";
- }
-
- $body .= sprintf("This is a short reminder that you filled out forms to become trusted with CAcert.org, and %s has attempted to issue you points. Please create your account at %s as soon as possible and then notify %s so that the points can be issued.", $_SESSION['profile']['fname']." (".$_SESSION['profile']['email'].")", "http://www.cacert.org", $_SESSION['profile']['fname'])."\n\n";
- $body .= "Best regards"."\n";
- $body .= "CAcert Support Team";
-
+ $body .= _("CAcert Support Team")."\n\n";
+ }
+
+ L10n::set_translation($reminder_translations[0]); // for the subject
sendmail($_POST['email'], "[CAcert.org] "._("Reminder Notice"), $body, $_SESSION['profile']['email'], "", "", $_SESSION['profile']['fname']);
-
- if($_POST['reminder-lang'] != "" && $_POST['reminder-lang'] != "en_AU")
- {
- $userlang = $_SESSION['profile']['language'];
- putenv("LANG=".$userlang);
- setlocale(LC_ALL, $userlang);
- }
-
+
+ L10n::set_translation($my_translation);
+
$_SESSION['_config']['remindersent'] = 1;
$_SESSION['_config']['error'] = _("A reminder notice has been sent.");