add try catch in _soap_ methods

This commit is contained in:
<bdauvergne@entrouvert.com> 1210078415 +0200 0001-01-01 00:00:00 +00:00
parent 1d9f9d80b7
commit 8d6f23e344
1 changed files with 16 additions and 8 deletions

View File

@ -168,10 +168,14 @@ function lassospkit_get_assertion_attributes() {
to find one session return an error code.
*/
function lassospkit_soap_logout() {
$session_class = "LassoSPKit" . LassoSPKitConfig::get('session');
$session = new $session_class();
$saml2 = new LassoSPKitSAML2($session);
$ret = $saml2->initiateSLO(LASSO_HTTP_METHOD_SOAP);
try {
$session_class = "LassoSPKit" . LassoSPKitConfig::get('session');
$session = new $session_class();
$saml2 = new LassoSPKitSAML2($session);
$ret = $saml2->initiateSLO(LASSO_HTTP_METHOD_SOAP);
} catch (LassoError $e) {
$ret = $e->getCode();
}
return $ret;
}
@ -180,10 +184,14 @@ function lassospkit_soap_logout() {
the userId associated to the nameId. If it is still impossible
to find ones identity return an error code. */
function lassospkit_soap_defederate() {
$session_class = "LassoSPKit" . LassoSPKitConfig::get('session');
$session = new $session_class();
$saml2 = new LassoSPKitSAML2($session);
$ret = $saml2->initiateFTNotification(LASSO_HTTP_METHOD_SOAP);
try {
$session_class = "LassoSPKit" . LassoSPKitConfig::get('session');
$session = new $session_class();
$saml2 = new LassoSPKitSAML2($session);
$ret = $saml2->initiateFTNotification(LASSO_HTTP_METHOD_SOAP);
} catch (LassoError $e) {
$ret = $e->getCode();
}
lassospkit_clean();
return $ret;
}