Index: branches/5.3.x/core/units/languages/languages_item.php =================================================================== diff -u -N -r15483 -r15677 --- branches/5.3.x/core/units/languages/languages_item.php (.../languages_item.php) (revision 15483) +++ branches/5.3.x/core/units/languages/languages_item.php (.../languages_item.php) (revision 15677) @@ -1,6 +1,6 @@ Application->isAdmin && !defined('GW_NOTIFY') && preg_match('/[\/]{0,1}index.php[\/]{0,1}/', $_SERVER['PHP_SELF']) && - $this->Application->HttpQuery->isEmptyUrl() && $this->Application->ConfigValue('UseContentLanguageNegotiation') + !$this->Application->HttpQuery->refererIsOurSite() && $this->Application->ConfigValue('UseContentLanguageNegotiation') ) { $language_id = $this->processAcceptLanguage(); - if ($language_id != $this->GetID()) { + if ( $language_id != $this->GetID() ) { // redirect to same page with found language $url_params = Array ( 'm_cat_id' => 0, 'm_cat_page' => 1, 'm_lang' => $language_id, 'm_opener' => 's', 'pass' => 'm' ); + $this->_addLoginState($url_params); $exception = new kRedirectException('Redirect into language ID = ' . $language_id . ' according to "Accepted-Language" header "' . $_SERVER['HTTP_ACCEPT_LANGUAGE'] . '"'); $exception->setup('', $url_params); @@ -263,6 +264,26 @@ } /** + * Pass login state variables into new language url + * + * @param $url_params + * @return void + * @access protected + */ + protected function _addLoginState(&$url_params) + { + $pass_along = Array ('login', 'logout'); + + foreach ($pass_along as $pass_along_name) { + $pass_along_value = $this->Application->GetVar($pass_along_name); + + if ( $pass_along_value !== false ) { + $url_params[$pass_along_name] = $pass_along_value; + } + } + } + + /** * Checks, that language is enabled in site domain * * @param int $id