ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Static Public Member Functions | |
static | getServerHTTPS () |
Retrieve HTTPS status from $_SERVER environment variables. More... | |
static | getServerPort () |
Retrieve the port number from $_SERVER environment variables. More... | |
static | checkSessionCookie ($retryURL=null) |
Check for session cookie, and show missing-cookie page if it is missing. More... | |
static | checkURLAllowed ($url, array $trustedSites=null) |
Check if a URL is valid and is in our list of allowed URLs. More... | |
static | fetch ($url, $context=array(), $getHeaders=false) |
Helper function to retrieve a file or URL with proxy support, also supporting proxy basic authorization. More... | |
static | getAcceptLanguage () |
This function parses the Accept-Language HTTP header and returns an associative array with each language and the score for that language. More... | |
static | guessBasePath () |
Try to guess the base SimpleSAMLphp path from the current request. More... | |
static | getBaseURL () |
Retrieve the base URL of the SimpleSAMLphp installation. More... | |
static | getFirstPathElement ($trailingslash=true) |
Retrieve the first element of the URL path. More... | |
static | getPOSTRedirectURL ($destination, $data) |
Create a link which will POST data. More... | |
static | getSelfHost () |
Retrieve our own host. More... | |
static | getSelfHostWithPath () |
Retrieve our own host together with the URL path. More... | |
static | getSelfURLNoQuery () |
Retrieve the current URL using the base URL in the configuration, without the query parameters. More... | |
static | isHTTPS () |
This function checks if we are using HTTPS as protocol. More... | |
static | normalizeURL ($url) |
Normalizes a URL to an absolute URL and validate it. More... | |
static | parseQueryString ($query_string) |
Parse a query string into an array. More... | |
static | redirectTrustedURL ($url, $parameters=array()) |
This function redirects to the specified URL without performing any security checks. More... | |
static | redirectUntrustedURL ($url, $parameters=array()) |
This function redirects to the specified URL after performing the appropriate security checks on it. More... | |
static | resolveURL ($url, $base=null) |
Resolve a (possibly relative) URL relative to a given base URL. More... | |
static | setCookie ($name, $value, $params=null, $throw=true) |
Set a cookie. More... | |
static | submitPOSTData ($destination, $data) |
Submit a POST form to a specific destination. More... | |
Static Private Member Functions | |
static | getSecurePOSTRedirectURL ($destination, $data) |
Obtain a URL where we can redirect to securely post a form with the given data to a specific destination. More... | |
static | getServerHost () |
Retrieve Host value from $_SERVER environment variables. More... | |
static | redirect ($url, $parameters=array()) |
This function redirects the user to the specified address. More... | |
static | savePOSTData (\SimpleSAML_Session $session, $destination, $data) |
Save the given HTTP POST data and the destination where it should be posted to a given session. More... | |
|
static |
Check for session cookie, and show missing-cookie page if it is missing.
string | null | $retryURL | The URL the user should access to retry the operation. Defaults to null. |
Definition at line 287 of file HTTP.php.
Referenced by SimpleSAML_Utilities\checkCookie(), sspmod_saml_IdP_SAML1\receiveAuthnRequest(), and sspmod_saml_IdP_SAML2\receiveAuthnRequest().
|
static |
Check if a URL is valid and is in our list of allowed URLs.
string | $url | The URL to check. |
array | $trustedSites | An optional white list of domains. If none specified, the 'trusted.url.domains' configuration directive will be used. |
Definition at line 322 of file HTTP.php.
Referenced by SimpleSAML_XHTML_IdPDisco\__construct().
|
static |
Helper function to retrieve a file or URL with proxy support, also supporting proxy basic authorization.
An exception will be thrown if we are unable to retrieve the data.
string | $url | The path or URL we should fetch. |
array | $context | Extra context options. This parameter is optional. |
boolean | $getHeaders | Whether to also return response headers. Optional. |
Definition at line 409 of file HTTP.php.
Referenced by sspmod_cas_Auth_Source_CAS\casServiceValidate(), sspmod_cas_Auth_Source_CAS\casValidate(), SimpleSAML\Bindings\Shib13\Artifact\extractResponse(), sspmod_authwindowslive_Auth_Source_LiveID\finalStep(), sspmod_metarefresh_MetaLoader\loadSource(), SimpleSAML_Metadata_SAMLParser\parseDescriptorsFile(), and SimpleSAML_Metadata_SAMLParser\parseFile().
|
static |
This function parses the Accept-Language HTTP header and returns an associative array with each language and the score for that language.
If a language includes a region, then the result will include both the language with the region and the language without the region.
The returned array will be in the same order as the input.
Definition at line 499 of file HTTP.php.
Referenced by SimpleSAML\Locale\Language\getHTTPLanguage().
|
static |
Retrieve the base URL of the SimpleSAMLphp installation.
The URL will always end with a '/'. For example: https://idp.example.org/simplesaml/
Definition at line 598 of file HTTP.php.
Referenced by SimpleSAML_Metadata_MetaDataStorageHandlerFlatFile\generateDynamicHostedEntityID(), SimpleSAML_Metadata_MetaDataStorageHandlerPdo\generateDynamicHostedEntityID(), and SimpleSAML_Error_Error\show().
|
static |
Retrieve the first element of the URL path.
boolean | $trailingslash | Whether to add a trailing slash to the element or not. Defaults to true. |
Definition at line 647 of file HTTP.php.
|
static |
Create a link which will POST data.
string | $destination | The destination URL. |
array | $data | The name-value pairs which will be posted to the destination. |
Definition at line 668 of file HTTP.php.
Referenced by SimpleSAML\Auth\Simple\login().
|
staticprivate |
Obtain a URL where we can redirect to securely post a form with the given data to a specific destination.
string | $destination | The destination URL. |
array | $data | An associative array containing the data to be posted to $destination. |
Definition at line 26 of file HTTP.php.
References $data, $destination, $id, $info, $session, $url, SimpleSAML\Utils\Crypto\aesEncrypt(), array, SimpleSAML\Module\getModuleURL(), and SimpleSAML_Session\getSessionFromRequest().
|
static |
Retrieve our own host.
E.g. www.example.com
Definition at line 699 of file HTTP.php.
Referenced by SimpleSAML_Metadata_MetaDataStorageHandler\getMetaDataCurrentEntityID(), SimpleSAML\Auth\Simple\getProcessedURL(), and SimpleSAML_Metadata_MetaDataStorageSource\lookupIndexFromEntityId().
|
static |
Retrieve our own host together with the URL path.
Please note this function will return the base URL for the current SP, as defined in the global configuration.
Definition at line 738 of file HTTP.php.
Referenced by SimpleSAML_Metadata_MetaDataStorageHandler\getMetaDataCurrentEntityID().
|
static |
Retrieve the current URL using the base URL in the configuration, without the query parameters.
Definition at line 846 of file HTTP.php.
Referenced by sspmod_saml_Message\processAssertion(), sspmod_saml_Message\processResponse(), and SimpleSAML_Error_Error\saveError().
|
staticprivate |
Retrieve Host value from $_SERVER environment variables.
Definition at line 54 of file HTTP.php.
References $_SERVER, and $current.
|
static |
Retrieve HTTPS status from $_SERVER environment variables.
Definition at line 84 of file HTTP.php.
References $_SERVER.
Referenced by SimpleSAML\Auth\Simple\getProcessedURL().
|
static |
Retrieve the port number from $_SERVER environment variables.
Definition at line 109 of file HTTP.php.
References $_SERVER.
Referenced by SimpleSAML\Auth\Simple\getProcessedURL().
|
static |
Try to guess the base SimpleSAMLphp path from the current request.
This method offers just a guess, so don't rely on it.
Definition at line 563 of file HTTP.php.
Referenced by SimpleSAML\Error\CriticalConfigurationError\__construct(), and SimpleSAML_Configuration\getBasePath().
|
static |
|
static |
Normalizes a URL to an absolute URL and validate it.
In addition to resolving the URL, this function makes sure that it is a link to an http or https site.
string | $url | The relative URL. |
Definition at line 883 of file HTTP.php.
|
static |
Parse a query string into an array.
This function parses a query string into an array, similar to the way the builtin 'parse_str' works, except it doesn't handle arrays, and it doesn't do "magic quotes".
Query parameters without values will be set to an empty string.
string | $query_string | The query string which should be parsed. |
Definition at line 915 of file HTTP.php.
|
staticprivate |
This function redirects the user to the specified address.
This function will use the "HTTP 303 See Other" redirection if the current request used the POST method and the HTTP version is 1.1. Otherwise, a "HTTP 302 Found" redirection will be used.
The function will also generate a simple web page with a clickable link to the target page.
string | $url | The URL we should redirect to. This URL may include query parameters. If this URL is a relative URL (starting with '/'), then it will be turned into an absolute URL by prefixing it with the absolute URL to the root of the website. |
string[] | $parameters An array with extra query string parameters which should be appended to the URL. The name of the parameter is the array index. The value of the parameter is the value stored in the index. Both the name and the value will be urlencoded. If the value is NULL, then the parameter will be encoded as just the name, without a value. |
Definition at line 148 of file HTTP.php.
References $_SERVER, $code, $url, header, n, and SimpleSAML\Logger\warning().
|
static |
This function redirects to the specified URL without performing any security checks.
Please, do NOT use this function with user supplied URLs.
This function will use the "HTTP 303 See Other" redirection if the current request used the POST method and the HTTP version is 1.1. Otherwise, a "HTTP 302 Found" redirection will be used.
The function will also generate a simple web page with a clickable link to the target URL.
string | $url | The URL we should redirect to. This URL may include query parameters. If this URL is a relative URL (starting with '/'), then it will be turned into an absolute URL by prefixing it with the absolute URL to the root of the website. |
string[] | $parameters An array with extra query string parameters which should be appended to the URL. The name of the parameter is the array index. The value of the parameter is the value stored in the index. Both the name and the value will be urlencoded. If the value is NULL, then the parameter will be encoded as just the name, without a value. |
Definition at line 962 of file HTTP.php.
Referenced by sspmod_saml_Auth_Source_SP\askForIdPChange(), sspmod_authwindowslive_Auth_Source_LiveID\authenticate(), sspmod_authfacebook_Auth_Source_Facebook\authenticate(), sspmod_exampleauth_Auth_Source_External\authenticate(), sspmod_authYubiKey_Auth_Source_YubiKey\authenticate(), sspmod_multiauth_Auth_Source_MultiAuth\authenticate(), sspmod_core_Auth_UserPassOrgBase\authenticate(), sspmod_core_Auth_UserPassBase\authenticate(), sspmod_cas_Auth_Source_CAS\authenticate(), SimpleSAML_IdP\finishLogoutRedirect(), sspmod_oauth_Consumer\getAuthorizeRequest(), SimpleSAML_XHTML_IdPDisco\handleRequest(), SimpleSAML_Auth_Default\initLogout(), SimpleSAML_Auth_Source\loginCompleted(), sspmod_cas_Auth_Source_CAS\logout(), SimpleSAML_Auth_Default\logoutCompleted(), SimpleSAML\Auth\Simple\logoutCompleted(), SimpleSAML\IdP\TraditionalLogoutHandler\logoutNextSP(), sspmod_consent_Logout\postLogout(), sspmod_exampleauth_Auth_Process_RedirectTest\process(), sspmod_core_Auth_Process_WarnShortSSOInterval\process(), sspmod_preprodwarning_Auth_Process_Warning\process(), sspmod_authX509_Auth_Process_ExpiryWarning\process(), sspmod_expirycheck_Auth_Process_ExpiryDate\process(), sspmod_consent_Auth_Process_Consent\process(), SimpleSAML_Utilities\redirectTrustedURL(), SimpleSAML_Auth_ProcessingChain\resumeProcessing(), sspmod_cdc_Server\send(), sspmod_adfs_IdP_ADFS\sendLogoutResponse(), SimpleSAML_XHTML_IdPDisco\start(), sspmod_saml_Auth_Source_SP\startDisco(), SimpleSAML\IdP\IFrameLogoutHandler\startLogout(), sspmod_saml_Auth_Source_SP\startSSO1(), SimpleSAML_Auth_State\throwException(), sspmod_saml_Auth_Process_ExpectedAuthnContextClassRef\unauthorized(), and sspmod_authorize_Auth_Process_Authorize\unauthorized().
|
static |
This function redirects to the specified URL after performing the appropriate security checks on it.
Particularly, it will make sure that the provided URL is allowed by the 'redirect.trustedsites' directive in the configuration.
If the aforementioned option is not set or the URL does correspond to a trusted site, it performs a redirection to it. If the site is not trusted, an exception will be thrown.
string | $url | The URL we should redirect to. This URL may include query parameters. If this URL is a relative URL (starting with '/'), then it will be turned into an absolute URL by prefixing it with the absolute URL to the root of the website. |
string[] | $parameters An array with extra query string parameters which should be appended to the URL. The name of the parameter is the array index. The value of the parameter is the value stored in the index. Both the name and the value will be urlencoded. If the value is NULL, then the parameter will be encoded as just the name, without a value. |
Definition at line 994 of file HTTP.php.
Referenced by sspmod_saml_Auth_Source_SP\handleUnsolicitedAuth(), SimpleSAML_Auth_State\loadState(), and SimpleSAML_Utilities\redirectUntrustedURL().
|
static |
Resolve a (possibly relative) URL relative to a given base URL.
This function supports these forms of relative URLs:
string | $url | The relative URL. |
string | $base | The base URL. Defaults to the base URL of this installation of SimpleSAMLphp. |
Definition at line 1026 of file HTTP.php.
Referenced by showEntry().
|
staticprivate |
Save the given HTTP POST data and the destination where it should be posted to a given session.
\SimpleSAML_Session | $session | The session where to temporarily store the data. |
string | $destination | The destination URL where the form should be posted. |
array | $data | An associative array with the data to be posted to $destination. |
Definition at line 218 of file HTTP.php.
|
static |
Set a cookie.
string | $name | The name of the cookie. |
string | NULL | $value | The value of the cookie. Set to NULL to delete the cookie. |
array | NULL | $params | Cookie parameters. |
bool | $throw | Whether to throw exception if setcookie() fails. |
Definition at line 1107 of file HTTP.php.
Referenced by sspmod_consent_Consent_Store_Cookie\_setConsentCookie(), SimpleSAML_Session\doLogin(), SimpleSAML_AuthMemCookie\doLogout(), sspmod_cdc_Server\handleDelete(), sspmod_cdc_Server\setCDC(), SimpleSAML_XHTML_IdPDisco\setCookie(), SimpleSAML_Utilities\setCookie(), SimpleSAML\Locale\Language\setLanguageCookie(), sspmod_discopower_PowerIdPDisco\setPreviousIdP(), sspmod_multiauth_Auth_Source_MultiAuth\setPreviousSource(), and SimpleSAML_Session\updateSessionCookies().
|
static |
Submit a POST form to a specific destination.
This function never returns.
string | $destination | The destination URL. |
array | $data | An associative array with the data to be posted to $destination. |
Definition at line 1205 of file HTTP.php.
Referenced by SimpleSAML_Utilities\postRedirect(), sspmod_cdc_Server\send(), and SimpleSAML\Bindings\Shib13\HTTPPost\sendResponse().