ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
Auth.php
Go to the documentation of this file.
1
<?php
2
namespace
SimpleSAML\Utils
;
3
4
use
SimpleSAML\Module
;
5
11
class
Auth
12
{
13
22
public
static
function
getAdminLoginURL
(
$returnTo
= null)
23
{
24
if
(!(is_string(
$returnTo
) || is_null(
$returnTo
))) {
25
throw
new \InvalidArgumentException(
'Invalid input parameters.'
);
26
}
27
28
if
(
$returnTo
=== null) {
29
$returnTo
= HTTP::getSelfURL();
30
}
31
32
return
Module::getModuleURL
(
'core/login-admin.php'
,
array
(
'ReturnTo'
=>
$returnTo
));
33
}
34
42
public
static
function
isAdmin
()
43
{
44
$session
=
\SimpleSAML_Session::getSessionFromRequest
();
45
return
$session
->isValid(
'admin'
) ||
$session
->isValid(
'login-admin'
);
46
}
47
60
public
static
function
requireAdmin
()
61
{
62
if
(self::isAdmin()) {
63
return
;
64
}
65
66
// not authenticated as admin user, start authentication
67
if
(\
SimpleSAML_Auth_Source::getById
(
'admin'
) !== null) {
68
$as
= new \SimpleSAML\Auth\Simple(
'admin'
);
69
$as
->login();
70
}
else
{
71
throw
new \SimpleSAML_Error_Exception(
72
'Cannot find "admin" auth source, and admin privileges are required.'
73
);
74
}
75
}
76
}
$returnTo
if(!isset($_REQUEST['ReturnTo'])) $returnTo
Definition:
authpage.php:16
SimpleSAML\Utils\Auth\requireAdmin
static requireAdmin()
Require admin access to the current page.
Definition:
Auth.php:60
SimpleSAML\Utils\Auth\isAdmin
static isAdmin()
Check whether the current user is admin.
Definition:
Auth.php:42
SimpleSAML\Module
SimpleSAML\Utils\Auth\getAdminLoginURL
static getAdminLoginURL($returnTo=null)
Retrieve a admin login URL.
Definition:
Auth.php:22
$session
$session
Definition:
proxy_ylocal.php:32
SimpleSAML\Utils
Definition:
Arrays.php:2
SimpleSAML\Utils\Auth
Definition:
Auth.php:11
SimpleSAML\Module\getModuleURL
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
Definition:
Module.php:303
$as
$as
Definition:
consentAdmin.php:73
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
SimpleSAML_Auth_Source\getById
static getById($authId, $type=null)
Retrieve authentication source.
Definition:
Source.php:324
SimpleSAML_Session\getSessionFromRequest
static getSessionFromRequest()
Retrieves the current session.
Definition:
Session.php:243
libs
composer
vendor
simplesamlphp
simplesamlphp
lib
SimpleSAML
Utils
Auth.php
Generated on Sat Mar 1 2025 19:01:10 for ILIAS by
1.8.13 (using
Doxyfile
)