ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
selectsource.php
Go to the documentation of this file.
1<?php
2
13// Retrieve the authentication state
14if (!array_key_exists('AuthState', $_REQUEST)) {
15 throw new SimpleSAML_Error_BadRequest('Missing AuthState parameter.');
16}
17$authStateId = $_REQUEST['AuthState'];
19
20if (array_key_exists("SimpleSAML_Auth_Source.id", $state)) {
21 $authId = $state["SimpleSAML_Auth_Source.id"];
23} else {
24 $as = NULL;
25}
26
27$source = NULL;
28if (array_key_exists('source', $_REQUEST)) {
29 $source = $_REQUEST['source'];
30} else {
31 foreach ($_REQUEST as $k => $v) {
32 $k = explode('-', $k, 2);
33 if (count($k) === 2 && $k[0] === 'src') {
34 $source = base64_decode($k[1]);
35 }
36 }
37}
38if ($source !== NULL) {
39 if ($as !== NULL) {
40 $as->setPreviousSource($source);
41 }
43}
44
45if (array_key_exists('multiauth:preselect', $state)) {
46 $source = $state['multiauth:preselect'];
48}
49
51$t = new SimpleSAML_XHTML_Template($globalConfig, 'multiauth:selectsource.php');
52$t->data['authstate'] = $authStateId;
54if ($as !== NULL) {
55 $t->data['preferred'] = $as->getPreviousSource();
56} else {
57 $t->data['preferred'] = NULL;
58}
59$t->show();
60exit();
An exception for terminatinating execution or to throw for unit testing.
static getById($authId, $type=null)
Retrieve authentication source.
Definition: Source.php:324
static loadState($id, $stage, $allowMissing=false)
Retrieve saved state.
Definition: State.php:259
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
const SOURCESID
The key where the sources is saved in the state.
Definition: MultiAuth.php:26
static delegateAuthentication($authId, $state)
Delegate authentication.
Definition: MultiAuth.php:141
const STAGEID
The string used to identify our states.
Definition: MultiAuth.php:21
$as
$globalConfig
$t
if(!array_key_exists('AuthState', $_REQUEST)) $authStateId
$source
$state