Skip to content
Snippets Groups Projects
Commit eaae2297 authored by Olav Morken's avatar Olav Morken
Browse files

IdPDisco: Allow override of saving the last IdP chosen.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2531 44740490-163a-0410-bde0-09ae8108e29a
parent 78ecc970
No related branches found
No related tags found
No related merge requests found
...@@ -351,6 +351,19 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -351,6 +351,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. * Determine whether the choice of IdP should be saved.
* *
...@@ -380,9 +393,7 @@ class SimpleSAML_XHTML_IdPDisco { ...@@ -380,9 +393,7 @@ class SimpleSAML_XHTML_IdPDisco {
$idp = $this->getSelectedIdP(); $idp = $this->getSelectedIdP();
if($idp !== NULL) { if($idp !== NULL) {
/* The user selected this IdP. Save the choice in a cookie. */ /* The user selected this IdP. Save the choice in a cookie. */
$this->setPreviousIdP($idp);
$this->log('Choice made [' . $idp . '] Setting cookie.');
$this->setCookie('lastidp', $idp);
if($this->saveIdP()) { if($this->saveIdP()) {
$this->setCookie('remember', 1); $this->setCookie('remember', 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment