forked from Sitatech/ilias_E-learning
/
shib_login.php
executable file
·44 lines (36 loc) · 1.6 KB
/
shib_login.php
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
<?php
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
/**
* Shibboleth login script for ilias
*
* $Id: shib_login.php 24136 2010-06-09 18:54:27Z smeyer $
* @author Lukas Haemmerle <haemmerle@switch.ch>
* @package ilias-layout
*/
// Load all the IILIAS stuff
require_once "include/inc.header.php";
if (!$_SERVER['HTTP_SHIB_APPLICATION_ID'] && !$_SERVER['Shib-Application-ID'])
{
$message = "This file must be protected by Shibboleth, otherwise you cannot use Shibboleth authentication! Consult the <a href=\"Services/AuthShibboleth/README.SHIBBOLETH.txt\">documentation</a> on how to configure Shibboleth authentication properly.";
$ilias->raiseError($message,$ilias->error_obj->WARNING);
}
// Check if all the essential attributes are available
if (
!$_SERVER[$ilias->getSetting('shib_login')]
|| !$_SERVER[$ilias->getSetting('shib_firstname')]
|| !$_SERVER[$ilias->getSetting('shib_lastname')]
|| !$_SERVER[$ilias->getSetting('shib_email')]
)
{
$message = "ILIAS needs at least the attributes '".$ilias->getSetting('shib_login')."', '".$ilias->getSetting('shib_firstname')."', '".$ilias->getSetting('shib_lastname')."' and '".$ilias->getSetting('shib_email')."' to work properly !\n<br>Please consult the <a href=\"README.SHIBBOLETH.txt\">documentation</a> on how to configure Shibboleth authentication properly.";
$ilias->raiseError($message,$ilias->error_obj->WARNING);
}
#global $ilAuth;
// Shibboleth login
#if (!empty($_SERVER[$ilias->getSetting("shib_login")]))
#{
# $ilAuth->login();
#}
// We only get here if we didn't login successfully
ilUtil::redirect("login.php");
?>