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

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
parent 7ac39cd3
No related branches found
No related tags found
No related merge requests found
......@@ -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.
*
......
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