diff --git a/e107_admin/auth.php b/e107_admin/auth.php index 465ded6a2..6c6a0794d 100644 --- a/e107_admin/auth.php +++ b/e107_admin/auth.php @@ -24,7 +24,7 @@ define('e_CAPTCHA_FONTCOLOR','#F9A533'); // Required for a clean v1.x -> v2 upgrade. $core = e107::getConfig('core'); -if($core->get('admintheme') != 'bootstrap' && $core->get('admintheme') != 'bootstrap3') +if($core->get('admintheme') != 'bootstrap3') { $core->update('admintheme','bootstrap3'); $core->update('adminstyle','infopanel'); @@ -35,7 +35,7 @@ if($core->get('admintheme') != 'bootstrap' && $core->get('admintheme') != 'boots } // Check Admin-Perms for current language and redirect if necessary. -if(USER && !getperms('0') && vartrue($pref['multilanguage']) && !getperms(e_LANGUAGE)) +if(USER && !getperms('0') && vartrue($pref['multilanguage']) && !getperms(e_LANGUAGE) && empty($_E107['no_language_perm_check'])) { $lng = e107::getLanguage(); diff --git a/e107_handlers/language_class.php b/e107_handlers/language_class.php index ad2d26b3b..010637838 100644 --- a/e107_handlers/language_class.php +++ b/e107_handlers/language_class.php @@ -278,17 +278,27 @@ class language{ } global $pref; - + if(!$lang) { return (ADMIN_AREA && vartrue($pref['adminlanguage'])) ? $pref['adminlanguage'] : $pref['sitelanguage']; } - + if(strpos($lang,"debug")!==false) { return false; } - + + if($lang == 'E_SITELANGUAGE') // allows for overriding language using a scripted 'define' before class2.php is loaded. + { + $lang = $pref['sitelanguage']; + } + + if($lang == 'E_ADMINLANGUAGE') + { + $lang = $pref['adminlanguage']; + } + if(strlen($lang)== 2) { $iso = $lang; @@ -453,12 +463,13 @@ class language{ /** * Detect a Language Change - * 0. Parked Domain eg. http://mylanguagedomain.com - * 1. Parked subDomain eg. http://es.mydomain.com (Preferred for SEO) - * 2. e_MENU Query eg. /index.php?[es] - * 3. $_GET['elan'] eg. /index.php?elan=es - * 4. $_POST['sitelanguage'] eg. - * 5. $GLOBALS['elan'] eg. + * 7. $GLOBALS['elan'] eg. detect && !$force) return $this->detect; $this->_cookie_domain = ''; - if(vartrue($pref['multilanguage_subdomain']) && $this->isLangDomain(e_DOMAIN) && (defset('MULTILANG_SUBDOMAIN') !== false)) + if(defined('e_PAGE_LANGUAGE') && ($detect_language = $this->isValid(e_PAGE_LANGUAGE))) // page specific override. + { + // Do nothing as $detect_language is set. + } + elseif(vartrue($pref['multilanguage_subdomain']) && $this->isLangDomain(e_DOMAIN) && (defset('MULTILANG_SUBDOMAIN') !== false)) { $detect_language = (e_SUBDOMAIN) ? $this->isValid(e_SUBDOMAIN) : $pref['sitelanguage']; // Done in session handler now, based on MULTILANG_SUBDOMAIN value