本文整理汇总了PHP中SimpleSAML_XHTML_Template类的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_XHTML_Template类的具体用法?PHP SimpleSAML_XHTML_Template怎么用?PHP SimpleSAML_XHTML_Template使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SimpleSAML_XHTML_Template类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: showException
private function showException($e)
{
$globalConfig = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($globalConfig, 'attributefromrestapi:exception.tpl.php');
$t->data['e'] = $e->getMessage();
$t->show();
exit;
}
开发者ID:niif,项目名称:simplesamlphp-module-attributefromrestapi,代码行数:8,代码来源:AttributeFromRestApi.php
示例2: show
function show()
{
$t = new SimpleSAML_XHTML_Template($this->config, 'widget.php', 'foodle_foodle');
$t->data['bread'] = array(array('href' => '/' . $this->config->getValue('baseurlpath'), 'title' => 'bc_frontpage'), array('title' => 'Support'));
$t->data['gmapsAPI'] = $this->config->getValue('gmapsAPI');
$t->data['optimize'] = $this->config->getValue('optimize', false);
$t->show();
}
开发者ID:r4mp,项目名称:Foodle,代码行数:8,代码来源:PageWidget.php
示例3: authFailed
/**
* Finish a failed authentication.
*
* This function can be overloaded by a child authentication
* class that wish to perform some operations on failure
*
* @param array &$state Information about the current authentication.
*/
public function authFailed(&$state)
{
$config = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($config, 'authX509:X509error.php');
$t->data['errorcode'] = $state['authX509.error'];
$t->show();
exit;
}
开发者ID:simplesamlphp,项目名称:simplesamlphp,代码行数:16,代码来源:X509userCert.php
示例4: show
/**
* Show the error to the user.
*
* This function does not return.
*/
public function show()
{
header('HTTP/1.0 500 Internal Server Error');
$this->logError();
$globalConfig = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($globalConfig, 'core:no_metadata.tpl.php');
$t->data['entityId'] = $this->entityId;
$t->show();
exit;
}
开发者ID:filonuse,项目名称:fedlab,代码行数:15,代码来源:MetadataNotFound.php
示例5: sendResponse
/**
* Send an authenticationResponse using HTTP-POST.
*
* @param string $response The response which should be sent.
* @param array $idpmd The metadata of the IdP which is sending the response.
* @param array $spmd The metadata of the SP which is receiving the response.
* @param string|NULL $relayState The relaystate for the SP.
* @param string $shire The shire which should receive the response.
*/
public function sendResponse($response, $idpmd, $spmd, $relayState, $shire)
{
SimpleSAML_Utilities::validateXMLDocument($response, 'saml11');
$privatekey = SimpleSAML_Utilities::loadPrivateKey($idpmd, TRUE);
$publickey = SimpleSAML_Utilities::loadPublicKey($idpmd, TRUE);
$responsedom = new DOMDocument();
$responsedom->loadXML(str_replace("\r", "", $response));
$responseroot = $responsedom->getElementsByTagName('Response')->item(0);
$firstassertionroot = $responsedom->getElementsByTagName('Assertion')->item(0);
/* Determine what we should sign - either the Response element or the Assertion. The default
* is to sign the Assertion, but that can be overridden by the 'signresponse' option in the
* SP metadata or 'saml20.signresponse' in the global configuration.
*/
$signResponse = FALSE;
if (array_key_exists('signresponse', $spmd) && $spmd['signresponse'] !== NULL) {
$signResponse = $spmd['signresponse'];
if (!is_bool($signResponse)) {
throw new Exception('Expected the \'signresponse\' option in the metadata of the' . ' SP \'' . $spmd['entityid'] . '\' to be a boolean value.');
}
} else {
$signResponse = $this->configuration->getBoolean('shib13.signresponse', TRUE);
}
/* Check if we have an assertion to sign. Force to sign the response if not. */
if ($firstassertionroot === NULL) {
$signResponse = TRUE;
}
$signer = new SimpleSAML_XML_Signer(array('privatekey_array' => $privatekey, 'publickey_array' => $publickey, 'id' => $signResponse ? 'ResponseID' : 'AssertionID'));
if (array_key_exists('certificatechain', $idpmd)) {
$signer->addCertificate($idpmd['certificatechain']);
}
if ($signResponse) {
/* Sign the response - this must be done after encrypting the assertion. */
/* We insert the signature before the saml2p:Status element. */
$statusElements = SimpleSAML_Utilities::getDOMChildren($responseroot, 'Status', '@saml1p');
assert('count($statusElements) === 1');
$signer->sign($responseroot, $responseroot, $statusElements[0]);
} else {
/* Sign the assertion */
$signer->sign($firstassertionroot, $firstassertionroot);
}
$response = $responsedom->saveXML();
if ($this->configuration->getBoolean('debug', FALSE)) {
$p = new SimpleSAML_XHTML_Template($this->configuration, 'post-debug.php');
$p->data['header'] = 'SAML (Shibboleth 1.3) Response Debug-mode';
$p->data['RelayStateName'] = 'TARGET';
$p->data['RelayState'] = $relayState;
$p->data['destination'] = $shire;
$p->data['response'] = str_replace("\n", "", base64_encode($response));
$p->data['responseHTML'] = htmlspecialchars(SimpleSAML_Utilities::formatXMLString($response));
$p->show();
} else {
SimpleSAML_Utilities::postRedirect($shire, array('TARGET' => $relayState, 'SAMLResponse' => base64_encode($response)));
}
}
开发者ID:hukumonline,项目名称:yii,代码行数:63,代码来源:HTTPPost.php
示例6: simplesamlphp_get_entry_name
/**
* Gets the name value from an entry array.
*
* @param SimpleSAML_XHTML_Template $view The view object.
* @param array $entry The entry array.
*
* @return string The resulting name value.
*/
function simplesamlphp_get_entry_name($view, $entry = array())
{
$result = $entry['entityid'];
if (!empty($entry['name'])) {
$name = SimpleSAML\Utils\Arrays::arrayize($entry['name'], 'en');
$result = $view->getTranslation($name);
} elseif (!empty($entry['OrganizationDisplayName'])) {
$name = SimpleSAML\Utils\Arrays::arrayize($entry['OrganizationDisplayName'], 'en');
$result = $view->getTranslation($name);
}
return htmlspecialchars($result);
}
开发者ID:corycollier,项目名称:simplesamlphp-module-themes,代码行数:20,代码来源:functions.php
示例7: present_attributes
function present_attributes(SimpleSAML_XHTML_Template $t, $attributes, $nameParent)
{
$alternate = array('odd', 'even');
$i = 0;
$parentStr = strlen($nameParent) > 0 ? strtolower($nameParent) . '_' : '';
$str = strlen($nameParent) > 0 ? '<table class="attributes" summary="attribute overview">' : '<table id="table_with_attributes" class="attributes" summary="attribute overview">';
foreach ($attributes as $name => $value) {
$nameraw = $name;
$name = $t->getTranslator()->getAttributeTranslation($parentStr . $nameraw);
if (preg_match('/^child_/', $nameraw)) {
$parentName = preg_replace('/^child_/', '', $nameraw);
foreach ($value as $child) {
$str .= '<tr class="odd"><td colspan="2" style="padding: 2em">' . present_attributes($t, $child, $parentName) . '</td></tr>';
}
} else {
if (sizeof($value) > 1) {
$str .= '<tr class="' . $alternate[$i++ % 2] . '"><td class="attrname">';
if ($nameraw !== $name) {
$str .= htmlspecialchars($name) . '<br/>';
}
$str .= '<tt>' . htmlspecialchars($nameraw) . '</tt>';
$str .= '</td><td class="attrvalue"><ul>';
foreach ($value as $listitem) {
if ($nameraw === 'jpegPhoto') {
$str .= '<li><img src="data:image/jpeg;base64,' . htmlspecialchars($listitem) . '" /></li>';
} else {
$str .= '<li>' . present_assoc($listitem) . '</li>';
}
}
$str .= '</ul></td></tr>';
} elseif (isset($value[0])) {
$str .= '<tr class="' . $alternate[$i++ % 2] . '"><td class="attrname">';
if ($nameraw !== $name) {
$str .= htmlspecialchars($name) . '<br/>';
}
$str .= '<tt>' . htmlspecialchars($nameraw) . '</tt>';
$str .= '</td>';
if ($nameraw === 'jpegPhoto') {
$str .= '<td class="attrvalue"><img src="data:image/jpeg;base64,' . htmlspecialchars($value[0]) . '" /></td></tr>';
} else {
$str .= '<td class="attrvalue">' . htmlspecialchars($value[0]) . '</td></tr>';
}
}
}
$str .= "\n";
}
$str .= '</table>';
return $str;
}
开发者ID:mrvanes,项目名称:simplesamlphp,代码行数:49,代码来源:attributes.php
示例8: show
function show()
{
if (isset($_REQUEST['save'])) {
$this->saveChanges();
}
$t = new SimpleSAML_XHTML_Template($this->config, 'foodlecreate.php', 'foodle_foodle');
$t->data['optimize'] = $this->config->getValue('optimize', false);
$t->data['user'] = $this->user;
$t->data['userToken'] = $this->user->getToken();
$t->data['loginurl'] = $this->auth->getLoginURL();
$t->data['logouturl'] = $this->auth->getLogoutURL('/');
$t->data['authenticated'] = $this->auth->isAuth();
$t->data['foodleid'] = $this->foodle->identifier;
$t->data['gmapsAPI'] = $this->config->getValue('gmapsAPI');
$t->data['bread'] = array(array('href' => '/', 'title' => 'bc_frontpage'), array('href' => '/foodle/' . $this->foodle->identifier, 'title' => $this->foodle->name), array('title' => 'bc_edit'));
$t->show();
}
开发者ID:r4mp,项目名称:Foodle,代码行数:17,代码来源:PageEdit.php
示例9: show
public static function show($path = '/simplesaml/module.php/discojuice/discojuice/') {
$djconfig = SimpleSAML_Configuration::getOptionalConfig('discojuicecentral.php');
$config = SimpleSAML_Configuration::getInstance();
$feed = new sspmod_discojuice_Feed();
$metadata = json_decode($feed->read(), TRUE);
$t = new SimpleSAML_XHTML_Template($config, 'discojuice:central.tpl.php');
$t->data['metadata'] = $metadata;
$t->data['discojuice.options'] = $djconfig->getValue('discojuice.options');
$t->data['discojuice.options']['discoPath'] = $path;
$t->data['acl'] = $djconfig->getValue('acl');
$t->show();
}
开发者ID:rhertzog,项目名称:lcs,代码行数:17,代码来源:CentralHelper.php
示例10: show
function show()
{
$stats = $this->fdb->getStats();
$t = new SimpleSAML_XHTML_Template($this->config, 'foodlefront.php', 'foodle_foodle');
$t->data['optimize'] = $this->config->getValue('optimize', false);
$t->data['gmapsAPI'] = $this->config->getValue('gmapsAPI');
$t->data['bread'] = array(array('title' => 'bc_frontpage'));
$t->data['user'] = $this->user;
$t->data['authenticated'] = $this->auth->isAuth();
if ($this->auth->isAuth()) {
$t->data['userToken'] = $this->user->getToken();
}
$t->data['loginurl'] = $this->auth->getLoginURL();
$t->data['logouturl'] = $this->auth->getLogoutURL();
$t->data['enableFacebookAuth'] = $this->config->getValue('enableFacebookAuth', TRUE);
$t->data['stats'] = $stats;
$t->show();
}
开发者ID:r4mp,项目名称:Foodle,代码行数:18,代码来源:PageFront.php
示例11: show
function show()
{
$t = new SimpleSAML_XHTML_Template($this->config, 'support.php', 'foodle_foodle');
$t->data['bread'] = array(array('href' => '/' . $this->config->getValue('baseurlpath'), 'title' => 'bc_frontpage'), array('title' => 'Support'));
$t->data['gmapsAPI'] = $this->config->getValue('gmapsAPI');
$t->data['optimize'] = $this->config->getValue('optimize', false);
// $t->data['user'] = $this->user;
// $t->data['userid'] = $this->user->userid;
// $t->data['displayname'] = $this->user->username;
$t->data['authenticated'] = $this->auth->isAuth();
// FastPass::$domain = "tjenester.ecampus.no";
// $t->data['getsatisfactionscript'] = FastPass::script(
// $this->config->getValue('getsatisfaction.key'), $this->config->getValue('getsatisfaction.secret'),
// $this->user->email, $this->user->username, $this->user->userid);
// $t->data['loginurl'] = $this->auth->getLoginURL();
// $t->data['url'] = $this->auth->getURL();
$t->data['loginurl'] = $this->auth->getLoginURL();
$t->data['logouturl'] = $this->auth->getLogoutURL();
$t->show();
}
开发者ID:r4mp,项目名称:Foodle,代码行数:20,代码来源:PageSupport.php
示例12: show
function show()
{
$entries = $this->fdb->getYourEntries($this->user);
$statstotal = $this->fdb->getStatsRealm();
$statsweek = $this->fdb->getStatsRealm(60 * 60 * 24 * 7);
$statsday = $this->fdb->getStatsRealm(60 * 60 * 24);
$totals = array('total' => 0, 'week' => 0, 'day' => 0);
$stats = array();
foreach ($statstotal as $s) {
$stats[$s['realm']] = array('total' => $s);
$totals['total'] += $s['c'];
}
foreach ($statsweek as $s) {
$stats[$s['realm']]['week'] = $s;
$totals['week'] += $s['c'];
}
foreach ($statsday as $s) {
$stats[$s['realm']]['day'] = $s;
$totals['day'] += $s['c'];
}
$realm = NULL;
if (!empty($_REQUEST['realm']) && array_key_exists($_REQUEST['realm'], $stats)) {
$realm = $_REQUEST['realm'];
}
$users = $this->fdb->getRecentUsers($realm);
// ---- o ----- o ---- o ----- o ---- o ----- o
$t = new SimpleSAML_XHTML_Template($this->config, 'stats.php', 'foodle_foodle');
$t->data['optimize'] = $this->config->getValue('optimize', false);
$t->data['showsupport'] = TRUE;
$t->data['gmapsAPI'] = $this->config->getValue('gmapsAPI');
$t->data['loginurl'] = $this->auth->getLoginURL();
$t->data['logouturl'] = $this->auth->getLogoutURL();
$t->data['bread'] = array(array('href' => '/' . $this->config->getValue('baseurlpath'), 'title' => 'bc_frontpage'), array('href' => '/stats', 'title' => 'Statistics'));
$t->data['user'] = $this->user;
$t->data['users'] = $users;
$t->data['statsrealm'] = $stats;
$t->data['totalsrealm'] = $totals;
$t->show();
}
开发者ID:r4mp,项目名称:Foodle,代码行数:39,代码来源:PageStats.php
示例13: show
function show()
{
if (isset($_REQUEST['save'])) {
$this->saveChanges();
}
if (isset($_REQUEST['col'])) {
$this->foodle->fixDate($_REQUEST['col']);
}
$t = new SimpleSAML_XHTML_Template($this->config, 'fixdate.php', 'foodle_foodle');
$t->data['authenticated'] = $this->auth->isAuth();
$t->data['user'] = $this->user;
$t->data['timezone'] = $this->timezone;
$t->data['ftimezone'] = $this->foodle->timezone;
$t->data['name'] = $this->foodle->name;
$t->data['identifier'] = $this->foodle->identifier;
$t->data['descr'] = $this->foodle->descr;
$t->data['foodle'] = $this->foodle;
$t->data['today'] = date('Y-m-d');
$t->data['tomorrow'] = date('Y-m-d', time() + 60 * 60 * 24);
$t->data['bread'] = array(array('href' => '/', 'title' => 'bc_frontpage'), array('href' => '/foodle/' . $this->foodle->identifier . '#responses', 'title' => $this->foodle->name), array('title' => 'Fix timeslot'));
$t->show();
}
开发者ID:r4mp,项目名称:Foodle,代码行数:22,代码来源:FixDate.php
示例14: show
/**
* Show the error to the user.
*
* This function does not return.
*/
public function show()
{
header('HTTP/1.0 500 Internal Server Error');
$errorData = $this->saveError();
$session = SimpleSAML_Session::getInstance();
$attributes = $session->getAttributes();
if (isset($attributes['mail'][0])) {
$email = $attributes['mail'][0];
} else {
$email = '';
}
$globalConfig = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($globalConfig, 'core:no_state.tpl.php');
/* Enable error reporting if we have a valid technical contact email. */
if ($globalConfig->getString('technicalcontact_email', '[email protected]') !== '[email protected]') {
/* Enable error reporting. */
$baseurl = SimpleSAML_Utilities::getBaseURL();
$t->data['errorReportAddress'] = $baseurl . 'errorreport.php';
$t->data['reportId'] = $errorData['reportId'];
$t->data['email'] = $email;
}
$t->show();
exit;
}
开发者ID:filonuse,项目名称:fedlab,代码行数:29,代码来源:NoState.php
示例15: process
/**
* Apply filter to add or replace attributes.
*
* Add or replace existing attributes with the configured values.
*
* @param array &$request The current request
*/
public function process(&$request)
{
assert('is_array($request)');
assert('array_key_exists("Attributes", $request)');
$attributes =& $request['Attributes'];
$attrlang = NULL;
if (array_key_exists($this->langattr, $attributes)) {
$attrlang = $attributes[$this->langattr][0];
}
$config = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($config, 'frontpage');
$lang = $t->getLanguage(FALSE, FALSE);
if (isset($attrlang)) {
SimpleSAML_Logger::debug('LanguageAdaptor: Language in attribute was set [' . $attrlang . ']');
}
if (isset($lang)) {
SimpleSAML_Logger::debug('LanguageAdaptor: Language in session was set [' . $lang . ']');
}
if (isset($attrlang)) {
if (!isset($lang)) {
$t->setLanguage($attrlang);
$_GET['language'] = $attrlang;
} else {
// Language was set in both attributes and session.
if ($lang !== $attrlang) {
// Different language set in attributes and session.
}
}
} else {
if (isset($lang)) {
$request['Attributes'][$this->langattr] = array($lang);
} else {
// Language was neighter set in attributes or in session
}
}
}
开发者ID:hukumonline,项目名称:yii,代码行数:43,代码来源:LanguageAdaptor.php
示例16: getLanguage
/**
* getLanguage() will return the language selected by the user, or the default language
* This function first looks for a cached language code,
* then checks for a language cookie,
* then it tries to calculate the preferred language from HTTP headers.
* Last it returns the default language.
*/
public function getLanguage()
{
// Language is set in object
if (isset($this->language)) {
return $this->language;
}
// Language is provided in a stored COOKIE
$languageCookie = SimpleSAML_XHTML_Template::getLanguageCookie();
if ($languageCookie !== NULL) {
$this->language = $languageCookie;
return $languageCookie;
}
/* Check if we can find a good language from the Accept-Language http header. */
$httpLanguage = $this->getHTTPLanguage();
if ($httpLanguage !== NULL) {
return $httpLanguage;
}
// Language is not set, and we get the default language from the configuration.
return $this->getDefaultLanguage();
}
开发者ID:filonuse,项目名称:fedlab,代码行数:27,代码来源:Template.php
示例17: process
/**
* Apply filter to add or replace attributes.
*
* Add or replace existing attributes with the configured values.
*
* @param array &$request The current request
*/
public function process(&$request)
{
assert('is_array($request)');
assert('array_key_exists("Attributes", $request)');
$attributes =& $request['Attributes'];
$attrlang = NULL;
if (array_key_exists($this->langattr, $attributes)) {
$attrlang = $attributes[$this->langattr][0];
}
$lang = SimpleSAML_XHTML_Template::getLanguageCookie();
if (isset($attrlang)) {
SimpleSAML_Logger::debug('LanguageAdaptor: Language in attribute was set [' . $attrlang . ']');
}
if (isset($lang)) {
SimpleSAML_Logger::debug('LanguageAdaptor: Language in session was set [' . $lang . ']');
}
if (isset($attrlang) && !isset($lang)) {
// Language set in attribute but not in cookie - update cookie
SimpleSAML_XHTML_Template::setLanguageCookie($attrlang);
} elseif (!isset($attrlang) && isset($lang)) {
// Language set in cookie, but not in attribute. Update attribute
$request['Attributes'][$this->langattr] = array($lang);
}
}
开发者ID:PitcherAG,项目名称:simplesamlphp,代码行数:31,代码来源:LanguageAdaptor.php
示例18: handleRequest
/**
* Handles a request to this discovery service.
*
* The IdP disco parameters should be set before calling this function.
*/
public function handleRequest()
{
$idp = $this->getTargetIdp();
if ($idp !== NULL) {
$extDiscoveryStorage = $this->config->getString('idpdisco.extDiscoveryStorage', NULL);
if ($extDiscoveryStorage !== NULL) {
$this->log('Choice made [' . $idp . '] (Forwarding to external discovery storage)');
SimpleSAML_Utilities::redirectTrustedURL($extDiscoveryStorage, array('entityID' => $this->spEntityId, 'IdPentityID' => $idp, 'returnIDParam' => $this->returnIdParam, 'isPassive' => 'true', 'return' => $this->returnURL));
} else {
$this->log('Choice made [' . $idp . '] (Redirecting the user back. returnIDParam=' . $this->returnIdParam . ')');
SimpleSAML_Utilities::redirectTrustedURL($this->returnURL, array($this->returnIdParam => $idp));
}
return;
}
if ($this->isPassive) {
$this->log('Choice not made. (Redirecting the user back without answer)');
SimpleSAML_Utilities::redirectTrustedURL($this->returnURL);
return;
}
/* No choice made. Show discovery service page. */
$idpList = $this->getIdPList();
$idpList = $this->idplistStructured($this->filterList($idpList));
$preferredIdP = $this->getRecommendedIdP();
$t = new SimpleSAML_XHTML_Template($this->config, 'discopower:disco-tpl.php', 'disco');
$t->data['idplist'] = $idpList;
$t->data['preferredidp'] = $preferredIdP;
$t->data['return'] = $this->returnURL;
$t->data['returnIDParam'] = $this->returnIdParam;
$t->data['entityID'] = $this->spEntityId;
$t->data['urlpattern'] = htmlspecialchars(SimpleSAML_Utilities::selfURLNoQuery());
$t->data['rememberenabled'] = $this->config->getBoolean('idpdisco.enableremember', FALSE);
$t->data['rememberchecked'] = $this->config->getBoolean('idpdisco.rememberchecked', FALSE);
$t->data['defaulttab'] = $this->discoconfig->getValue('defaulttab', 0);
$t->data['score'] = $this->discoconfig->getValue('score', 'quicksilver');
$t->show();
}
开发者ID:shirlei,项目名称:simplesaml,代码行数:41,代码来源:PowerIdPDisco.php
示例19: array_key_exists
$metaBuilder->addSecurityTokenServiceType($metaArray);
$metaBuilder->addOrganizationInfo($metaArray);
$technicalContactEmail = $config->getString('technicalcontact_email', null);
if ($technicalContactEmail && $technicalContactEmail !== '[email protected]') {
$metaBuilder->addContact('technical', \SimpleSAML\Utils\Config\Metadata::getContact(array('emailAddress' => $technicalContactEmail, 'name' => $config->getString('technicalcontact_name', null), 'contactType' => 'technical')));
}
$output_xhtml = array_key_exists('output', $_GET) && $_GET['output'] == 'xhtml';
$metaxml = $metaBuilder->getEntityDescriptorText($output_xhtml);
if (!$output_xhtml) {
$metaxml = str_replace("\n", '', $metaxml);
}
// sign the metadata if enabled
$metaxml = SimpleSAML_Metadata_Signer::sign($metaxml, $idpmeta->toArray(), 'ADFS IdP');
if ($output_xhtml) {
$defaultidp = $config->getString('default-adfs-idp', null);
$t = new SimpleSAML_XHTML_Template($config, 'metadata.php', 'admin');
$t->data['clipboard.js'] = true;
$t->data['available_certs'] = $availableCerts;
$t->data['header'] = 'adfs-idp';
// TODO: Replace with headerString in 2.0
$t->data['headerString'] = $t->noop('metadata_adfs-idp');
$t->data['metaurl'] = \SimpleSAML\Utils\HTTP::getSelfURLNoQuery();
$t->data['metadata'] = htmlspecialchars($metaxml);
$t->data['metadataflat'] = htmlspecialchars($metaflat);
$t->data['defaultidp'] = $defaultidp;
$t->show();
} else {
header('Content-Type: application/xml');
// make sure to export only the md:EntityDescriptor
$metaxml = substr($metaxml, strpos($metaxml, '<md:EntityDescriptor'));
// 22 = strlen('</md:EntityDescriptor>')
开发者ID:simplesamlphp,项目名称:simplesamlphp,代码行数:31,代码来源:metadata.php
示例20: elseif
} elseif (array_key_exists('RedirInfo', $_REQUEST)) {
$encData = base64_decode($_REQUEST['RedirInfo']);
if (empty($encData)) {
throw new SimpleSAML_Error_BadRequest('Invalid RedirInfo data.');
}
list($sessionId, $postId) = explode(':', SimpleSAML\Utils\Crypto::aesDecrypt($encData));
if (empty($sessionId) || empty($postId)) {
throw new SimpleSAML_Error_BadRequest('Invalid session info data.');
}
$session = SimpleSAML_Session::getSession($sessionId);
} else {
throw new SimpleSAML_Error_BadRequest('Missing redirection info parameter.');
}
if ($session === NULL) {
throw new Exception('Unable to load session.');
}
$postData = $session->getData('core_postdatalink', $postId);
if ($postData === NULL) {
/* The post data is missing, probably because it timed out. */
throw new Exception('The POST data we should restore was lost.');
}
$session->deleteData('core_postdatalink', $postId);
assert('is_array($postData)');
assert('array_key_exists("url", $postData)');
assert('array_key_exists("post", $postData)');
$config = SimpleSAML_Configuration::getInstance();
$p = new SimpleSAML_XHTML_Template($config, 'post.php');
$p->data['destination'] = $postData['url'];
$p->data['post'] = $postData['post'];
$p->show();
exit(0);
开发者ID:jstormes,项目名称:simplesamlphp,代码行数:31,代码来源:postredirect.php
注:本文中的SimpleSAML_XHTML_Template类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论