1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file contains functions called by index-site.php. The index-site.php |
5
|
|
|
* file should include this file with the following statement at the top: |
6
|
|
|
* |
7
|
|
|
* require_once __DIR__ . '/index-functions.php'; |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
use CILogon\Service\Util; |
11
|
|
|
use CILogon\Service\Content; |
12
|
|
|
use CILogon\Service\Loggit; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* printLogonPage |
16
|
|
|
* |
17
|
|
|
* This function prints out the HTML for the main cilogon.org page. |
18
|
|
|
* Explanatory text is shown as well as a button to log in to an IdP |
19
|
|
|
* and get rerouted to the Shibboleth protected service script, or the |
20
|
|
|
* OpenID script. |
21
|
|
|
* |
22
|
|
|
* @param bool $clearcookies True if the Shibboleth cookies and session |
23
|
|
|
* variables should be cleared out before displaying the page. |
24
|
|
|
* Defaults to false. |
25
|
|
|
*/ |
26
|
|
|
function printLogonPage($clearcookies = false) |
|
|
|
|
27
|
|
|
{ |
28
|
|
|
if ($clearcookies) { |
29
|
|
|
Util::removeShibCookies(); |
30
|
|
|
Util::unsetAllUserSessionVars(); |
31
|
|
|
Util::getSkin()->init(true); // Clear cilogon_skin var; check for forced skin |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
$log = new Loggit(); |
35
|
|
|
$log->info('Welcome page hit.'); |
36
|
|
|
|
37
|
|
|
Util::setSessionVar('stage', 'logon'); // For Show/Hide Help button clicks |
38
|
|
|
|
39
|
|
|
Content::printHeader('Welcome To The CILogon Service'); |
40
|
|
|
Content::printWAYF(); |
41
|
|
|
Content::printFooter(); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* printMainPage |
46
|
|
|
* |
47
|
|
|
* This function prints out the HTML for the main page where the user |
48
|
|
|
* can download a certificate. |
49
|
|
|
*/ |
50
|
|
|
function printMainPage() |
|
|
|
|
51
|
|
|
{ |
52
|
|
|
$log = new Loggit(); |
53
|
|
|
$log->info('Get And Use Certificate page hit.'); |
54
|
|
|
|
55
|
|
|
Util::setSessionVar('stage', 'main'); // For Show/Hide Help button clicks |
56
|
|
|
// CIL-626 Allow browser 'reload page' by adding CSRF to the PHP session |
57
|
|
|
Util::setSessionVar('submit', 'Proceed'); |
58
|
|
|
Util::getCsrf()->setTheSession(); |
59
|
|
|
|
60
|
|
|
Content::printHeader('Get Your Certificate'); |
61
|
|
|
Content::printGetCertificate(); |
|
|
|
|
62
|
|
|
Content::printCertInfo(); |
|
|
|
|
63
|
|
|
Content::printUserAttributes(); |
|
|
|
|
64
|
|
|
Content::printIdPMetadata(); |
|
|
|
|
65
|
|
|
Content::printLogOff(); |
|
|
|
|
66
|
|
|
Content::printFooter(); |
67
|
|
|
} |
68
|
|
|
|
This check looks for functions that have already been defined in other files.
Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the
@ignore
annotation.See also the PhpDoc documentation for @ignore.