File: trust.php

package info (click to toggle)
simplesamlphp 1.13.1-2%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 11,304 kB
  • sloc: php: 65,124; xml: 629; python: 376; sh: 193; perl: 185; makefile: 43
file content (36 lines) | stat: -rw-r--r-- 942 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

if (!is_string($_REQUEST['StateID'])) {
	throw new SimpleSAML_Error_BadRequest('Missing StateID-parameter.');
}
$StateID = $_REQUEST['StateID'];

$server = sspmod_openidProvider_Server::getInstance();
$state = $server->loadState($_REQUEST['StateID']);

$trustRoot = $state['request']->trust_root;
$identity = $server->getIdentity();
if ($identity === NULL) {
	$server->processRequest($state);
}


if (isset($_REQUEST['TrustYes'])) {
	if (isset($_REQUEST['TrustRemember'])) {
		$server->addTrustRoot($identity, $trustRoot);
	}

	$state['TrustResponse'] = TRUE;
	$server->processRequest($state);
}

if (isset($_REQUEST['TrustNo'])) {
	$state['TrustResponse'] = FALSE;
	$server->processRequest($state);
}

$globalConfig = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($globalConfig, 'openidProvider:trust.tpl.php');
$t->data['StateID'] = $_REQUEST['StateID'];
$t->data['trustRoot'] = $trustRoot;
$t->show();