Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
123f1e3e
Commit
123f1e3e
authored
8 years ago
by
Vincent Rioux
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update Consent.php
parent
6e46f7cc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/consent/lib/Auth/Process/Consent.php
+13
-7
13 additions, 7 deletions
modules/consent/lib/Auth/Process/Consent.php
with
13 additions
and
7 deletions
modules/consent/lib/Auth/Process/Consent.php
+
13
−
7
View file @
123f1e3e
...
@@ -151,20 +151,26 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
...
@@ -151,20 +151,26 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
private
static
function
checkDisable
(
$option
,
$entityId
)
{
private
static
function
checkDisable
(
$option
,
$entityId
)
{
if
(
is_array
(
$option
))
{
if
(
is_array
(
$option
))
{
// Check if consent.disable array has one element that is an array
// Check if consent.disable array has one element that is an array
if
(
count
(
$option
)
==
count
(
$option
,
COUNT_RECURSIVE
))
{
if
(
count
(
$option
)
==
=
count
(
$option
,
COUNT_RECURSIVE
))
{
// Array is not multidimensional. Simple in_array search suffices
// Array is not multidimensional. Simple in_array search suffices
return
in_array
(
$entityId
,
$option
,
TRUE
);
return
in_array
(
$entityId
,
$option
,
true
);
}
else
{
}
else
{
// Array contains at least one element that is an array, verify both possibilities
// Array contains at least one element that is an array, verify both possibilities
if
(
in_array
(
$entityId
,
$option
,
TRUE
))
{
if
(
in_array
(
$entityId
,
$option
,
true
))
{
return
true
;
return
true
;
}
else
{
}
else
{
// Search in multidimensional arrays
// Search in multidimensional arrays
foreach
(
$optionToTest
in
$option
)
{
foreach
(
$optionToTest
in
$option
)
{
if
(
is_array
(
$optionToTest
))
{
if
(
is_array
(
$optionToTest
))
{
if
(
$optionToTest
[
'type'
]
==
'regex'
)
{
if
(
array_key_exists
(
'type'
,
$optionToTest
)
{
// Evaluate regular expression and return true if entityId matches
if
(
$optionToTest
[
'type'
]
===
'regex'
)
{
if
(
preg_match
(
$optionToTest
[
'pattern'
],
$entityId
)
===
1
)
return
true
;
if
(
array_key_exists
(
'pattern'
,
$optionToTest
)
{
// Evaluate regular expression and return true if entityId matches
if
(
preg_match
(
$optionToTest
[
'pattern'
],
$entityId
)
===
1
)
{
return
true
;
}
}
}
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment