summaryrefslogtreecommitdiff
path: root/www/wot.php
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2012-01-24 12:49:47 +0100
committerMichael Tänzer <neo@nhng.de>2012-01-24 12:49:47 +0100
commitca4dc5c662667cb9da46fd72b6aa15521e3eafd2 (patch)
tree6f91f97a0ff9a858258418511e04fdc28040b648 /www/wot.php
parent4fb0a50222de7e58a717ef6a78632f1f573183d4 (diff)
parent923efbdb9d77f2976d2eb6584a1bb922c0cfaf90 (diff)
downloadcacert-devel-ca4dc5c662667cb9da46fd72b6aa15521e3eafd2.tar.gz
cacert-devel-ca4dc5c662667cb9da46fd72b6aa15521e3eafd2.tar.xz
cacert-devel-ca4dc5c662667cb9da46fd72b6aa15521e3eafd2.zip
Merge remote-tracking branch 'origin/bug-985' into release
Diffstat (limited to 'www/wot.php')
-rw-r--r--www/wot.php64
1 files changed, 27 insertions, 37 deletions
diff --git a/www/wot.php b/www/wot.php
index d70f1d5..66bf7cb 100644
--- a/www/wot.php
+++ b/www/wot.php
@@ -16,6 +16,9 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ ?>
<?
+require_once("../includes/loggedin.php");
+require_once("../includes/lib/l10n.php");
+
function show_page($target,$message,$error)
{
@@ -83,43 +86,35 @@ function show_page($target,$message,$error)
function send_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 .= _("CAcert Support Team")."\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";
-
+
+ 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.");
}
-
-
- require_once("../includes/loggedin.php");
-
loadem("account");
if(array_key_exists('date',$_POST) && $_POST['date'] != "")
$_SESSION['_config']['date'] = $_POST['date'];
@@ -322,13 +317,9 @@ $iecho= "c";
$_SESSION['profile']['points'] += $addpoints;
}
- if($_SESSION['_config']['notarise']['language'] != "")
- {
- $userlang = $_SESSION['_config']['notarise']['language'];
- putenv("LANG=".$userlang);
- setlocale(LC_ALL, $userlang);
- }
-
+ $my_translation = L10n::get_translation();
+ L10n::set_translation($_SESSION['_config']['notarise']['language']);
+
$body = sprintf(_("You are receiving this email because you have been assured by %s %s (%s)."), $_SESSION['profile']['fname'], $_SESSION['profile']['lname'], $_SESSION['profile']['email'])."\n\n";
if($_POST['points'] != $newpoints)
$body .= sprintf(_("You were issued %s points however the system has rounded this down to %s and you now have %s points in total."), $_POST['points'], $newpoints, ($newpoints + $drow['total']))."\n\n";
@@ -359,8 +350,7 @@ $iecho= "c";
sendmail($_SESSION['_config']['notarise']['email'], "[CAcert.org] "._("You've been Assured."), $body, "support@cacert.org", "", "", "CAcert Website");
- putenv("LANG=".$_SESSION['profile']['language']);
- setlocale(LC_ALL, $_SESSION['profile']['language']);
+ L10n::set_translation($my_translation);
$body = sprintf(_("You are receiving this email because you have assured %s %s (%s)."), $_SESSION['_config']['notarise']['fname'], $_SESSION['_config']['notarise']['lname'], $_SESSION['_config']['notarise']['email'])."\n\n";
if($_POST['points'] != $newpoints)