public static function Utilities::Print_SAML_Request in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 7
2 calls to Utilities::Print_SAML_Request()
- MiniOrangeAcs::processSamlResponse in includes/
Acs.php - The function processSamlResponse.
- SAML_Request_Generator in ./
miniorange_saml.module - Show SAML Request
File
- includes/
Utilities.php, line 1361
Class
- Utilities
- This file is part of miniOrange SAML plugin.
Code
public static function Print_SAML_Request($samlRequestResponceXML, $type) {
header("Content-Type: text/html");
$doc = new DOMDocument();
$doc->preserveWhiteSpace = false;
$doc->formatOutput = true;
$doc
->loadXML($samlRequestResponceXML);
if ($type == 'displaySAMLRequest') {
$show_value = 'SAML Request';
}
else {
$show_value = 'SAML Response';
}
$out = $doc
->saveXML();
$out1 = htmlentities($out);
$out1 = rtrim($out1);
$xml = simplexml_load_string($out);
$js_url = drupal_get_path('module', 'miniorange_saml') . '/js/CommonJS.js';
$url = drupal_get_path('module', 'miniorange_saml') . '/css/style_settings.css';
echo '<link rel=\'stylesheet\' id=\'mo_saml_admin_settings_style-css\' href=\'' . $url . '\' type=\'text/css\' media=\'all\' />
<div class="mo-display-logs" ><p type="text" id="SAML_type">' . $show_value . '</p></div>
<div type="text" id="SAML_display" class="mo-display-block"><pre class=\'brush: xml;\'>' . $out1 . '</pre></div><br>
<div style="margin:3%;display:block;text-align:center;">
<div style="margin:3%;display:block;text-align:center;" >
</div>
<button id="copy" onclick="copyDivToClipboard()" class="mo-show-saml-request-copy-download-btn" >Copy</button>
<button onclick="downloadSamlRequest()" class="mo-show-saml-request-copy-download-btn" >Download</button>
</div>
</div>';
ob_end_flush();
?>
<script type="text/javascript" src="<?php
echo $js_url;
?>"></script>
<?php
exit;
}