File: user.tpl.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 (81 lines) | stat: -rw-r--r-- 3,040 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
$identity = $this->data['identity'];
$loggedInAs = $this->data['loggedInAs'];
$loginURL = $this->data['loginURL'];
$logoutURL = $this->data['logoutURL'];
$ownPage = $this->data['ownPage'];
$serverURL = $this->data['serverURL'];
$trustedSites = $this->data['trustedSites'];
$userId = $this->data['userId'];
$userIdURL = $this->data['userIdURL'];
$xrdsURL = $this->data['xrdsURL'];

header('X-XRDS-Location: ' . $xrdsURL);

if ($userId !== FALSE) {
	$title = $this->t('{openidProvider:openidProvider:title_user}', array('%USERID%' => htmlspecialchars($userId)));
} else {
	$title = $this->t('{openidProvider:openidProvider:title_no_user}');
}

$serverLink = '<link rel="openid.server" href="' . htmlspecialchars($serverURL) . '" />' . "\n";
$serverLink .= '<link rel="openid2.provider" href="' . htmlspecialchars($serverURL) . '" />';
$delegateLink = '<link rel="openid.delegate" href="' . htmlspecialchars($userIdURL) . '" />' . "\n";
$delegateLink .= '<link rel="openid2.local_id" href="' . htmlspecialchars($userIdURL) . '" />';

$this->data['header'] = $title;
$this->data['head'] = $serverLink;
$this->includeAtTemplateBase('includes/header.php');

echo('<h2>' . $title . '</h2>');

if ($userId !== FALSE) {
	echo('<p>' . $this->t('{openidProvider:openidProvider:user_page_for}', array('%USERID%' => htmlspecialchars($userId))) . '</p>');
}

if ($loggedInAs === NULL) {
	echo('<p><a href="' . htmlspecialchars($loginURL) . '">' . $this->t('{openidProvider:openidProvider:login_view_own_page}') . '</a></p>');
} elseif (!$ownPage) {
	echo('<p><a href="' . htmlspecialchars($identity) . '">' . $this->t('{openidProvider:openidProvider:view_own_page}') . '</a></p>');
}

if ($ownPage) {


	echo('<h3>Using your OpenID</h3>');
	echo('<p>');
	echo($this->t('{openidProvider:openidProvider:your_identifier}') . '<br />');
	echo('<code>' . htmlspecialchars($userIdURL) . '</code>');
	echo('</p>');
	echo('<p>');
	echo($this->t('{openidProvider:openidProvider:howto_delegate}'));
	echo('<br />');
	echo('<pre>' . htmlspecialchars($serverLink) . "\n" . htmlspecialchars($delegateLink) . '</pre>');
	echo('</p>');

	echo('<h3>' . $this->t('{openidProvider:openidProvider:trustlist_trustedsites}') . '</h3>');
	if (count($trustedSites) > 0) {
		echo('<div class="form">');
		echo('<form method="post" action="?">');
		echo('<ul>');

		foreach ($trustedSites as $site) {
			echo '<li>';
			echo '<input type="submit" name="remove_' . bin2hex($site) .
				'" value="' . $this->t('{openidProvider:openidProvider:trustlist_remove}') . '" />';
			echo ' <code>' . htmlspecialchars($site) . '</code>';
			echo '</li>';
		}
		echo('</ul>');
		echo('</form>');
		echo('</div>');
	} else {
		echo('<p>' . $this->t('{openidProvider:openidProvider:trustlist_nosites}') . '</p>');
	}

	echo('<h3>' . $this->t('{openidProvider:openidProvider:logout_title}') . '</h3>');
	echo('<p><a href="' . htmlspecialchars($logoutURL) . '">' . $this->t('{openidProvider:openidProvider:logout}') . '</a></p>');
}

$this->includeAtTemplateBase('includes/footer.php');
?>