File: login-infocard.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 (64 lines) | stat: -rw-r--r-- 2,213 bytes parent folder | download | duplicates (2)
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

/*
* AUTHOR: Samuel Muñoz Hidalgo
* EMAIL: samuel.mh@gmail.com
* LAST REVISION: 13-FEB-09
* DESCRIPTION:
*		User flow controller.
*		Displays the template and request a non null xmlToken
*/



/* Load the configuration. */
$config = SimpleSAML_Configuration::getInstance();
$autoconfig = $config->copyFromBase('logininfocard', 'config-login-infocard.php');

$server_key = $autoconfig->getValue('server_key');
$server_crt = $autoconfig->getValue('server_crt');
$IClogo = $autoconfig->getValue('IClogo');
$Infocard =   $autoconfig->getValue('InfoCard');
$cardGenerator =   $autoconfig->getValue('CardGenerator');
$sts_crt = $autoconfig->getValue('sts_crt');
$help_desk_email_URL = $autoconfig->getValue('help_desk_email_URL');
$contact_info_URL = $autoconfig->getValue('contact_info_URL');


/* Load the session of the current user. */
$session = SimpleSAML_Session::getSessionFromRequest();


if (!array_key_exists('AuthState', $_REQUEST)) {
SimpleSAML_Logger::debug('NO AUTH STATE');
SimpleSAML_Logger::debug('ERROR: NO AUTH STATE');
	throw new SimpleSAML_Error_BadRequest('Missing AuthState parameter.');
} else {
	$authStateId = $_REQUEST['AuthState'];
SimpleSAML_Logger::debug('AUTH STATE:  '.$authStateId);
}

if(array_key_exists('xmlToken', $_POST) && ($_POST['xmlToken']!=NULL)  ) {
SimpleSAML_Logger::debug('HAY XML TOKEN');
	$error = sspmod_InfoCard_Auth_Source_ICAuth::handleLogin($authStateId, $_POST['xmlToken']);
}else {
SimpleSAML_Logger::debug('NO HAY XML TOKEN');
	$error = NULL;
}

unset($_POST); //Show the languages bar if reloaded
 
//Login Page
$t = new SimpleSAML_XHTML_Template($config, 'InfoCard:temp-login.php', 'InfoCard:dict-InfoCard'); //(configuracion, template, diccionario)
$t->data['header'] = 'simpleSAMLphp: Infocard login';
$t->data['stateparams'] = array('AuthState' => $authStateId);
$t->data['IClogo'] = $IClogo;
$t->data['InfoCard'] = $Infocard;
$t->data['InfoCard']['issuer'] = $autoconfig->getValue('tokenserviceurl');//sspmod_InfoCard_Utils::getIssuer($sts_crt);
$t->data['CardGenerator'] = $cardGenerator;
$t->data['help_desk_email_URL'] = $help_desk_email_URL;
$t->data['contact_info_URL'] = $contact_info_URL;
$t->data['error'] = $error;
$t->show();
exit();
?>