ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

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

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  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$code
Definition: example_050.php:99
static warning($string)
Definition: Logger.php:177
exit
Definition: backend.php:16
$url
+ Here is the call 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::addURLParameters() instead.

Definition at line 99 of file Utilities.php.

References $url.

Referenced by SAML2\HTTPArtifact\getRedirectURL().

100  {
101  return \SimpleSAML\Utils\HTTP::addURLParameters($url, $parameters);
102  }
$url
+ 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::aesDecrypt() instead.

Definition at line 685 of file Utilities.php.

References SimpleSAML\Utils\Crypto\aesDecrypt().

686  {
687  return SimpleSAML\Utils\Crypto::aesDecrypt($encData);
688  }
static aesDecrypt($ciphertext)
Decrypt data using AES-256-CBC and the system-wide secret salt as key.
Definition: Crypto.php:81
+ 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::aesEncrypt() instead.

Definition at line 676 of file Utilities.php.

References SimpleSAML\Utils\Crypto\aesEncrypt().

677  {
679  }
static aesEncrypt($data)
Encrypt data using AES-256-CBC and the system-wide secret salt as key.
Definition: Crypto.php:146
+ 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::arrayize() instead.

Definition at line 502 of file Utilities.php.

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

503  {
505  }
static arrayize($data, $index=0)
Put a non-array variable into an array.
Definition: Arrays.php:24
$index
Definition: metadata.php:60
$data
Definition: bench.php:6
+ 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::checkSessionCookie() instead.

Definition at line 649 of file Utilities.php.

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

650  {
652  }
static checkSessionCookie($retryURL=null)
Check for session cookie, and show missing-cookie page if it is missing.
Definition: HTTP.php:286
+ 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.

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

127  {
128  $currentTime = time();
129 
130  if (!empty($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  }
$start
Definition: bench.php:8
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
+ 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 ::checkURLAllowed() instead.

Definition at line 108 of file Utilities.php.

References $url.

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

◆ createHttpPostRedirectLink()

static SimpleSAML_Utilities::createHttpPostRedirectLink (   $destination,
  $post 
)
static
Deprecated:
This method will be removed in SSP 2.0.

Please use SimpleSAML::getPOSTRedirectURL() instead.

Definition at line 558 of file Utilities.php.

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

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 generateID()
Generate a random identifier, ID_LENGTH bytes long.
Definition: Random.php:26
$session
$destination
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
Definition: Module.php:220
Attribute-related utility methods.
$post
Definition: post.php:34
if($session===NULL) $postData
$url
static getSessionFromRequest()
Retrieves the current session.
Definition: Session.php:241
+ 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::getPOSTRedirectURL() instead.

Definition at line 548 of file Utilities.php.

References $destination, and $post.

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

◆ debugMessage()

static SimpleSAML_Utilities::debugMessage (   $message,
  $type 
)
static
Deprecated:
This method will be removed in SSP 2.0.

Please use SimpleSAML::debugSAMLMessage() instead.

Definition at line 658 of file Utilities.php.

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

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

659  {
661  }
$type
static debugSAMLMessage($message, $type)
Helper function to log SAML messages that we send or receive.
Definition: XML.php:94
catch(Exception $e) $message
+ 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.

References $errorCode.

179  {
180  throw new SimpleSAML_Error_Error($errorCode, $e);
181  }
$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::fetch() instead.

Definition at line 667 of file Utilities.php.

References $context, and $path.

668  {
669  return \SimpleSAML\Utils\HTTP::fetch($path, $context, $getHeaders);
670  }
$path
Definition: aliased.php:25
$context
Definition: webdav.php:25

◆ formatDOMElement()

static SimpleSAML_Utilities::formatDOMElement ( DOMElement  $root,
  $indentBase = '' 
)
static
Deprecated:
This method will be removed in SSP 2.0.

Please use SimpleSAML::formatDOMElement() instead.

Definition at line 484 of file Utilities.php.

485  {
486  SimpleSAML\Utils\XML::formatDOMElement($root, $indentBase);
487  }
$root
Definition: sabredav.php:45

◆ formatXMLString()

static SimpleSAML_Utilities::formatXMLString (   $xml,
  $indentBase = '' 
)
static
Deprecated:
This method will be removed in SSP 2.0.

Please use SimpleSAML::formatXMLString() instead.

Definition at line 493 of file Utilities.php.

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

494  {
495  return SimpleSAML\Utils\XML::formatXMLString($xml, $indentBase);
496  }
static formatXMLString($xml, $indentBase='')
Format an XML string.
Definition: XML.php:246
+ 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::generateID() instead.

Definition at line 150 of file Utilities.php.

References SimpleSAML\Utils\Random\generateID().

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

151  {
153  }
static generateID()
Generate a random identifier, ID_LENGTH bytes long.
Definition: Random.php:26
+ 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.

Referenced by SAML2\HTTPArtifact\getRedirectURL().

360  {
361  assert(is_int($length));
362 
363  return openssl_random_pseudo_bytes($length);
364  }
+ 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 ::generateTimestamp() instead.

Definition at line 160 of file Utilities.php.

References SimpleSAML\Utils\Time\generateTimestamp().

161  {
163  }
static generateTimestamp($instant=null)
This function generates a timestamp on the form used by the SAML protocols.
Definition: Time.php:31
+ 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::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::getAdminLoginURL instead();

Definition at line 520 of file Utilities.php.

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

521  {
523  }
if(!isset($_REQUEST['ReturnTo'])) $returnTo
Definition: authpage.php:16
static getAdminLoginURL($returnTo=null)
Retrieve a admin login URL.
Definition: Auth.php:22
+ 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 SimpleSAMLgetBaseURL() instead.

Definition at line 90 of file Utilities.php.

References getBaseURL().

91  {
93  }
getBaseURL($t, $type='get', $key=null, $value=null)
Definition: showstats.php:145
+ 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::getDefaultEndpoint() instead.

Definition at line 639 of file Utilities.php.

References $bindings.

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

◆ getDOMChildren()

static SimpleSAML_Utilities::getDOMChildren ( DOMElement  $element,
  $localName,
  $namespaceURI 
)
static
Deprecated:
This method will be removed in SSP 2.0.

Please use SimpleSAML::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::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::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  }

◆ getSecretSalt()

static SimpleSAML_Utilities::getSecretSalt ( )
static
Deprecated:
This method will be removed in SSP 2.0.

Please use SimpleSAML::getSecretSalt() instead.

Definition at line 429 of file Utilities.php.

References SimpleSAML\Utils\Config\getSecretSalt().

430  {
432  }
static getSecretSalt()
Retrieve the secret salt.
Definition: Config.php:49
+ 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::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::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::getTempDir instead.

Definition at line 611 of file Utilities.php.

References SimpleSAML\Utils\System\getTempDir().

Referenced by SAML2\SOAPClient\send().

612  {
614  }
static getTempDir()
This function retrieves the path to a directory where temporary files can be saved.
Definition: System.php:70
+ 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::initTimezone() instead.

Definition at line 593 of file Utilities.php.

References SimpleSAML\Utils\Time\initTimezone().

594  {
596  }
static initTimezone()
Initialize the timezone.
Definition: Time.php:51
+ 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::ipCIDRcheck() instead.

Definition at line 187 of file Utilities.php.

References SimpleSAML\Utils\Net\ipCIDRcheck().

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
+ 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::isAdmin() instead.

Definition at line 511 of file Utilities.php.

References SimpleSAML\Utils\Auth\isAdmin().

512  {
514  }
static isAdmin()
Check whether the current user is admin.
Definition: Auth.php:42
+ 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::isDOMNodeOfType() instead.

Definition at line 303 of file Utilities.php.

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

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
+ 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::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::getOS() instead.

Definition at line 694 of file Utilities.php.

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

695  {
697  }
static getOS()
This function returns the Operating System we are running on.
Definition: System.php:29
+ 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::loadPrivateKey() instead.

Definition at line 475 of file Utilities.php.

References SimpleSAML\Utils\Crypto\loadPrivateKey().

Referenced by SAML2\SOAPClient\send().

476  {
477  return SimpleSAML\Utils\Crypto::loadPrivateKey($metadata, $required, $prefix);
478  }
static loadPrivateKey(\SimpleSAML_Configuration $metadata, $required=false, $prefix='', $full_path=false)
Load a private key from metadata.
Definition: Crypto.php:195
+ 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::loadPublicKey() instead.

Definition at line 466 of file Utilities.php.

References SimpleSAML\Utils\Crypto\loadPublicKey().

Referenced by SAML2\SOAPClient\send().

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
+ 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::maskErrors() instead.

Definition at line 620 of file Utilities.php.

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

621  {
623  }
$mask
Definition: example_042.php:90
static maskErrors($mask)
Disable error reporting for the given log levels.
Definition: Logger.php:304
+ 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::normalizeURL() instead.

Definition at line 401 of file Utilities.php.

References $url.

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

◆ parseAttributes()

static SimpleSAML_Utilities::parseAttributes (   $attributes)
static
Deprecated:
This method will be removed in SSP 2.0.

Please use SimpleSAML::normalizeAttributesArray() instead.

Definition at line 420 of file Utilities.php.

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

421  {
423  }
static normalizeAttributesArray($attributes)
Validate and normalize an array with attributes.
Definition: Attributes.php:79
if(array_key_exists('yes', $_REQUEST)) $attributes
Definition: getconsent.php:85
+ 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 ::parseDuration() instead.

Definition at line 169 of file Utilities.php.

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

170  {
172  }
static parseDuration($duration, $timestamp=null)
Interpret a ISO8601 duration value relative to a given timestamp.
Definition: Time.php:91
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
+ 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::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.

References $stateId, and SimpleSAML_Auth_State\parseStateID().

118  {
120  }
$stateId
Definition: saml2-acs.php:76
static parseStateID($stateId)
Get the ID and (optionally) a URL embedded in a StateID, in the form &#39;id:url&#39;.
Definition: State.php:410
+ 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::popErrorMask() instead.

Definition at line 629 of file Utilities.php.

References SimpleSAML\Logger\popErrorMask().

630  {
632  }
static popErrorMask()
Pop an error mask.
Definition: Logger.php:322
+ 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::submitPOSTData() instead.

Definition at line 538 of file Utilities.php.

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

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

539  {
541  }
$destination
$post
Definition: post.php:34
static submitPOSTData($destination, $data)
Submit a POST form to a specific destination.
Definition: HTTP.php:1202
+ 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.

References $url.

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 {
264  $url = self::normalizeURL($url);
265  }
266  self::_doRedirect($url, $parameters);
267  }
$url

◆ redirectTrustedURL()

static SimpleSAML_Utilities::redirectTrustedURL (   $url,
  $parameters = array() 
)
static
Deprecated:
This method will be removed in SSP 2.0.

Please use SimpleSAML::redirectTrustedURL() instead.

Definition at line 274 of file Utilities.php.

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

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

275  {
277  }
static redirectTrustedURL($url, $parameters=array())
This function redirects to the specified URL without performing any security checks.
Definition: HTTP.php:959
$url
+ 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::redirectUntrustedURL() instead.

Definition at line 284 of file Utilities.php.

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

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:991
$url
+ 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::requireAdmin() instead.

Definition at line 529 of file Utilities.php.

References SimpleSAML\Utils\Auth\requireAdmin().

530  {
532  }
static requireAdmin()
Require admin access to the current page.
Definition: Auth.php:60
+ 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::getCertPath() instead.

Definition at line 457 of file Utilities.php.

References $path.

Referenced by SAML2\SOAPClient\send().

458  {
459  return \SimpleSAML\Utils\Config::getCertPath($path);
460  }
$path
Definition: aliased.php:25
+ 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::resolvePath() instead.

Definition at line 383 of file Utilities.php.

References $base, and $path.

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

◆ resolveURL()

static SimpleSAML_Utilities::resolveURL (   $url,
  $base = null 
)
static
Deprecated:
This method will be removed in SSP 2.0.

Please use SimpleSAML::resolveURL() instead.

Definition at line 392 of file Utilities.php.

References $base, and $url.

393  {
394  return \SimpleSAML\Utils\HTTP::resolveURL($url, $base);
395  }
$base
Definition: index.php:4
$url

◆ selfURL()

static SimpleSAML_Utilities::selfURL ( )
static
Deprecated:
This method will be removed in SSP 2.0.

Please use SimpleSAML::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::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::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::setCookie() instead.

Definition at line 703 of file Utilities.php.

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

704  {
706  }
static setCookie($name, $value, $params=null, $throw=true)
Set a cookie.
Definition: HTTP.php:1104
+ 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.

References $i, and $ret.

Referenced by SAML2\HTTPArtifact\getRedirectURL().

371  {
372  $ret = '';
373  for ($i = 0; $i < strlen($bytes); $i++) {
374  $ret .= sprintf('%02x', ord($bytes[$i]));
375  }
376  return $ret;
377  }
$ret
Definition: parser.php:6
$i
Definition: disco.tpl.php:19
+ 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::transpose() instead.

Definition at line 293 of file Utilities.php.

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

294  {
296  }
static transpose($array)
This function transposes a two-dimensional array, so that $a[&#39;k1&#39;][&#39;k2&#39;] becomes $a[&#39;k2&#39;][&#39;k1&#39;].
Definition: Arrays.php:39
if(php_sapi_name() !='cli') $in
Definition: Utf8Test.php:37
+ 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.

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

585  {
587  }
if(@file_exists(dirname(__FILE__).'/lang/eng.php')) $certificate
Definition: example_052.php:77
static validateCertificate($certificate, $caFile)
Validate the certificate used to sign the XML against a CA file.
Definition: Validator.php:419
+ 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::isValid() instead.

Definition at line 340 of file Utilities.php.

References $result, and $xml.

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

◆ validateXMLDocument()

static SimpleSAML_Utilities::validateXMLDocument (   $message,
  $type 
)
static
Deprecated:
This method will be removed in SSP 2.0.

Please use SimpleSAML::checkSAMLMessage() instead.

Definition at line 350 of file Utilities.php.

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

351  {
353  }
$type
static checkSAMLMessage($message, $type)
This function performs some sanity checks on XML documents, and optionally validates them against the...
Definition: XML.php:35
catch(Exception $e) $message
+ 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::writeFile() instead.

Definition at line 602 of file Utilities.php.

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

Referenced by SAML2\SOAPClient\send().

603  {
605  }
static writeFile($filename, $data, $mode=0600)
Atomically write a file.
Definition: System.php:183
$filename
Definition: buildRTE.php:89
$data
Definition: bench.php:6
+ 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::isErrorMasked() instead.

Definition at line 18 of file Utilities.php.


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