summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Morken <olav.morken@uninett.no>2010-09-08 07:04:29 +0000
committerOlav Morken <olav.morken@uninett.no>2010-09-08 07:04:29 +0000
commiteaae2297887204d50b5b288b775a03573d4ab00c (patch)
tree40e04113fe05b8cca025395444165f1d61ef552c
parent78ecc970f174a1a2204e99d7b8dde55998647175 (diff)
downloadsimplesamlphp-eaae2297887204d50b5b288b775a03573d4ab00c.zip
simplesamlphp-eaae2297887204d50b5b288b775a03573d4ab00c.tar.gz
simplesamlphp-eaae2297887204d50b5b288b775a03573d4ab00c.tar.bz2
IdPDisco: Allow override of saving the last IdP chosen.
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2531 44740490-163a-0410-bde0-09ae8108e29a
-rw-r--r--lib/SimpleSAML/XHTML/IdPDisco.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/SimpleSAML/XHTML/IdPDisco.php b/lib/SimpleSAML/XHTML/IdPDisco.php
index b8e9c28..8877555 100644
--- a/lib/SimpleSAML/XHTML/IdPDisco.php
+++ b/lib/SimpleSAML/XHTML/IdPDisco.php
@@ -352,6 +352,19 @@ class SimpleSAML_XHTML_IdPDisco {
/**
+ * Save the current IdP choice to a cookie.
+ *
+ * @param string $idp The entityID of the IdP.
+ */
+ protected function setPreviousIdP($idp) {
+ assert('is_string($idp)');
+
+ $this->log('Choice made [' . $idp . '] Setting cookie.');
+ $this->setCookie('lastidp', $idp);
+ }
+
+
+ /**
* Determine whether the choice of IdP should be saved.
*
* @return TRUE if the choice should be saved, FALSE if not.
@@ -380,9 +393,7 @@ class SimpleSAML_XHTML_IdPDisco {
$idp = $this->getSelectedIdP();
if($idp !== NULL) {
/* The user selected this IdP. Save the choice in a cookie. */
-
- $this->log('Choice made [' . $idp . '] Setting cookie.');
- $this->setCookie('lastidp', $idp);
+ $this->setPreviousIdP($idp);
if($this->saveIdP()) {
$this->setCookie('remember', 1);