ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SimpleSAML_Utilities Class Reference
+ Collaboration diagram for SimpleSAML_Utilities:

Static Public Member Functions

static getSelfHost ()
 
static selfURLhost ()
 
static isHTTPS ()
 
static selfURLNoQuery ()
 
static getSelfHostWithPath ()
 
static getFirstPathElement ($trailingslash=true)
 
static selfURL ()
 
static getBaseURL ()
 
static addURLparameter ($url, $parameters)
 
static checkURLAllowed ($url, array $trustedSites=null)
 
static parseStateID ($stateId)
 
static checkDateConditions ($start=null, $end=null)
 
static generateID ()
 
static generateTimestamp ($instant=null)
 
static parseDuration ($duration, $timestamp=null)
 
static fatalError ($trackId='na', $errorCode=null, Exception $e=null)
 
static ipCIDRcheck ($cidr, $ip=null)
 
static redirect ($url, $parameters=array(), $allowed_redirect_hosts=null)
 
static redirectTrustedURL ($url, $parameters=array())
 
static redirectUntrustedURL ($url, $parameters=array())
 
static transposeArray ($in)
 
static isDOMElementOfType (DOMNode $element, $name, $nsURI)
 
static getDOMChildren (DOMElement $element, $localName, $namespaceURI)
 
static getDOMText ($element)
 
static getAcceptLanguage ()
 
static validateXML ($xml, $schema)
 
static validateXMLDocument ($message, $type)
 
static generateRandomBytes ($length)
 
static stringToHex ($bytes)
 
static resolvePath ($path, $base=null)
 
static resolveURL ($url, $base=null)
 
static normalizeURL ($url)
 
static parseQueryString ($query_string)
 
static parseAttributes ($attributes)
 
static getSecretSalt ()
 
static getLastError ()
 
static resolveCert ($path)
 
static loadPublicKey (SimpleSAML_Configuration $metadata, $required=false, $prefix='')
 
static loadPrivateKey (SimpleSAML_Configuration $metadata, $required=false, $prefix='')
 
static formatDOMElement (DOMElement $root, $indentBase='')
 
static formatXMLString ($xml, $indentBase='')
 
static arrayize ($data, $index=0)
 
static isAdmin ()
 
static getAdminLoginURL ($returnTo=null)
 
static requireAdmin ()
 
static postRedirect ($destination, $post)
 
static createPostRedirectLink ($destination, $post)
 
static createHttpPostRedirectLink ($destination, $post)
 
static validateCA ($certificate, $caFile)
 
static initTimezone ()
 
static writeFile ($filename, $data, $mode=0600)
 
static getTempDir ()
 
static maskErrors ($mask)
 
static popErrorMask ()
 
static getDefaultEndpoint (array $endpoints, array $bindings=null)
 
static checkCookie ($retryURL=null)
 
static debugMessage ($message, $type)
 
static fetch ($path, $context=array(), $getHeaders=false)
 
static aesEncrypt ($clear)
 
static aesDecrypt ($encData)
 
static isWindowsOS ()
 
static setCookie ($name, $value, array $params=null, $throw=true)
 

Static Public Attributes

static $logMask = 0
 

Static Private Member Functions

static _doRedirect ($url, $parameters=array())
 

Detailed Description

Definition at line 12 of file Utilities.php.

Member Function Documentation

◆ _doRedirect()

static SimpleSAML_Utilities::_doRedirect (   $url,
  $parameters = array() 
)
staticprivate

Definition at line 193 of file Utilities.php.

194 {
195 assert('is_string($url)');
196 assert('!empty($url)');
197 assert('is_array($parameters)');
198
199 if (!empty($parameters)) {
200 $url = self::addURLparameter($url, $parameters);
201 }
202
203 /* Set the HTTP result code. This is either 303 See Other or
204 * 302 Found. HTTP 303 See Other is sent if the HTTP version
205 * is HTTP/1.1 and the request type was a POST request.
206 */
207 if ($_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.1' &&
208 $_SERVER['REQUEST_METHOD'] === 'POST'
209 ) {
210 $code = 303;
211 } else {
212 $code = 302;
213 }
214
215 if (strlen($url) > 2048) {
216 SimpleSAML\Logger::warning('Redirecting to a URL longer than 2048 bytes.');
217 }
218
219 // Set the location header
220 header('Location: '.$url, true, $code);
221
222 // Disable caching of this response
223 header('Pragma: no-cache');
224 header('Cache-Control: no-cache, must-revalidate');
225
226 // Show a minimal web page with a clickable link to the URL
227 echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
228 echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'.
229 ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n";
230 echo '<html xmlns="http://www.w3.org/1999/xhtml">';
231 echo '<head>
232 <meta http-equiv="content-type" content="text/html; charset=utf-8">
233 <title>Redirect</title>
234 </head>';
235 echo '<body>';
236 echo '<h1>Redirect</h1>';
237 echo '<p>';
238 echo 'You were redirected to: ';
239 echo '<a id="redirlink" href="'.
240 htmlspecialchars($url).'">'.htmlspecialchars($url).'</a>';
241 echo '<script type="text/javascript">document.getElementById("redirlink").focus();</script>';
242 echo '</p>';
243 echo '</body>';
244 echo '</html>';
245
246 // End script execution
247 exit;
248 }
static warning($string)
Definition: Logger.php:179
static addURLparameter($url, $parameters)
Definition: Utilities.php:99
$code
Definition: example_050.php:99
$url
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']

References $_SERVER, $code, $url, addURLparameter(), exit, and SimpleSAML\Logger\warning().

Referenced by redirect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addURLparameter()

static SimpleSAML_Utilities::addURLparameter (   $url,
  $parameters 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::addURLParameters() instead.

Definition at line 99 of file Utilities.php.

100 {
101 return \SimpleSAML\Utils\HTTP::addURLParameters($url, $parameters);
102 }

References $url.

Referenced by _doRedirect(), and SAML2\HTTPArtifact\getRedirectURL().

+ Here is the caller graph for this function:

◆ aesDecrypt()

static SimpleSAML_Utilities::aesDecrypt (   $encData)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Crypto::aesDecrypt() instead.

Definition at line 685 of file Utilities.php.

686 {
688 }
static aesDecrypt($ciphertext)
Decrypt data using AES-256-CBC and the system-wide secret salt as key.
Definition: Crypto.php:81

References SimpleSAML\Utils\Crypto\aesDecrypt().

+ Here is the call graph for this function:

◆ aesEncrypt()

static SimpleSAML_Utilities::aesEncrypt (   $clear)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Crypto::aesEncrypt() instead.

Definition at line 676 of file Utilities.php.

677 {
679 }
static aesEncrypt($data)
Encrypt data using AES-256-CBC and the system-wide secret salt as key.
Definition: Crypto.php:146

References SimpleSAML\Utils\Crypto\aesEncrypt().

+ Here is the call graph for this function:

◆ arrayize()

static SimpleSAML_Utilities::arrayize (   $data,
  $index = 0 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Arrays::arrayize() instead.

Definition at line 502 of file Utilities.php.

503 {
505 }
static arrayize($data, $index=0)
Put a non-array variable into an array.
Definition: Arrays.php:24
$index
Definition: metadata.php:60

References $data, $index, and SimpleSAML\Utils\Arrays\arrayize().

+ Here is the call graph for this function:

◆ checkCookie()

static SimpleSAML_Utilities::checkCookie (   $retryURL = null)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::checkSessionCookie() instead.

Definition at line 649 of file Utilities.php.

650 {
652 }
static checkSessionCookie($retryURL=null)
Check for session cookie, and show missing-cookie page if it is missing.
Definition: HTTP.php:287

References $retryURL, and SimpleSAML\Utils\HTTP\checkSessionCookie().

+ Here is the call graph for this function:

◆ checkDateConditions()

static SimpleSAML_Utilities::checkDateConditions (   $start = null,
  $end = null 
)
static
Deprecated:
This method will be removed in SSP 2.0.

Definition at line 126 of file Utilities.php.

127 {
128 $currentTime = time();
129
130 if (!empty($start)) {
131 $startTime = \SAML2\Utils::xsDateTimeToTimestamp($start);
132 // Allow for a 10 minute difference in Time
133 if (($startTime < 0) || (($startTime - 600) > $currentTime)) {
134 return false;
135 }
136 }
137 if (!empty($end)) {
139 if (($endTime < 0) || ($endTime <= $currentTime)) {
140 return false;
141 }
142 }
143 return true;
144 }
static xsDateTimeToTimestamp($time)
This function converts a SAML2 timestamp on the form yyyy-mm-ddThh:mm:ss(.s+)?Z to a UNIX timestamp.
Definition: Utils.php:721
$end
Definition: saml1-acs.php:18

References $end, and SAML2\Utils\xsDateTimeToTimestamp().

+ Here is the call graph for this function:

◆ checkURLAllowed()

static SimpleSAML_Utilities::checkURLAllowed (   $url,
array  $trustedSites = null 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use \SimpleSAML\Utils\HTTP::checkURLAllowed() instead.

Definition at line 108 of file Utilities.php.

109 {
110 return \SimpleSAML\Utils\HTTP::checkURLAllowed($url, $trustedSites);
111 }

References $url.

Referenced by redirect().

+ Here is the caller graph for this function:

◆ createHttpPostRedirectLink()

static SimpleSAML_Utilities::createHttpPostRedirectLink (   $destination,
  $post 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::getPOSTRedirectURL() instead.

Definition at line 558 of file Utilities.php.

559 {
560 assert('is_string($destination)');
561 assert('is_array($post)');
562
564 $postData = array(
565 'post' => $post,
566 'url' => $destination,
567 );
568
570 $session->setData('core_postdatalink', $postId, $postData);
571
572 $redirInfo = base64_encode(SimpleSAML\Utils\Crypto::aesEncrypt($session->getSessionId().':'.$postId));
573
574 $url = SimpleSAML\Module::getModuleURL('core/postredirect.php', array('RedirInfo' => $redirInfo));
575 $url = preg_replace("#^https:#", "http:", $url);
576
577 return $url;
578 }
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
Definition: Module.php:303
static generateID()
Generate a random identifier, ID_LENGTH bytes long.
Definition: Random.php:26
static getSessionFromRequest()
Retrieves the current session.
Definition: Session.php:243
$destination
Attribute-related utility methods.
$post
Definition: post.php:34
if($session===NULL) $postData
$session

References $destination, $post, $postData, $session, $url, SimpleSAML\Utils\Random\generateID(), SimpleSAML\Module\getModuleURL(), and SimpleSAML_Session\getSessionFromRequest().

+ Here is the call graph for this function:

◆ createPostRedirectLink()

static SimpleSAML_Utilities::createPostRedirectLink (   $destination,
  $post 
)
static
Deprecated:
This method will be removed in SSP 2.0. PLease use SimpleSAML\Utils\HTTP::getPOSTRedirectURL() instead.

Definition at line 548 of file Utilities.php.

549 {
550 return \SimpleSAML\Utils\HTTP::getPOSTRedirectURL($destination, $post);
551 }

References $destination, and $post.

◆ debugMessage()

static SimpleSAML_Utilities::debugMessage (   $message,
  $type 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::debugSAMLMessage() instead.

Definition at line 658 of file Utilities.php.

659 {
661 }
static debugSAMLMessage($message, $type)
Helper function to log SAML messages that we send or receive.
Definition: XML.php:94
catch(Exception $e) $message
$type

References $message, $type, and SimpleSAML\Utils\XML\debugSAMLMessage().

Referenced by SAML2\Compat\Ssp\Container\debugMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fatalError()

static SimpleSAML_Utilities::fatalError (   $trackId = 'na',
  $errorCode = null,
Exception  $e = null 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please raise a SimpleSAML_Error_Error exception instead.

Definition at line 178 of file Utilities.php.

179 {
180 throw new SimpleSAML_Error_Error($errorCode, $e);
181 }
$errorCode

References $errorCode.

◆ fetch()

static SimpleSAML_Utilities::fetch (   $path,
  $context = array(),
  $getHeaders = false 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::fetch() instead.

Definition at line 667 of file Utilities.php.

668 {
669 return \SimpleSAML\Utils\HTTP::fetch($path, $context, $getHeaders);
670 }

References $path.

◆ formatDOMElement()

static SimpleSAML_Utilities::formatDOMElement ( DOMElement  $root,
  $indentBase = '' 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::formatDOMElement() instead.

Definition at line 484 of file Utilities.php.

485 {
486 SimpleSAML\Utils\XML::formatDOMElement($root, $indentBase);
487 }

◆ formatXMLString()

static SimpleSAML_Utilities::formatXMLString (   $xml,
  $indentBase = '' 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::formatXMLString() instead.

Definition at line 493 of file Utilities.php.

494 {
495 return SimpleSAML\Utils\XML::formatXMLString($xml, $indentBase);
496 }
static formatXMLString($xml, $indentBase='')
Format an XML string.
Definition: XML.php:246
$xml
Definition: metadata.php:240

References $xml, and SimpleSAML\Utils\XML\formatXMLString().

+ Here is the call graph for this function:

◆ generateID()

static SimpleSAML_Utilities::generateID ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Random::generateID() instead.

Definition at line 150 of file Utilities.php.

151 {
153 }

References SimpleSAML\Utils\Random\generateID().

Referenced by SAML2\Compat\Ssp\Container\generateId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateRandomBytes()

static SimpleSAML_Utilities::generateRandomBytes (   $length)
static
Deprecated:
This method will be removed in SSP 2.0. Please use openssl_random_pseudo_bytes() instead.

Definition at line 359 of file Utilities.php.

360 {
361 assert('is_int($length)');
362
363 return openssl_random_pseudo_bytes($length);
364 }

Referenced by SAML2\HTTPArtifact\getRedirectURL().

+ Here is the caller graph for this function:

◆ generateTimestamp()

static SimpleSAML_Utilities::generateTimestamp (   $instant = null)
static
Deprecated:
This method will be removed in SSP 2.0. Please use \SimpleSAML\Utils\Time::generateTimestamp() instead.

Definition at line 160 of file Utilities.php.

161 {
163 }
static generateTimestamp($instant=null)
This function generates a timestamp on the form used by the SAML protocols.
Definition: Time.php:32

References SimpleSAML\Utils\Time\generateTimestamp().

+ Here is the call graph for this function:

◆ getAcceptLanguage()

static SimpleSAML_Utilities::getAcceptLanguage ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::getAcceptLanguage() instead.

Definition at line 331 of file Utilities.php.

332 {
333 return \SimpleSAML\Utils\HTTP::getAcceptLanguage();
334 }

◆ getAdminLoginURL()

static SimpleSAML_Utilities::getAdminLoginURL (   $returnTo = null)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Auth::getAdminLoginURL instead();

Definition at line 520 of file Utilities.php.

521 {
523 }
if(!isset($_REQUEST['ReturnTo'])) $returnTo
Definition: authpage.php:16
static getAdminLoginURL($returnTo=null)
Retrieve a admin login URL.
Definition: Auth.php:22

References $returnTo, and SimpleSAML\Utils\Auth\getAdminLoginURL().

+ Here is the call graph for this function:

◆ getBaseURL()

static SimpleSAML_Utilities::getBaseURL ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTPgetBaseURL() instead.

Definition at line 90 of file Utilities.php.

91 {
93 }
getBaseURL($t, $type='get', $key=null, $value=null)
Definition: showstats.php:133

References getBaseURL().

+ Here is the call graph for this function:

◆ getDefaultEndpoint()

static SimpleSAML_Utilities::getDefaultEndpoint ( array  $endpoints,
array  $bindings = null 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Config\Metadata::getDefaultEndpoint() instead.

Definition at line 639 of file Utilities.php.

640 {
641 return \SimpleSAML\Utils\Config\Metadata::getDefaultEndpoint($endpoints, $bindings);
642 }
$bindings

References $bindings.

◆ getDOMChildren()

static SimpleSAML_Utilities::getDOMChildren ( DOMElement  $element,
  $localName,
  $namespaceURI 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::getDOMChildren() instead.

Definition at line 312 of file Utilities.php.

313 {
314 return SimpleSAML\Utils\XML::getDOMChildren($element, $localName, $namespaceURI);
315 }

◆ getDOMText()

static SimpleSAML_Utilities::getDOMText (   $element)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::getDOMText() instead.

Definition at line 321 of file Utilities.php.

322 {
323 return SimpleSAML\Utils\XML::getDOMText($element);
324 }

◆ getFirstPathElement()

static SimpleSAML_Utilities::getFirstPathElement (   $trailingslash = true)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::getFirstPathElement() instead.

Definition at line 72 of file Utilities.php.

73 {
74 return \SimpleSAML\Utils\HTTP::getFirstPathElement($trailingslash);
75 }

◆ getLastError()

static SimpleSAML_Utilities::getLastError ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please call error_get_last() directly.

Definition at line 438 of file Utilities.php.

439 {
440
441 if (!function_exists('error_get_last')) {
442 return '[Cannot get error message]';
443 }
444
445 $error = error_get_last();
446 if ($error === null) {
447 return '[No error message found]';
448 }
449
450 return $error['message'];
451 }
$error
Definition: Error.php:17

References $error.

◆ getSecretSalt()

static SimpleSAML_Utilities::getSecretSalt ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Config::getSecretSalt() instead.

Definition at line 429 of file Utilities.php.

430 {
432 }
static getSecretSalt()
Retrieve the secret salt.
Definition: Config.php:49

References SimpleSAML\Utils\Config\getSecretSalt().

+ Here is the call graph for this function:

◆ getSelfHost()

static SimpleSAML_Utilities::getSelfHost ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::getSelfHost() instead.

Definition at line 24 of file Utilities.php.

25 {
26 return \SimpleSAML\Utils\HTTP::getSelfHost();
27 }

◆ getSelfHostWithPath()

static SimpleSAML_Utilities::getSelfHostWithPath ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::getSelfHostWithPath() instead.

Definition at line 62 of file Utilities.php.

63 {
64 return \SimpleSAML\Utils\HTTP::getSelfHostWithPath();
65 }

◆ getTempDir()

static SimpleSAML_Utilities::getTempDir ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\System::getTempDir instead.

Definition at line 611 of file Utilities.php.

612 {
614 }
static getTempDir()
This function retrieves the path to a directory where temporary files can be saved.
Definition: System.php:70

References SimpleSAML\Utils\System\getTempDir().

Referenced by SAML2\SOAPClient\send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTimezone()

static SimpleSAML_Utilities::initTimezone ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Time::initTimezone() instead.

Definition at line 593 of file Utilities.php.

594 {
596 }
static initTimezone()
Initialize the timezone.
Definition: Time.php:52

References SimpleSAML\Utils\Time\initTimezone().

+ Here is the call graph for this function:

◆ ipCIDRcheck()

static SimpleSAML_Utilities::ipCIDRcheck (   $cidr,
  $ip = null 
)
static
Deprecated:
This method will be removed in version 2.0. Use SimpleSAML\Utils\Net::ipCIDRcheck() instead.

Definition at line 187 of file Utilities.php.

188 {
189 return SimpleSAML\Utils\Net::ipCIDRcheck($cidr, $ip);
190 }
static ipCIDRcheck($cidr, $ip=null)
Check whether an IP address is part of a CIDR.
Definition: Net.php:26

References SimpleSAML\Utils\Net\ipCIDRcheck().

+ Here is the call graph for this function:

◆ isAdmin()

static SimpleSAML_Utilities::isAdmin ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Auth::isAdmin() instead.

Definition at line 511 of file Utilities.php.

512 {
514 }
static isAdmin()
Check whether the current user is admin.
Definition: Auth.php:42

References SimpleSAML\Utils\Auth\isAdmin().

+ Here is the call graph for this function:

◆ isDOMElementOfType()

static SimpleSAML_Utilities::isDOMElementOfType ( DOMNode  $element,
  $name,
  $nsURI 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::isDOMNodeOfType() instead.

Definition at line 303 of file Utilities.php.

304 {
305 return SimpleSAML\Utils\XML::isDOMNodeOfType($element, $name, $nsURI);
306 }
static isDOMNodeOfType(\DOMNode $element, $name, $nsURI)
This function checks if the DOMElement has the correct localName and namespaceURI.
Definition: XML.php:357
if($format !==null) $name
Definition: metadata.php:146

References $name, and SimpleSAML\Utils\XML\isDOMNodeOfType().

+ Here is the call graph for this function:

◆ isHTTPS()

static SimpleSAML_Utilities::isHTTPS ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::isHTTPS() instead.

Definition at line 42 of file Utilities.php.

43 {
44 return \SimpleSAML\Utils\HTTP::isHTTPS();
45 }

◆ isWindowsOS()

static SimpleSAML_Utilities::isWindowsOS ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\System::getOS() instead.

Definition at line 694 of file Utilities.php.

695 {
697 }
static getOS()
This function returns the Operating System we are running on.
Definition: System.php:29

References SimpleSAML\Utils\System\getOS(), and SimpleSAML\Utils\System\WINDOWS.

+ Here is the call graph for this function:

◆ loadPrivateKey()

static SimpleSAML_Utilities::loadPrivateKey ( SimpleSAML_Configuration  $metadata,
  $required = false,
  $prefix = '' 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Crypto::loadPrivateKey() instead.

Definition at line 475 of file Utilities.php.

476 {
477 return SimpleSAML\Utils\Crypto::loadPrivateKey($metadata, $required, $prefix);
478 }
$metadata['__DYNAMIC:1__']
static loadPrivateKey(\SimpleSAML_Configuration $metadata, $required=false, $prefix='', $full_path=false)
Load a private key from metadata.
Definition: Crypto.php:195

References $metadata, and SimpleSAML\Utils\Crypto\loadPrivateKey().

Referenced by SAML2\SOAPClient\send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadPublicKey()

static SimpleSAML_Utilities::loadPublicKey ( SimpleSAML_Configuration  $metadata,
  $required = false,
  $prefix = '' 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Crypto::loadPublicKey() instead.

Definition at line 466 of file Utilities.php.

467 {
468 return SimpleSAML\Utils\Crypto::loadPublicKey($metadata, $required, $prefix);
469 }
static loadPublicKey(\SimpleSAML_Configuration $metadata, $required=false, $prefix='')
Get public key or certificate from metadata.
Definition: Crypto.php:265

References $metadata, and SimpleSAML\Utils\Crypto\loadPublicKey().

Referenced by SAML2\SOAPClient\send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maskErrors()

static SimpleSAML_Utilities::maskErrors (   $mask)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Logger::maskErrors() instead.

Definition at line 620 of file Utilities.php.

621 {
623 }
static maskErrors($mask)
Disable error reporting for the given log levels.
Definition: Logger.php:306
$mask
Definition: example_042.php:90

References $mask, and SimpleSAML\Logger\maskErrors().

+ Here is the call graph for this function:

◆ normalizeURL()

static SimpleSAML_Utilities::normalizeURL (   $url)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::normalizeURL() instead.

Definition at line 401 of file Utilities.php.

402 {
403 return \SimpleSAML\Utils\HTTP::normalizeURL($url);
404 }

References $url.

Referenced by redirect().

+ Here is the caller graph for this function:

◆ parseAttributes()

static SimpleSAML_Utilities::parseAttributes (   $attributes)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Attributes::normalizeAttributesArray() instead.

Definition at line 420 of file Utilities.php.

421 {
423 }
static normalizeAttributesArray($attributes)
Validate and normalize an array with attributes.
Definition: Attributes.php:80
$attributes

References $attributes, and SimpleSAML\Utils\Attributes\normalizeAttributesArray().

+ Here is the call graph for this function:

◆ parseDuration()

static SimpleSAML_Utilities::parseDuration (   $duration,
  $timestamp = null 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use \SimpleSAML\Utils\Time::parseDuration() instead.

Definition at line 169 of file Utilities.php.

170 {
172 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
static parseDuration($duration, $timestamp=null)
Interpret a ISO8601 duration value relative to a given timestamp.
Definition: Time.php:92

References $timestamp, and SimpleSAML\Utils\Time\parseDuration().

+ Here is the call graph for this function:

◆ parseQueryString()

static SimpleSAML_Utilities::parseQueryString (   $query_string)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::parseQueryString() instead.

Definition at line 410 of file Utilities.php.

411 {
412 return \SimpleSAML\Utils\HTTP::parseQueryString($query_string);
413 }

◆ parseStateID()

static SimpleSAML_Utilities::parseStateID (   $stateId)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML_Auth_State::parseStateID() instead.

Definition at line 117 of file Utilities.php.

118 {
120 }
static parseStateID($stateId)
Get the ID and (optionally) a URL embedded in a StateID, in the form 'id:url'.
Definition: State.php:411
$stateId
Definition: saml2-acs.php:76

References $stateId, and SimpleSAML_Auth_State\parseStateID().

+ Here is the call graph for this function:

◆ popErrorMask()

static SimpleSAML_Utilities::popErrorMask ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Logger::popErrorMask() instead.

Definition at line 629 of file Utilities.php.

630 {
632 }
static popErrorMask()
Pop an error mask.
Definition: Logger.php:324

References SimpleSAML\Logger\popErrorMask().

+ Here is the call graph for this function:

◆ postRedirect()

static SimpleSAML_Utilities::postRedirect (   $destination,
  $post 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::submitPOSTData() instead.

Definition at line 538 of file Utilities.php.

539 {
541 }
static submitPOSTData($destination, $data)
Submit a POST form to a specific destination.
Definition: HTTP.php:1205

References $destination, $post, and SimpleSAML\Utils\HTTP\submitPOSTData().

Referenced by SAML2\Compat\Ssp\Container\postRedirect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirect()

static SimpleSAML_Utilities::redirect (   $url,
  $parameters = array(),
  $allowed_redirect_hosts = null 
)
static
Deprecated:
1.12.0 This method will be removed from the API. Instead, use the redirectTrustedURL() or redirectUntrustedURL() functions accordingly.

Definition at line 255 of file Utilities.php.

256 {
257 assert('is_string($url)');
258 assert('strlen($url) > 0');
259 assert('is_array($parameters)');
260
261 if ($allowed_redirect_hosts !== null) {
262 $url = self::checkURLAllowed($url, $allowed_redirect_hosts);
263 } else {
265 }
266 self::_doRedirect($url, $parameters);
267 }
static checkURLAllowed($url, array $trustedSites=null)
Definition: Utilities.php:108
static _doRedirect($url, $parameters=array())
Definition: Utilities.php:193
static normalizeURL($url)
Definition: Utilities.php:401

References $url, _doRedirect(), checkURLAllowed(), and normalizeURL().

+ Here is the call graph for this function:

◆ redirectTrustedURL()

static SimpleSAML_Utilities::redirectTrustedURL (   $url,
  $parameters = array() 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::redirectTrustedURL() instead.

Definition at line 274 of file Utilities.php.

275 {
277 }
static redirectTrustedURL($url, $parameters=array())
This function redirects to the specified URL without performing any security checks.
Definition: HTTP.php:962

References $url, and SimpleSAML\Utils\HTTP\redirectTrustedURL().

Referenced by SAML2\Compat\Ssp\Container\redirect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectUntrustedURL()

static SimpleSAML_Utilities::redirectUntrustedURL (   $url,
  $parameters = array() 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::redirectUntrustedURL() instead.

Definition at line 284 of file Utilities.php.

285 {
287 }
static redirectUntrustedURL($url, $parameters=array())
This function redirects to the specified URL after performing the appropriate security checks on it.
Definition: HTTP.php:994

References $url, and SimpleSAML\Utils\HTTP\redirectUntrustedURL().

+ Here is the call graph for this function:

◆ requireAdmin()

static SimpleSAML_Utilities::requireAdmin ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Auth::requireAdmin() instead.

Definition at line 529 of file Utilities.php.

530 {
532 }
static requireAdmin()
Require admin access to the current page.
Definition: Auth.php:60

References SimpleSAML\Utils\Auth\requireAdmin().

+ Here is the call graph for this function:

◆ resolveCert()

static SimpleSAML_Utilities::resolveCert (   $path)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Config::getCertPath() instead.

Definition at line 457 of file Utilities.php.

458 {
459 return \SimpleSAML\Utils\Config::getCertPath($path);
460 }

References $path.

Referenced by SAML2\SOAPClient\send().

+ Here is the caller graph for this function:

◆ resolvePath()

static SimpleSAML_Utilities::resolvePath (   $path,
  $base = null 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\System::resolvePath() instead.

Definition at line 383 of file Utilities.php.

384 {
385 return \SimpleSAML\Utils\System::resolvePath($path, $base);
386 }
$base
Definition: index.php:4

References $base, and $path.

◆ resolveURL()

static SimpleSAML_Utilities::resolveURL (   $url,
  $base = null 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::resolveURL() instead.

Definition at line 392 of file Utilities.php.

393 {
394 return \SimpleSAML\Utils\HTTP::resolveURL($url, $base);
395 }

References $base, and $url.

◆ selfURL()

static SimpleSAML_Utilities::selfURL ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::getSelfURL() instead.

Definition at line 81 of file Utilities.php.

82 {
83 return \SimpleSAML\Utils\HTTP::getSelfURL();
84 }

◆ selfURLhost()

static SimpleSAML_Utilities::selfURLhost ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::getSelfURLHost() instead.

Definition at line 33 of file Utilities.php.

34 {
35 return \SimpleSAML\Utils\HTTP::getSelfURLHost();
36 }

◆ selfURLNoQuery()

static SimpleSAML_Utilities::selfURLNoQuery ( )
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::getSelfURLNoQuery() instead.

Definition at line 52 of file Utilities.php.

53 {
54 return \SimpleSAML\Utils\HTTP::getSelfURLNoQuery();
55 }

◆ setCookie()

static SimpleSAML_Utilities::setCookie (   $name,
  $value,
array  $params = null,
  $throw = true 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\HTTP::setCookie() instead.

Definition at line 703 of file Utilities.php.

704 {
706 }
static setCookie($name, $value, $params=null, $throw=true)
Set a cookie.
Definition: HTTP.php:1107
$params
Definition: disable.php:11

References $name, $params, and SimpleSAML\Utils\HTTP\setCookie().

+ Here is the call graph for this function:

◆ stringToHex()

static SimpleSAML_Utilities::stringToHex (   $bytes)
static
Deprecated:
This method will be removed in SSP 2.0. Please use bin2hex() instead.

Definition at line 370 of file Utilities.php.

371 {
372 $ret = '';
373 for ($i = 0; $i < strlen($bytes); $i++) {
374 $ret .= sprintf('%02x', ord($bytes[$i]));
375 }
376 return $ret;
377 }
sprintf('%.4f', $callTime)
$i
Definition: disco.tpl.php:19
$ret
Definition: parser.php:6

References $i, $ret, and sprintf.

Referenced by SAML2\HTTPArtifact\getRedirectURL().

+ Here is the caller graph for this function:

◆ transposeArray()

static SimpleSAML_Utilities::transposeArray (   $in)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\Arraystranspose() instead.

Definition at line 293 of file Utilities.php.

294 {
296 }
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
static transpose($array)
This function transposes a two-dimensional array, so that $a['k1']['k2'] becomes $a['k2']['k1'].
Definition: Arrays.php:39

References $in, and SimpleSAML\Utils\Arrays\transpose().

+ Here is the call graph for this function:

◆ validateCA()

static SimpleSAML_Utilities::validateCA (   $certificate,
  $caFile 
)
static
Deprecated:
This method will be removed in SSP 2.0.

Definition at line 584 of file Utilities.php.

585 {
587 }
static validateCertificate($certificate, $caFile)
Validate the certificate used to sign the XML against a CA file.
Definition: Validator.php:418
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Definition: example_052.php:77

References $certificate, and SimpleSAML\XML\Validator\validateCertificate().

+ Here is the call graph for this function:

◆ validateXML()

static SimpleSAML_Utilities::validateXML (   $xml,
  $schema 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::isValid() instead.

Definition at line 340 of file Utilities.php.

341 {
342 $result = \SimpleSAML\Utils\XML::isValid($xml, $schema);
343 return ($result === true) ? '' : $result;
344 }
$result

References $result, $schema, and $xml.

◆ validateXMLDocument()

static SimpleSAML_Utilities::validateXMLDocument (   $message,
  $type 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\XML::checkSAMLMessage() instead.

Definition at line 350 of file Utilities.php.

351 {
353 }
static checkSAMLMessage($message, $type)
This function performs some sanity checks on XML documents, and optionally validates them against the...
Definition: XML.php:35

References $message, $type, and SimpleSAML\Utils\XML\checkSAMLMessage().

+ Here is the call graph for this function:

◆ writeFile()

static SimpleSAML_Utilities::writeFile (   $filename,
  $data,
  $mode = 0600 
)
static
Deprecated:
This method will be removed in SSP 2.0. Please use SimpleSAML\Utils\System::writeFile() instead.

Definition at line 602 of file Utilities.php.

603 {
605 }
static writeFile($filename, $data, $mode=0600)
Atomically write a file.
Definition: System.php:176

References $data, $filename, and SimpleSAML\Utils\System\writeFile().

Referenced by SAML2\SOAPClient\send().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $logMask

SimpleSAML_Utilities::$logMask = 0
static
Deprecated:
This property will be removed in SSP 2.0. Please use SimpleSAML\Logger::isErrorMasked() instead.

Definition at line 18 of file Utilities.php.


The documentation for this class was generated from the following file: