summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2013-05-01 15:55:21 +0200
committerBenny Baumann <BenBE@geshi.org>2013-05-01 15:55:21 +0200
commit1d7ef5fbcbde6ee830774ee472865080081ab064 (patch)
treeda4f20167ebdf6a29e8a72d86daa4bbc92d105e2
parentf6744f8ecb4e82f88ed1e8063f7c0e13c4d41408 (diff)
parenta6ae837dfcec95fa6eea25c64f3101ed25d0472a (diff)
downloadcacert-devel-1d7ef5fbcbde6ee830774ee472865080081ab064.tar.gz
cacert-devel-1d7ef5fbcbde6ee830774ee472865080081ab064.tar.xz
cacert-devel-1d7ef5fbcbde6ee830774ee472865080081ab064.zip
Merge branch 'bug-28' into testserver-stable
Conflicts: www/disputes.php
-rw-r--r--includes/account.php5
-rw-r--r--includes/lib/l10n.php8
-rwxr-xr-xscripts/cron/warning.php3
-rw-r--r--www/disputes.php8
-rw-r--r--www/wot.php5
5 files changed, 25 insertions, 4 deletions
diff --git a/includes/account.php b/includes/account.php
index 46de17e..f98f67c 100644
--- a/includes/account.php
+++ b/includes/account.php
@@ -2612,7 +2612,8 @@
$row = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='".intval($_REQUEST['userid'])."'"));
printf(_("The password for %s has been updated successfully in the system."), sanitizeHTML($row['email']));
-
+ $my_translation = L10n::get_translation();
+ L10n::set_translation(get_recipient_language(intval($_REQUEST['userid'])));
$body = sprintf(_("Hi %s,"),$row['fname'])."\n\n";
$body .= _("You are receiving this email because a CAcert administrator ".
"has changed the password on your account.")."\n\n";
@@ -2621,7 +2622,7 @@
sendmail($row['email'], "[CAcert.org] "._("Password Update Notification"), $body,
"support@cacert.org", "", "", "CAcert Support");
-
+ L10n::set_translation($my_translation);
}
showfooter();
exit;
diff --git a/includes/lib/l10n.php b/includes/lib/l10n.php
index 85b7aff..f834fd0 100644
--- a/includes/lib/l10n.php
+++ b/includes/lib/l10n.php
@@ -340,4 +340,12 @@ class L10n {
bindtextdomain($domain, $_SESSION['_config']['filepath'].'/locale');
textdomain($domain);
}
+
+ function get_recipient_language($accoundid){
+//returns the language of a recipient to make sure that the language is correct
+//use together with
+ $query = "select * from `users` where `id`='".$id:"'";
+ $res = mysql_query($query);
+ $row = mysql_fetch_assoc($res);
+ return $row['language'];
} \ No newline at end of file
diff --git a/scripts/cron/warning.php b/scripts/cron/warning.php
index 0c97ba2..e028249 100755
--- a/scripts/cron/warning.php
+++ b/scripts/cron/warning.php
@@ -18,6 +18,7 @@
*/
require_once(dirname(__FILE__).'/../../includes/mysql.php');
+ require_once(dirname(__FILE__).'/../../includes/lib/l10n.php');
$days = array("1" => "3", "15" => "2", "30" => "1", "45" => "0");
@@ -34,6 +35,7 @@
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
+ L10n::set_translation(get_recipient_language(intval(.$row['id')));
if($row['subject'] == "")
{
$row['crt_name'] = str_replace("../", "www/", $row['crt_name']);
@@ -106,6 +108,7 @@ echo $row['fname']." ".$row['lname']." <".$row['email']."> (memid: ".$row['memid
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
+ L10n::set_translation(get_recipient_language(intval(.$row['memid')));
if($row['subject'] == "")
$row['subject'] = $row['CN'];
diff --git a/www/disputes.php b/www/disputes.php
index a2ca3e2..af8a6a5 100644
--- a/www/disputes.php
+++ b/www/disputes.php
@@ -18,6 +18,7 @@
<?
require_once("../includes/loggedin.php");
require_once("../includes/temp_functions.php");
+ require_once("../includes/lib/l10n.php");
loadem("account");
@@ -270,11 +271,15 @@
`IP`='".$_SERVER['REMOTE_ADDR']."'";
mysql_query($query);
+ $my_translation = L10n::get_translation();
+ L10n::set_translation(get_recipient_language($oldmemid));
+
$body = sprintf(_("You have been sent this email as the email address '%s' is being disputed. You have the option to accept or reject this request, after 2 days the request will automatically be discarded. Click the following link to accept or reject the dispute:"), $email)."\n\n";
$body .= "https://".$_SESSION['_config']['normalhostname']."/disputes.php?type=email&emailid=$emailid&hash=$hash\n\n";
$body .= _("Best regards")."\n"._("CAcert.org Support!");
sendmail($email, "[CAcert.org] "._("Dispute Probe"), $body, "support@cacert.org", "", "", "CAcert Support");
+ L10n::set_translation($my_translation);
showheader(_("Email Dispute"));
printf(_("The email address '%s' has been entered into the dispute system, the email address will now be sent an email which will give the recipent the option of accepting or rejecting the request, if after 2 days we haven't received a valid response for or against we will discard the request."), sanitizeHTML($email));
@@ -414,10 +419,13 @@
$query = "insert into `disputedomain` set `domain`='$domain',`memid`='".$_SESSION['profile']['id']."',
`oldmemid`='$oldmemid',`created`=NOW(),`hash`='$hash',`id`='$domainid'";
mysql_query($query);
+ $my_translation = L10n::get_translation();
+ L10n::set_translation(get_recipient_language($oldmemid));
$body = sprintf(_("You have been sent this email as the domain '%s' is being disputed. You have the option to accept or reject this request, after 2 days the request will automatically be discarded. Click the following link to accept or reject the dispute:"), $domain)."\n\n";
$body .= "https://".$_SESSION['_config']['normalhostname']."/disputes.php?type=domain&domainid=$domainid&hash=$hash\n\n";
$body .= _("Best regards")."\n"._("CAcert.org Support!");
+ L10n::set_translation(get_recipient_language($my_translation));
sendmail($authaddy, "[CAcert.org] "._("Dispute Probe"), $body, "support@cacert.org", "", "", "CAcert Support");
diff --git a/www/wot.php b/www/wot.php
index 6e368fa..9514400 100644
--- a/www/wot.php
+++ b/www/wot.php
@@ -21,7 +21,6 @@ require_once("../includes/lib/l10n.php");
require_once("../includes/wot.inc.php");
-
function show_page($target,$message,$error)
{
showheader(_("My CAcert.org Account!"));
@@ -445,9 +444,11 @@ $iecho= "c";
if($_SESSION['profile']['board'] == 1 && intval($_POST['expire']) > 0)
{
+ $my_translation = L10n::get_translation();
+ L10n::set_translation('en_AU');
$body = sprintf("%s %s (%s) has issued a temporary increase to 200 points for %s %s (%s) for %s days. This action was sponsored by %s %s (%s).", $_SESSION['profile']['fname'], $_SESSION['profile']['lname'], $_SESSION['profile']['email'], $_SESSION['_config']['notarise']['fname'], $_SESSION['_config']['notarise']['lname'], $_SESSION['_config']['notarise']['email'], intval($_POST['expire']), $sponsor['fname'], $sponsor['lname'], $sponsor['email'])."\n\n";
-
sendmail("cacert-board@lists.cacert.org", "[CAcert.org] Temporary Increase Issued.", $body, "website@cacert.org", "", "", "CAcert Website");
+ L10n::set_translation($my_translation);
}
showheader(_("My CAcert.org Account!"));