diff options
author | Benny Baumann <BenBE@geshi.org> | 2013-05-08 00:09:03 +0200 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2013-05-08 00:09:03 +0200 |
commit | 00606f8ec3347f9fa43352338a03fc1d8f8098f2 (patch) | |
tree | b8e8bd814839f575ef031aeed454872f10c7bd50 /includes | |
parent | f39ece18ca6c5736163f22b1da8cd8faac9105ae (diff) | |
parent | 06b04cd9e702279c371fd1d3f95fa22e08ffa49e (diff) | |
download | cacert-devel-00606f8ec3347f9fa43352338a03fc1d8f8098f2.tar.gz cacert-devel-00606f8ec3347f9fa43352338a03fc1d8f8098f2.tar.xz cacert-devel-00606f8ec3347f9fa43352338a03fc1d8f8098f2.zip |
Merge branch 'bug-28' into testserver-stable
Diffstat (limited to 'includes')
-rw-r--r-- | includes/account.php | 2 | ||||
-rw-r--r-- | includes/lib/l10n.php | 24 |
2 files changed, 17 insertions, 9 deletions
diff --git a/includes/account.php b/includes/account.php index f98f67c..05a0b62 100644 --- a/includes/account.php +++ b/includes/account.php @@ -2613,7 +2613,7 @@ 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']))); + 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"; diff --git a/includes/lib/l10n.php b/includes/lib/l10n.php index 8325f4c..9bb5d52 100644 --- a/includes/lib/l10n.php +++ b/includes/lib/l10n.php @@ -340,13 +340,21 @@ 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']; + public static function set_recipient_language($accoundid) { + //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 ($row['language']==Null || $row['language']=='') { + $this->set_translation('en'); + } else { + $this->set_translation($row['language']); + } + } else { + $this->set_translation('en'); + } + } } |