本文整理汇总了PHP中SimpleSAML_XHTML_Template::show方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleSAML_XHTML_Template::show方法的具体用法?PHP SimpleSAML_XHTML_Template::show怎么用?PHP SimpleSAML_XHTML_Template::show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleSAML_XHTML_Template
的用法示例。
在下文中一共展示了SimpleSAML_XHTML_Template::show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例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();
}
示例3: 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;
}
示例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;
}
示例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)));
}
}
示例6: 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();
}
示例7: 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();
}
示例8: 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();
}
示例9: 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();
}
示例10: 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();
}
示例11: 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();
}
示例12: 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', 'na@example.org') !== 'na@example.org') {
/* 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;
}
示例13: show
/**
* Display this error.
*
* This method displays a standard SimpleSAMLphp error page and exits.
*/
public function show()
{
$this->setHTTPCode();
// log the error message
$this->logError();
$errorData = $this->saveError();
$config = SimpleSAML_Configuration::getInstance();
$data['showerrors'] = $config->getBoolean('showerrors', true);
$data['error'] = $errorData;
$data['errorCode'] = $this->errorCode;
$data['parameters'] = $this->parameters;
$data['module'] = $this->module;
$data['dictTitle'] = $this->dictTitle;
$data['dictDescr'] = $this->dictDescr;
$data['includeTemplate'] = $this->includeTemplate;
$data['clipboard.js'] = true;
// check if there is a valid technical contact email address
if ($config->getBoolean('errorreporting', true) && $config->getString('technicalcontact_email', 'na@example.org') !== 'na@example.org') {
// enable error reporting
$baseurl = \SimpleSAML\Utils\HTTP::getBaseURL();
$data['errorReportAddress'] = $baseurl . 'errorreport.php';
}
$data['email'] = '';
$session = SimpleSAML_Session::getSessionFromRequest();
$authorities = $session->getAuthorities();
foreach ($authorities as $authority) {
$attributes = $session->getAuthData($authority, 'Attributes');
if ($attributes !== null && array_key_exists('mail', $attributes) && count($attributes['mail']) > 0) {
$data['email'] = $attributes['mail'][0];
break;
// enough, don't need to get all available mails, if more than one
}
}
$show_function = $config->getArray('errors.show_function', null);
if (isset($show_function)) {
assert('is_callable($show_function)');
call_user_func($show_function, $config, $data);
assert('FALSE');
} else {
$t = new SimpleSAML_XHTML_Template($config, 'error.php', 'errors');
$t->data = array_merge($t->data, $data);
$t->show();
}
exit;
}
示例14: submitPOSTData
/**
* Submit a POST form to a specific destination.
*
* This function never returns.
*
* @param string $destination The destination URL.
* @param array $data An associative array with the data to be posted to $destination.
*
* @throws \InvalidArgumentException If $destination is not a string or $data is not an array.
*
* @author Olav Morken, UNINETT AS <olav.morken@uninett.no>
* @author Andjelko Horvat
* @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no>
*/
public static function submitPOSTData($destination, $data)
{
if (!is_string($destination) || !is_array($data)) {
throw new \InvalidArgumentException('Invalid input parameters.');
}
$config = \SimpleSAML_Configuration::getInstance();
$allowed = $config->getBoolean('enable.http_post', false);
if ($allowed && preg_match("#^http:#", $destination) && self::isHTTPS()) {
// we need to post the data to HTTP
self::redirect(self::getSecurePOSTRedirectURL($destination, $data));
}
$p = new \SimpleSAML_XHTML_Template($config, 'post.php');
$p->data['destination'] = $destination;
$p->data['post'] = $data;
$p->show();
exit(0);
}
示例15: handleRequest
/**
* Handles a request to this discovery service.
*
* The IdP disco parameters should be set before calling this function.
*/
public function handleRequest()
{
$this->start();
// no choice made. Show discovery service page
$idpList = $this->getIdPList();
$idpList = $this->idplistStructured($this->filterList($idpList));
$preferredIdP = $this->getRecommendedIdP();
$faventry = NULL;
foreach ($idpList as $tab => $slist) {
if (!empty($preferredIdP) && array_key_exists($preferredIdP, $slist)) {
$faventry = $slist[$preferredIdP];
}
}
$t = new SimpleSAML_XHTML_Template($this->config, 'discopower:disco.tpl.php', 'disco');
$discoPowerTabs = array('denmark' => $t->noop('{discopower:tabs:denmark}'), 'edugain' => $t->noop('{discopower:tabs:edugain}'), 'finland' => $t->noop('{discopower:tabs:finland}'), 'greece' => $t->noop('{discopower:tabs:greece}'), 'iceland' => $t->noop('{discopower:tabs:iceland}'), 'incommon' => $t->noop('{discopower:tabs:incommon}'), 'kalmar' => $t->noop('{discopower:tabs:kalmar}'), 'misc' => $t->noop('{discopower:tabs:misc}'), 'norway' => $t->noop('{discopower:tabs:norway}'), 'sweden' => $t->noop('{discopower:tabs:sweden}'), 'switzerland' => $t->noop('{discopower:tabs:switzerland}'), 'ukacessfederation' => $t->noop('{discopower:tabs:ukacessfederation}'));
$t->data['faventry'] = $faventry;
$t->data['tabNames'] = $discoPowerTabs;
$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\Utils\HTTP::getSelfURLNoQuery());
$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();
}