summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML
diff options
context:
space:
mode:
authorAndjelko Horvat <comel@vingd.com>2013-01-08 11:56:19 +0000
committerAndjelko Horvat <comel@vingd.com>2013-01-08 11:56:19 +0000
commitc74c356ff4dfa80ff5cfd5aec754d0775a28e116 (patch)
treea6cf7d2a153a6f7186ce5b6914f47cfdf2b3ac37 /lib/SimpleSAML
parent50b177833c222d41d195398cb48efb476e1ea2ef (diff)
downloadsimplesamlphp-c74c356ff4dfa80ff5cfd5aec754d0775a28e116.zip
simplesamlphp-c74c356ff4dfa80ff5cfd5aec754d0775a28e116.tar.gz
simplesamlphp-c74c356ff4dfa80ff5cfd5aec754d0775a28e116.tar.bz2
SimpleSAML_XHTML_Template: add language parameter options (issue #530).
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3217 44740490-163a-0410-bde0-09ae8108e29a
Diffstat (limited to 'lib/SimpleSAML')
-rw-r--r--lib/SimpleSAML/XHTML/Template.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index b58af7e..9bb4759 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -39,6 +39,12 @@ class SimpleSAML_XHTML_Template {
/**
+ * HTTP GET language parameter name.
+ */
+ private $languageParameterName = 'language';
+
+
+ /**
* Constructor
*
* @param $configuration Configuration object
@@ -52,9 +58,10 @@ class SimpleSAML_XHTML_Template {
$this->data['baseurlpath'] = $this->configuration->getBaseURL();
$this->availableLanguages = $this->configuration->getArray('language.available', array('en'));
-
- if (isset($_GET['language'])) {
- $this->setLanguage($_GET['language']);
+
+ $this->languageParameterName = $this->configuration->getString('language.parameter.name', 'language');
+ if (isset($_GET[$this->languageParameterName])) {
+ $this->setLanguage($_GET[$this->languageParameterName], $this->configuration->getBoolean('language.parameter.setcookie', TRUE));
}
if($defaultDictionary !== NULL && substr($defaultDictionary, -4) === '.php') {