From d69afdc25d3531ff7663356c934aaf31723e7a69 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Mon, 12 Jul 2010 08:00:45 +0000
Subject: [PATCH] core:LanguageAdaptor: Use set/getLanguageCookie.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2411 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/core/lib/Auth/Process/LanguageAdaptor.php | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/modules/core/lib/Auth/Process/LanguageAdaptor.php b/modules/core/lib/Auth/Process/LanguageAdaptor.php
index 922be0584..5cc4f6be8 100644
--- a/modules/core/lib/Auth/Process/LanguageAdaptor.php
+++ b/modules/core/lib/Auth/Process/LanguageAdaptor.php
@@ -45,9 +45,7 @@ class sspmod_core_Auth_Process_LanguageAdaptor extends SimpleSAML_Auth_Processin
 		if (array_key_exists($this->langattr, $attributes))
 			$attrlang = $attributes[$this->langattr][0];
 
-		$config = SimpleSAML_Configuration::getInstance();
-		$t = new SimpleSAML_XHTML_Template($config, 'frontpage');
-		$lang = $t->getLanguage(FALSE, FALSE);
+		$lang = SimpleSAML_XHTML_Template::getLanguageCookie();
 
 
 		if (isset($attrlang))
@@ -58,8 +56,7 @@ class sspmod_core_Auth_Process_LanguageAdaptor extends SimpleSAML_Auth_Processin
 
 		if (isset($attrlang) && !isset($lang)) {
 			/* Language set in attribute but not in cookie - update cookie. */
-			$t->setLanguage($attrlang);
-			$_GET['language'] = $attrlang;
+			SimpleSAML_XHTML_Template::setLanguageCookie($attrlang);
 		} elseif (!isset($attrlang) && isset($lang)) {
 			/* Language set in cookie, but not in attribute. Update attribute. */
 			$request['Attributes'][$this->langattr] = array($lang);
-- 
GitLab