forked from cilogon/service
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex-functions.php
More file actions
64 lines (56 loc) · 1.84 KB
/
index-functions.php
File metadata and controls
64 lines (56 loc) · 1.84 KB
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
<?php
/**
* This file contains functions called by index-site.php. The index-site.php
* file should include this file with the following statement at the top:
*
* require_once __DIR__ . '/index-functions.php';
*/
use CILogon\Service\Util;
use CILogon\Service\Content;
use CILogon\Service\Loggit;
/**
* printLogonPage
*
* This function prints out the HTML for the main cilogon.org page.
* Explanatory text is shown as well as a button to log in to an IdP
* and get rerouted to the Shibboleth protected service script, or the
* OpenID script.
*
* @param bool $clearcookies True if the Shibboleth cookies and session
* variables should be cleared out before displaying the page.
* Defaults to false.
*/
function printLogonPage($clearcookies = false)
{
if ($clearcookies) {
Util::removeShibCookies();
Util::unsetAllUserSessionVars();
Util::getSkin()->init(true); // Clear cilogon_skin var; check for forced skin
}
$log = new Loggit();
$log->info('Welcome page hit.', false, false);
Content::printHeader(_('Welcome To The CILogon Service'));
Content::printWAYF();
Content::printFooter();
}
/**
* printMainPage
*
* This function prints out the HTML for the main page where the user
* can view their attributes (user and IdP). Before June 2025, the user
* could also download a certificate.
*/
function printMainPage()
{
$log = new Loggit();
$log->info('Get And Use Certificate page hit.', false, false);
// CIL-626 Allow browser 'reload page' by adding CSRF to the PHP session
Util::setSessionVar('submit', 'Proceed');
Util::setSessionVar('stage', 'MainPage');
Util::getCsrf()->setTheSession();
Content::printHeader('CILogon Service');
Content::printUserAttributes();
Content::printIdPMetadata();
Content::printLogOff();
Content::printFooter();
}