From 1e258af4136567ab30ce9b54aee751077f80590e Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Tue, 8 May 2012 21:25:49 -0700 Subject: BUGFIX: removed side effect from getting the user's preferences: the language used could be overwritten by another user's choise the DB_get_Prefs($myid) functions used to set the _SESSION variable for the language, but was also called with ids that belonged to other players overwriting the language settings with that from another user --- digest.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'digest.php') diff --git a/digest.php b/digest.php index 4426bc2..0762519 100644 --- a/digest.php +++ b/digest.php @@ -45,13 +45,31 @@ global $defaulttimezone; foreach($users as $uid) { // get local time - $zone = DB_get_user_timezone($uid); date_default_timezone_set($zone); $time = (int)(date("H")); - // calculate mod by digest-time + // load users preferences $PREF = DB_get_PREF($uid); + + // set users language preference + $language = $PREF['language']; + + switch($language) + { + case 'de': + putenv("LC_ALL=de_DE"); + setlocale(LC_ALL, "de_DE"); + // Specify location of translation tables + bindtextdomain("edoko", "./locale"); + // Choose domain + textdomain("edoko"); + break; + default: + /* do nothing */ + } + + // calculate mod by digest-time switch($PREF['digest']) { case 'digest-off': -- cgit v1.2.3-18-g5258