Definition at line 14 of file CardinalitySingle.php.
◆ __construct()
sspmod_core_Auth_Process_CardinalitySingle::__construct |
( |
|
$config, |
|
|
|
$reserved, |
|
|
HTTPAdapter |
$http = null |
|
) |
| |
Initialize this filter, parse configuration.
- Parameters
-
array | $config | Configuration information about this filter. |
mixed | $reserved | For future use. |
HTTPAdapter | $http | HTTP utility service (handles redirects). |
Definition at line 41 of file CardinalitySingle.php.
References $config, $http, and ILIAS\FileDelivery\http().
43 parent::__construct(
$config, $reserved);
48 if (array_key_exists(
'singleValued',
$config)) {
49 $this->singleValued =
$config[
'singleValued'];
51 if (array_key_exists(
'firstValue',
$config)) {
52 $this->firstValue =
$config[
'firstValue'];
54 if (array_key_exists(
'flattenWith',
$config)) {
55 $this->flattenWith = is_array(
$config[
'flattenWith']) ? array_shift(
$config[
'flattenWith']) :
$config[
'flattenWith'];
57 if (array_key_exists(
'flatten',
$config)) {
58 $this->flatten =
$config[
'flatten'];
60 if (array_key_exists(
'ignoreEntities',
$config)) {
61 $this->ignoreEntities =
$config[
'ignoreEntities'];
64 if (array_key_exists(
'%ignoreEntities',
$config)) {
65 $this->ignoreEntities =
$config[
'%ignoreEntities'];
static http()
Fetches the global http state from ILIAS.
◆ process()
sspmod_core_Auth_Process_CardinalitySingle::process |
( |
& |
$request | ) |
|
Process this filter.
- Parameters
-
array | &$request | The current request |
Definition at line 74 of file CardinalitySingle.php.
References $id, $request, $url, SimpleSAML\Logger\debug(), SimpleSAML\Module\getModuleURL(), ILIAS\FileDelivery\http(), and SimpleSAML_Auth_State\saveState().
77 assert(array_key_exists(
"Attributes",
$request));
79 if (array_key_exists(
'Source',
$request) &&
80 array_key_exists(
'entityid',
$request[
'Source']) &&
81 in_array(
$request[
'Source'][
'entityid'], $this->ignoreEntities,
true)
87 foreach (
$request[
'Attributes'] as $k => $v) {
95 if (in_array($k, $this->singleValued)) {
96 $request[
'core:cardinality:errorAttributes'][$k] = array(count($v),
'0 ≤ n ≤ 1');
99 if (in_array($k, $this->firstValue)) {
100 $request[
'Attributes'][$k] = array(array_shift($v));
103 if (in_array($k, $this->flatten)) {
104 $request[
'Attributes'][$k] = array(implode($this->flattenWith, $v));
110 if (array_key_exists(
'core:cardinality:errorAttributes',
$request)) {
113 $this->
http->redirectTrustedURL(
$url, array(
'StateId' =>
$id));
foreach($paths as $path) $request
if(!array_key_exists('StateId', $_REQUEST)) $id
static getModuleURL($resource, array $parameters=array())
Get absolute URL to a specified module resource.
static http()
Fetches the global http state from ILIAS.
static saveState(&$state, $stage, $rawId=false)
Save the state.
◆ $firstValue
sspmod_core_Auth_Process_CardinalitySingle::$firstValue = array() |
|
private |
◆ $flatten
sspmod_core_Auth_Process_CardinalitySingle::$flatten = array() |
|
private |
◆ $flattenWith
sspmod_core_Auth_Process_CardinalitySingle::$flattenWith = ';' |
|
private |
◆ $http
sspmod_core_Auth_Process_CardinalitySingle::$http |
|
private |
◆ $ignoreEntities
sspmod_core_Auth_Process_CardinalitySingle::$ignoreEntities = array() |
|
private |
◆ $singleValued
sspmod_core_Auth_Process_CardinalitySingle::$singleValued = array() |
|
private |
The documentation for this class was generated from the following file: