當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SimpleSAML_Utilities::formatDOMElement方法代碼示例

本文整理匯總了PHP中SimpleSAML_Utilities::formatDOMElement方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleSAML_Utilities::formatDOMElement方法的具體用法?PHP SimpleSAML_Utilities::formatDOMElement怎麽用?PHP SimpleSAML_Utilities::formatDOMElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SimpleSAML_Utilities的用法示例。


在下文中一共展示了SimpleSAML_Utilities::formatDOMElement方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getEntityDescriptorText

 /**
  * Retrieve the EntityDescriptor as text.
  *
  * This function serializes this EntityDescriptor, and returns it as text.
  *
  * @param bool $formatted  Whether the returned EntityDescriptor should be
  *                         formatted first.
  * @return string  The serialized EntityDescriptor.
  */
 public function getEntityDescriptorText($formatted = TRUE)
 {
     assert('is_bool($formatted)');
     if ($formatted) {
         SimpleSAML_Utilities::formatDOMElement($this->entityDescriptor);
     }
     return $this->document->saveXML();
 }
開發者ID:hukumonline,項目名稱:yii,代碼行數:17,代碼來源:SAMLBuilder.php

示例2: SimpleSAML_Error_BadRequest

if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    $message = @gzinflate($message);
    if ($message === FALSE) {
        throw new SimpleSAML_Error_BadRequest('Unable to gzinflate message.');
    }
}
$document = new DOMDocument();
if (!$document->loadXML($message)) {
    throw new SimpleSAML_Error_BadRequest('Unable to parse XML.');
}
$root = $document->firstChild;
if (!$root->hasAttribute('Destination')) {
    throw new SimpleSAML_Error_BadRequest('Missing Destination-attribute on root element.');
}
$realDestination = $root->getAttribute('Destination');
SimpleSAML_Utilities::formatDOMElement($root);
$message = $document->saveXML($root);
switch ($_SERVER['REQUEST_METHOD']) {
    case 'GET':
        $queryString = $_SERVER['QUERY_STRING'];
        if (strpos($realDestination, '?') === FALSE) {
            $url = $realDestination . '?' . $queryString;
        } else {
            $url = $realDestination . '&' . $queryString;
        }
        $t = new SimpleSAML_XHTML_Template($globalConfig, 'httpredirect-debug.php');
        $t->data['url'] = $url;
        $t->data['message'] = htmlspecialchars($message);
        $t->show();
        exit;
    case 'POST':
開發者ID:hukumonline,項目名稱:yii,代碼行數:31,代碼來源:debug.php

示例3: SimpleSAML_XHTML_Template

if (!array_key_exists('id', $_GET)) {
    $t = new SimpleSAML_XHTML_Template($config, 'aggregator:list.php');
    $t->data['sources'] = $aggregators->getOptions();
    $t->show();
    exit;
}
$id = $_GET['id'];
if (!in_array($id, $aggregators->getOptions())) {
    throw new SimpleSAML_Error_NotFound('No aggregator with id ' . var_export($id, TRUE) . ' found.');
}
$aConfig = $aggregators->getConfigItem($id);
$aggregator = new sspmod_aggregator_Aggregator($gConfig, $aConfig, $id);
if (isset($_REQUEST['set'])) {
    $aggregator->limitSets($_REQUEST['set']);
}
if (isset($_REQUEST['exclude'])) {
    $aggregator->exclude($_REQUEST['exclude']);
}
$xml = $aggregator->getMetadataDocument();
$mimetype = 'application/samlmetadata+xml';
$allowedmimetypes = array('text/plain', 'application/samlmetadata-xml', 'application/xml');
if (isset($_GET['mimetype']) && in_array($_GET['mimetype'], $allowedmimetypes)) {
    $mimetype = $_GET['mimetype'];
}
if ($mimetype === 'text/plain') {
    SimpleSAML_Utilities::formatDOMElement($xml);
}
$metadata = '<?xml version="1.0"?>' . "\n" . $xml->ownerDocument->saveXML($xml);
header('Content-Type: ' . $mimetype);
header('Content-Length: ' . strlen($metadata));
echo $metadata;
開發者ID:danielkjfrog,項目名稱:docker,代碼行數:31,代碼來源:index.php

示例4: SimpleSAML_Error_BadRequest

}
/* Make sure that the request isn't suspicious (contains references to current
 * directory or parent directory or anything like that. Searching for './' in the
 * URL will detect both '../' and './'. Searching for '\' will detect attempts to
 * use Windows-style paths.
 */
if (strpos($attributemap, '\\') !== FALSE) {
    throw new SimpleSAML_Error_BadRequest('Requested URL contained a backslash.');
} elseif (strpos($attributemap, './') !== FALSE) {
    throw new SimpleSAML_Error_BadRequest('Requested URL contained \'./\'.');
}
$arp = new sspmod_aggregator_ARP($md, $attributemap, $prefix, $suffix);
$arpxml = $arp->getXML();
$xml = new DOMDocument();
$xml->loadXML($arpxml);
$firstelement = $xml->firstChild;
if ($aggregator->shouldSign()) {
    $signinfo = $aggregator->getSigningInfo();
    $signer = new SimpleSAML_XML_Signer($signinfo);
    $signer->sign($firstelement, $firstelement, $firstelement->firstChild);
}
$mimetype = 'application/samlmetadata-xml';
$allowedmimetypes = array('text/plain', 'application/samlmetadata-xml', 'application/xml');
if (isset($_GET['mimetype']) && in_array($_GET['mimetype'], $allowedmimetypes)) {
    $mimetype = $_GET['mimetype'];
}
if ($mimetype === 'text/plain') {
    SimpleSAML_Utilities::formatDOMElement($xml->documentElement);
}
header('Content-Type: ' . $mimetype);
echo $xml->saveXML();
開發者ID:danielkjfrog,項目名稱:docker,代碼行數:31,代碼來源:arp.php


注:本文中的SimpleSAML_Utilities::formatDOMElement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。