diff options
author | INOPIAE <inopiae@cacert.org> | 2012-12-15 16:41:36 +0100 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2013-05-01 15:50:25 +0200 |
commit | 44ef98610497de881a8a6207f2c6ef82c41f0a4f (patch) | |
tree | 6ec00c4486428eeac19595eedf58078893a3066b | |
parent | 7baaa9a0ac611329539a43031ca3d0e81bba2b5f (diff) | |
download | cacert-devel-44ef98610497de881a8a6207f2c6ef82c41f0a4f.tar.gz cacert-devel-44ef98610497de881a8a6207f2c6ef82c41f0a4f.tar.xz cacert-devel-44ef98610497de881a8a6207f2c6ef82c41f0a4f.zip |
bug 28: created a new function to find the lanugae of the reciepient in temp_function1.php, modifieded www/disputes.php, www/wot.php and includes/account.php with the new function call.
Later the function from temp_function1.php should be moved to notary_inc.php???
-rw-r--r-- | includes/account.php | 6 | ||||
-rw-r--r-- | includes/temp_function1.php | 14 | ||||
-rw-r--r-- | www/disputes.php | 8 | ||||
-rw-r--r-- | www/wot.php | 6 |
4 files changed, 30 insertions, 4 deletions
diff --git a/includes/account.php b/includes/account.php index 4faa0e5..a89d620 100644 --- a/includes/account.php +++ b/includes/account.php @@ -18,6 +18,7 @@ require_once("../includes/loggedin.php"); require_once("../includes/lib/l10n.php"); require_once('lib/check_weak_key.php'); + require_once("../includes/temp-function1.php"); loadem("account"); @@ -2612,7 +2613,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 +2623,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/temp_function1.php b/includes/temp_function1.php new file mode 100644 index 0000000..ce6854e --- /dev/null +++ b/includes/temp_function1.php @@ -0,0 +1,14 @@ +<?php +function get_recipient_language($accoundid){ +//returns the language of a recipient to make sure that the language is correct +//use together with +// $my_translation = L10n::get_translation(); +// L10n::set_translation($_SESSION['_config']['notarise']['language']); +// L10n::set_translation($my_translation); + $query = "select * from `users` where `id`='".$id:"'"; + $res = mysql_query($query); + $row = mysql_fetch_assoc($res); + return $row['language']; + +} +?> diff --git a/www/disputes.php b/www/disputes.php index 5b78c1e..2fa015d 100644 --- a/www/disputes.php +++ b/www/disputes.php @@ -17,6 +17,7 @@ */ ?> <? require_once("../includes/loggedin.php"); + require_once("../includes/temp-function1.php"); loadem("account"); @@ -284,11 +285,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)); @@ -419,10 +424,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 c6c0568..c5a442c 100644 --- a/www/wot.php +++ b/www/wot.php @@ -18,7 +18,7 @@ <? require_once("../includes/loggedin.php"); require_once("../includes/lib/l10n.php"); - + require_once("../includes/temp-function1.php"); function show_page($target,$message,$error) { @@ -371,9 +371,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!")); |