From ab3e9d7967b8f2b60b052e0f484105c25252dfbc Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Fri, 6 Nov 2009 09:02:25 +0000 Subject: [PATCH] SAMLParser: Remove unused functions. The getEndpoints() and getDefaultEndpoint() functions are unused after switching to returning all endpoints in the metadata. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1974 44740490-163a-0410-bde0-09ae8108e29a --- lib/SimpleSAML/Metadata/SAMLParser.php | 60 -------------------------- 1 file changed, 60 deletions(-) diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php index ac1fc01cf..5e533ddc3 100644 --- a/lib/SimpleSAML/Metadata/SAMLParser.php +++ b/lib/SimpleSAML/Metadata/SAMLParser.php @@ -1208,66 +1208,6 @@ class SimpleSAML_Metadata_SAMLParser { } - /** - * This function attempts to locate all endpoints which supports one of the given bindings. - * - */ - private function getEndpoints($endpoints, $acceptedBindings = NULL) { - - assert('$acceptedBindings === NULL || is_array($acceptedBindings)'); - - /* Filter the list of endpoints if $acceptedBindings !== NULL. */ - if($acceptedBindings === NULL) return $endpoints; - - $newEndpoints = array(); - foreach($endpoints as $ep) { - /* Add it to the list of valid ACSs if it has one of the supported bindings. */ - if(in_array($ep['Binding'], $acceptedBindings, TRUE)) { - $newEndpoints[] = $ep; - } - } - return $newEndpoints; - } - - - /** - * This function attempts to locate the default endpoint which supports one of the given bindings. - * - * @param $endpoints Array with endpoints in the format returned by parseGenericEndpoint. - * @param $acceptedBindings Array with the accepted bindings. If this is NULL, then we accept any binding. - * @return The default endpoint which supports one of the bindings, or NULL if no endpoints supports - * one of the bindings. - */ - private function getDefaultEndpoint($endpoints, $acceptedBindings = NULL) { - - $endpoints = $this->getEndpoints($endpoints, $acceptedBindings); - - /* First we look for the endpoint with isDefault set to true. */ - foreach($endpoints as $ep) { - - if(array_key_exists('isDefault', $ep) && $ep['isDefault'] === TRUE) { - return $ep; - } - } - - /* Then we look for the first endpoint without isDefault set to FALSE. */ - foreach($endpoints as $ep) { - - if(!array_key_exists('isDefault', $ep)) { - return $ep; - } - } - - /* Then we take the first endpoint we find. */ - if(count($endpoints) > 0) { - return $endpoints[0]; - } - - /* If we reach this point, then we don't have any endpoints with the correct binding. */ - return NULL; - } - - /** * This function finds SP descriptors which supports one of the given protocols. * -- GitLab