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
0
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
008d2de8
Unverified
Commit
008d2de8
authored
7 years ago
by
Tim van Dijen
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Code quality
parent
2c0733cf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/ldap/lib/Auth/Process/AttributeAddUsersGroups.php
+8
-11
8 additions, 11 deletions
modules/ldap/lib/Auth/Process/AttributeAddUsersGroups.php
with
8 additions
and
11 deletions
modules/ldap/lib/Auth/Process/AttributeAddUsersGroups.php
+
8
−
11
View file @
008d2de8
...
@@ -86,7 +86,6 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
...
@@ -86,7 +86,6 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
// Based on the directory service, search LDAP for groups
// Based on the directory service, search LDAP for groups
// If any attributes are needed, prepare them before calling search method
// If any attributes are needed, prepare them before calling search method
switch
(
$this
->
product
)
{
switch
(
$this
->
product
)
{
case
'ACTIVEDIRECTORY'
:
case
'ACTIVEDIRECTORY'
:
// Log the AD specific search
// Log the AD specific search
...
@@ -96,10 +95,7 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
...
@@ -96,10 +95,7 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
// Make sure the defined dn attribute exists
// Make sure the defined dn attribute exists
if
(
!
isset
(
$attributes
[
$map
[
'dn'
]]))
{
if
(
!
isset
(
$attributes
[
$map
[
'dn'
]]))
{
throw
new
SimpleSAML_Error_Exception
(
$this
->
throwAttributeNotDefined
(
'DN'
,
$map
[
'dn'
],
implode
(
', '
,
array_keys
(
$attributes
)));
$this
->
title
.
'The DN attribute ['
.
$map
[
'dn'
]
.
'] is not defined in the users Attributes: '
.
implode
(
', '
,
array_keys
(
$attributes
))
);
}
}
// DN attribute must have a value
// DN attribute must have a value
...
@@ -113,7 +109,7 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
...
@@ -113,7 +109,7 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
// Pass to the AD specific search
// Pass to the AD specific search
$groups
=
$this
->
searchActiveDirectory
(
$attributes
[
$map
[
'dn'
]][
0
]);
$groups
=
$this
->
searchActiveDirectory
(
$attributes
[
$map
[
'dn'
]][
0
]);
break
;
break
;
case
'OPENLDAP'
:
case
'OPENLDAP'
:
// Log the OpenLDAP specific search
// Log the OpenLDAP specific search
SimpleSAML\Logger
::
debug
(
SimpleSAML\Logger
::
debug
(
...
@@ -138,7 +134,6 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
...
@@ -138,7 +134,6 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
break
;
break
;
default
:
default
:
// Log the general search
// Log the general search
SimpleSAML\Logger
::
debug
(
SimpleSAML\Logger
::
debug
(
$this
->
title
.
'Searching LDAP using the default search method.'
$this
->
title
.
'Searching LDAP using the default search method.'
...
@@ -146,10 +141,7 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
...
@@ -146,10 +141,7 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
// Make sure the defined memberOf attribute exists
// Make sure the defined memberOf attribute exists
if
(
!
isset
(
$attributes
[
$map
[
'memberof'
]]))
{
if
(
!
isset
(
$attributes
[
$map
[
'memberof'
]]))
{
throw
new
SimpleSAML_Error_Exception
(
$this
->
throwAttributeNotDefined
(
'memberof'
,
$map
[
'memberof'
],
implode
(
', '
,
array_keys
(
$attributes
)));
$this
->
title
.
'The memberof attribute ['
.
$map
[
'memberof'
]
.
'] is not defined in the users Attributes: '
.
implode
(
', '
,
array_keys
(
$attributes
))
);
}
}
// MemberOf must be an array of group DN's
// MemberOf must be an array of group DN's
...
@@ -171,6 +163,11 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
...
@@ -171,6 +163,11 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
return
$groups
;
return
$groups
;
}
}
protected
function
throwAttributeNotDefined
(
$attr
,
$attr_value
,
$attributes
)
{
throw
new
SimpleSAML_Error_Exception
(
$this
->
title
.
'The '
.
$attr
.
' attribute ['
.
$attr_value
.
'] is not defined in the user\'s Attributes: '
.
$attributes
);
}
/**
/**
* Looks for groups from the list of DN's passed. Also
* Looks for groups from the list of DN's passed. Also
...
...
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