本文整理汇总了PHP中SimpleSAML_Utilities::addURLParameter方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_Utilities::addURLParameter方法的具体用法?PHP SimpleSAML_Utilities::addURLParameter怎么用?PHP SimpleSAML_Utilities::addURLParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleSAML_Utilities
的用法示例。
在下文中一共展示了SimpleSAML_Utilities::addURLParameter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SimpleSAML_Error_BadRequest
<?php
/**
* This is the page the user lands on when choosing "no" in the consent form.
*
* @package simpleSAMLphp
* @version $Id$
*/
if (!array_key_exists('StateId', $_REQUEST)) {
throw new SimpleSAML_Error_BadRequest('Missing required StateId query parameter.');
}
$id = $_REQUEST['StateId'];
$state = SimpleSAML_Auth_State::loadState($id, 'consent:request');
$resumeFrom = SimpleSAML_Module::getModuleURL('consent/getconsent.php');
$resumeFrom = SimpleSAML_Utilities::addURLParameter($resumeFrom, array('StateId' => $id));
$aboutService = NULL;
if (isset($state['Destination']['url.about'])) {
$aboutService = $state['Destination']['url.about'];
}
$globalConfig = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($globalConfig, 'consent:noconsent.php');
$t->data['dstMetadata'] = $state['Destination'];
$t->data['resumeFrom'] = $resumeFrom;
$t->data['aboutService'] = $aboutService;
$t->show();
示例2: array
$metaBuilder->addContact('technical', array('emailAddress' => $config->getString('technicalcontact_email', NULL), 'name' => $config->getString('technicalcontact_name', NULL)));
$metaxml = $metaBuilder->getEntityDescriptorText();
/* Sign the metadata if enabled. */
$metaxml = SimpleSAML_Metadata_Signer::sign($metaxml, $spmeta, 'SAML 2 SP');
/*
* Generate list of IdPs that you can send metadata to.
*/
$idplist = $metadata->getList('saml20-idp-remote');
$idpsend = array();
foreach ($idplist as $entityid => $mentry) {
if (array_key_exists('send_metadata_email', $mentry)) {
$idpsend[$entityid] = $mentry;
}
}
$adminok = SimpleSAML_Utilities::isAdmin();
$adminlogin = SimpleSAML_Utilities::getAdminLoginURL(SimpleSAML_Utilities::addURLParameter(SimpleSAML_Utilities::selfURLNoQuery(), array('output' => 'xhtml')));
$sentok = FALSE;
/*
* Send metadata to Identity Provider, if the user filled submitted the form
*/
if (array_key_exists('sendtoidp', $_POST)) {
if (!array_key_exists($_POST['sendtoidp'], $idpsend)) {
throw new Exception('Entity ID ' . $_POST['sendtoidp'] . ' not found in metadata. Cannot send metadata to this IdP.');
}
$emailadr = $idpsend[$_POST['sendtoidp']]['send_metadata_email'];
$from = $_POST['email'];
$message = '<h1>simpleSAMLphp SAML 2.0 Service Provider Metadata</h1>
<p>Metadata was sent to you from a simpleSAMLphp SAML 2.0 Service Provider. The service provider requests to connect to the following Identity Provider:
<ul>
<li><tt>' . htmlentities($_POST['sendtoidp']) . '</tt></li>
示例3: checkCookie
/**
* Check for session cookie, and show missing-cookie page if it is missing.
*
* @param string|NULL $retryURL The URL the user should access to retry the operation.
*/
public static function checkCookie($retryURL = NULL)
{
assert('is_string($retryURL) || is_null($retryURL)');
$session = SimpleSAML_Session::getInstance();
if ($session->hasSessionCookie()) {
return;
}
/* We didn't have a session cookie. Redirect to the no-cookie page. */
$url = SimpleSAML_Module::getModuleURL('core/no_cookie.php');
if ($retryURL !== NULL) {
$url = SimpleSAML_Utilities::addURLParameter($url, array('retryURL' => $retryURL));
}
SimpleSAML_Utilities::redirect($url);
}
示例4: createPostRedirectLink
/**
* Create a link which will POST data.
*
* @param string $destination The destination URL.
* @param array $post The name-value pairs which will be posted to the destination.
* @return string An URL which can be accessed to post the data.
*/
public static function createPostRedirectLink($destination, $post)
{
assert('is_string($destination)');
assert('is_array($post)');
$id = SimpleSAML_Utilities::generateID();
$postData = array('post' => $post, 'url' => $destination);
$session = SimpleSAML_Session::getInstance();
$session->setData('core_postdatalink', $id, $postData);
return SimpleSAML_Utilities::addURLParameter(SimpleSAML_Module::getModuleURL('core/postredirect.php'), array('RedirId' => $id));
}