diff --git a/includes/account.php b/includes/account.php index e004ce2..26845cd 100644 --- a/includes/account.php +++ b/includes/account.php @@ -2780,7 +2780,8 @@ function buildSubjectFromSession() { $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_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"; @@ -2789,6 +2790,7 @@ function buildSubjectFromSession() { sendmail($row['email'], "[CAcert.org] "._("Password Update Notification"), $body, "support@cacert.org", "", "", "CAcert Support"); + L10n::set_translation($my_translation); } showfooter(); diff --git a/includes/lib/l10n.php b/includes/lib/l10n.php index e325add..4859946 100644 --- a/includes/lib/l10n.php +++ b/includes/lib/l10n.php @@ -355,4 +355,21 @@ class L10n { bindtextdomain($domain, $_SESSION['_config']['filepath'].'/locale'); textdomain($domain); } -} \ No newline at end of file + + public static function set_recipient_language($accountid) { + //returns the language of a recipient to make sure that the language is correct + //use together with + $query = "select `language` from `users` where `id`='".intval($accountid)."'"; + $res = mysql_query($query); + if (mysql_num_rows($res)>=0) { + $row = mysql_fetch_assoc($res); + if (NULL==$row['language'] || $row['language']=='') { + self::set_translation('en'); + } else { + self::set_translation($row['language']); + } + } else { + self::set_translation('en'); + } + } +} diff --git a/scripts/cron/warning.php b/scripts/cron/warning.php index db5da4f..59b1aa2 100755 --- a/scripts/cron/warning.php +++ b/scripts/cron/warning.php @@ -19,6 +19,7 @@ require_once(dirname(__FILE__).'/../../includes/mysql.php'); require_once(dirname(__FILE__).'/../../includes/lib/general.php'); + require_once(dirname(__FILE__).'/../../includes/lib/l10n.php'); $days = array("1" => "3", "15" => "2", "30" => "1", "45" => "0"); @@ -35,6 +36,7 @@ $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) { + L10n::set_recipient_language(intval($row['id'])); if($row['subject'] == "") { $row['crt_name'] = str_replace("../", "www/", $row['crt_name']); @@ -108,6 +110,7 @@ echo $row['fname']." ".$row['lname']." <".$row['email']."> (memid: ".$row['memid $res = mysql_query($query); while($row = mysql_fetch_assoc($res)) { + L10n::set_recipient_language(intval($row['memid'])); if($row['subject'] == "") $row['subject'] = $row['CN']; diff --git a/www/disputes.php b/www/disputes.php index 34a447a..96c7c75 100644 --- a/www/disputes.php +++ b/www/disputes.php @@ -18,6 +18,7 @@