diff options
| -rw-r--r-- | edituser.php | 4 | ||||
| -rw-r--r-- | includes/session.php | 6 | ||||
| -rw-r--r-- | library/WT/I18N.php | 8 | ||||
| -rw-r--r-- | login.php | 4 |
4 files changed, 12 insertions, 10 deletions
diff --git a/edituser.php b/edituser.php index 4edb695f20..376ff60147 100644 --- a/edituser.php +++ b/edituser.php @@ -76,9 +76,9 @@ if ($form_action=='update') { setUserFullName(WT_USER_ID, $form_realname); setUserEmail (WT_USER_ID, $form_email); set_user_setting(WT_USER_ID, 'theme', $form_theme); - $_SESSION['theme_dir']=$form_theme; // switch to the new theme right away + $WT_SESSION->theme_dir=$form_theme; // switch to the new theme right away set_user_setting(WT_USER_ID, 'language', $form_language); - $_SESSION['locale']=$form_language; // switch to the new language right away + $WT_SESSION->locale=$form_language; // switch to the new language right away set_user_setting(WT_USER_ID, 'contactmethod', $form_contact_method); set_user_setting(WT_USER_ID, 'visibleonline', $form_visible_online); set_user_gedcom_setting(WT_USER_ID, WT_GED_ID, 'rootid', $form_rootid); diff --git a/includes/session.php b/includes/session.php index f9462945b9..ed826499f1 100644 --- a/includes/session.php +++ b/includes/session.php @@ -485,8 +485,8 @@ if (substr(WT_SCRIPT_NAME, 0, 5)=='admin' || WT_SCRIPT_NAME=='module.php' && sub $THEME_DIR=safe_GET('theme', get_theme_names()); unset($_GET['theme']); // Last theme used? - if (!$THEME_DIR && isset($_SESSION['theme_dir']) && in_array($_SESSION['theme_dir'], get_theme_names())) { - $THEME_DIR=$_SESSION['theme_dir']; + if (!$THEME_DIR && in_array($WT_SESSION->theme_dir, get_theme_names())) { + $THEME_DIR=$WT_SESSION->theme_dir; } } else { $THEME_DIR=''; @@ -511,7 +511,7 @@ if (substr(WT_SCRIPT_NAME, 0, 5)=='admin' || WT_SCRIPT_NAME=='module.php' && sub define('WT_THEME_DIR', WT_THEMES_DIR.$THEME_DIR.'/'); // Remember this setting if (WT_THEME_DIR!=WT_THEMES_DIR.'_administration/') { - $_SESSION['theme_dir']=$THEME_DIR; + $WT_SESSION->theme_dir=$THEME_DIR; } } // If we have specified a CDN, use it for static theme resources diff --git a/library/WT/I18N.php b/library/WT/I18N.php index 0e10de765a..a3c40b9531 100644 --- a/library/WT/I18N.php +++ b/library/WT/I18N.php @@ -40,6 +40,8 @@ class WT_I18N { // Initialise the translation adapter with a locale setting. // If null is passed, work out which language is needed from the environment. static public function init($locale=null) { + global $WT_SESSION; + // The translation libraries work much faster with a cache. Try to create one. if (!is_dir(WT_DATA_DIR.DIRECTORY_SEPARATOR.'cache')) { // We may not have permission - especially during setup, before we instruct @@ -63,9 +65,9 @@ class WT_I18N { if (WT_USER_ID) { set_user_setting(WT_USER_ID, 'language', $locale); } - } elseif (isset($_SESSION['locale']) && array_key_exists($_SESSION['locale'], $installed_languages)) { + } elseif (array_key_exists($WT_SESSION->locale, $installed_languages)) { // Rembered from a previous visit? - $locale=$_SESSION['locale']; + $locale=$WT_SESSION->locale; } else { // Browser preference takes priority over gedcom default if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { @@ -104,7 +106,7 @@ class WT_I18N { } } // We now have a valid locale. Remember it. - $_SESSION['locale']=$locale; + $WT_SESSION->locale=$locale; // Load the translation file $translate=new Zend_Translate('gettext', WT_ROOT.'language/'.$locale.'.mo', $locale); @@ -70,8 +70,8 @@ if ($action=='login') { $_SESSION['usertime']=time(); } $_SESSION['timediff']=time()-$_SESSION['usertime']; - $_SESSION['locale']=get_user_setting($user_id, 'language'); - $_SESSION['theme_dir']=get_user_setting($user_id, 'theme'); + $WT_SESSION->locale =get_user_setting($user_id, 'language'); + $WT_SESSION->theme_dir=get_user_setting($user_id, 'theme'); // If we have no access rights to the current gedcom, switch to one where we do if (!userIsAdmin($user_id)) { |
