summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/XHTML
diff options
context:
space:
mode:
authorJaime Perez Crespo <jaime.perez@uninett.no>2015-08-05 16:51:07 +0200
committerJaime Perez Crespo <jaime.perez@uninett.no>2015-08-05 16:51:07 +0200
commit0a856dff37bc84d56c2095f7351c23a2b1a3fbf8 (patch)
tree6d6b231f5fa30e8f4783f78f4b2144c924ab03ce /lib/SimpleSAML/XHTML
parent34cc8fb30aac0be4518398a01e253987d6d6daef (diff)
downloadsimplesamlphp-0a856dff37bc84d56c2095f7351c23a2b1a3fbf8.zip
simplesamlphp-0a856dff37bc84d56c2095f7351c23a2b1a3fbf8.tar.gz
simplesamlphp-0a856dff37bc84d56c2095f7351c23a2b1a3fbf8.tar.bz2
Remove duplicated code.
Diffstat (limited to 'lib/SimpleSAML/XHTML')
-rw-r--r--lib/SimpleSAML/XHTML/IdPDisco.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/SimpleSAML/XHTML/IdPDisco.php b/lib/SimpleSAML/XHTML/IdPDisco.php
index f01e7f4..065e2e5 100644
--- a/lib/SimpleSAML/XHTML/IdPDisco.php
+++ b/lib/SimpleSAML/XHTML/IdPDisco.php
@@ -505,15 +505,14 @@ class SimpleSAML_XHTML_IdPDisco
/**
- * Handles a request to this discovery service.
+ * Check if an IdP is set or if the request is passive, and redirect accordingly.
*
- * The IdP disco parameters should be set before calling this function.
+ * @return void If there is no IdP targeted and this is not a passive request.
*/
- public function handleRequest()
+ protected function start()
{
$idp = $this->getTargetIdp();
if ($idp !== null) {
-
$extDiscoveryStorage = $this->config->getString('idpdisco.extDiscoveryStorage', null);
if ($extDiscoveryStorage !== null) {
$this->log('Choice made ['.$idp.'] (Forwarding to external discovery storage)');
@@ -530,15 +529,23 @@ class SimpleSAML_XHTML_IdPDisco
);
\SimpleSAML\Utils\HTTP::redirectTrustedURL($this->returnURL, array($this->returnIdParam => $idp));
}
-
- return;
}
if ($this->isPassive) {
$this->log('Choice not made. (Redirecting the user back without answer)');
\SimpleSAML\Utils\HTTP::redirectTrustedURL($this->returnURL);
- return;
}
+ }
+
+
+ /**
+ * Handles a request to this discovery service.
+ *
+ * The IdP disco parameters should be set before calling this function.
+ */
+ public function handleRequest()
+ {
+ $this->start();
// no choice made. Show discovery service page
$idpList = $this->getIdPList();