diff --git a/include/lassospkit_endpoints.inc.php b/include/lassospkit_endpoints.inc.php index 33889b0..776a1a4 100644 --- a/include/lassospkit_endpoints.inc.php +++ b/include/lassospkit_endpoints.inc.php @@ -65,40 +65,46 @@ class LassoSPKitEndpoint extends LassoSPKitUrlDispatch { } /** Profiles initiés par l'IdP */ function sloBrws() { + $ret = 0; try { $profile = $this->getProfileObject(); $http_method = $this->limitMethodBrws($this->identifyHttpMethod()); $query_string = $this->getQueryString($http_method); - return $profile->processRequestSLO($http_method, $query_string); + $ret = $profile->processRequestSLO($http_method, $query_string); } catch (LassoError $e) { - return $e->getCode(); + $ret = $e->getCode(); } catch (Exception $e) { - return -1; + $ret = -1; } + return $this->handleSlo($ret); } function sloSoap() { + $ret = 0; try { $profile = $this->getProfileObject(); - return $profile->processSOAPRequestSLO(); + $ret = $profile->processSOAPRequestSLO(); } catch (LassoError $e) { lassospkit_debuglog('Critical error: ' . $e); - return $e->getCode(); + $ret = $e->getCode(); } catch (Exception $e) { - return -1; + $ret = -1; } + return $this->handleSlo($ret); } /** Profiles initiés par le SP */ function sloReturn() { + $ret = 0; try { $profile = $this->getProfileObject(); $http_method = $this->limitMethodBrws($this->identifyHttpMethod()); $query_string = $this->getQueryString($http_method); - return $profile->processResponseSLO($http_method, $query_string); + $ret = $profile->processResponseSLO($http_method, $query_string); } catch (LassoError $e) { - return $e->getCode(); + $ret = $e->getCode(); } catch (Exception $e) { - return -1; + $ret = -1; } + return $this->handlSloReturn($ret); } function identifyHttpMethod() { if (isset($_POST) && ( isset($_POST['SAMLResponse']) || isset($_POST['SAMLRequest']))) { @@ -138,5 +144,11 @@ class LassoSPKitEndpoint extends LassoSPKitUrlDispatch { } return LASSO_HTTP_METHOD_NONE; } + function handleSlo($ret) { + return $ret; + } + function handleSloReturn($ret) { + return $ret; + } } diff --git a/include/lassospkit_saml2_endpoint.inc.php b/include/lassospkit_saml2_endpoint.inc.php index 811be5f..4d25641 100644 --- a/include/lassospkit_saml2_endpoint.inc.php +++ b/include/lassospkit_saml2_endpoint.inc.php @@ -39,18 +39,23 @@ class LassoSPKitSaml2Endpoint extends LassoSPKitEndpoint { // TODO } function nameIdManagementSoap() { + $ret = 0; try { $profile = $this->getProfileObject(); - return $profile->processSOAPRequestNameIdManagement(); + $ret = $profile->processSOAPRequestNameIdManagement(); } catch (LassoError $e) { lassospkit_debuglog('Critical error: ' . $e); - return $e->getCode(); + $ret = $e->getCode(); } catch (Exception $e) { lassospkit_debuglog('Unkown exception error: ' . $e); - return -1; + $ret = -1; } + return $this->handleNameIdManagement($ret); } function nameIdManagementReturn() { // TODO } + function handleNameIdManagement($ret) { + return $ret; + } }