|
| getGroups ($attributes) |
| This section of code was broken out because the child filter AuthorizeByGroup can use this method as well. More...
|
|
| getGroupsOpenLdap ($attributes) |
| OpenLDAP optimized search using the required attribute values from the user to get their group membership, recursively. More...
|
|
| getGroupsActiveDirectory ($attributes) |
| Active Directory optimized search using the required attribute values from the user to get their group membership, recursively. More...
|
|
| search ($memberof) |
| Looks for groups from the list of DN's passed. More...
|
|
| searchActiveDirectory ($dn) |
| Searches LDAP using a ActiveDirectory specific filter, looking for group membership for the users DN. More...
|
|
| getLdap () |
| Getter for the LDAP connection object. More...
|
|
| var_export ($value) |
| Local utility function to get details about a variable, basically converting it to a string to be used in a log message. More...
|
|
Definition at line 11 of file AttributeAddUsersGroups.php.
◆ getGroups()
sspmod_ldap_Auth_Process_AttributeAddUsersGroups::getGroups |
( |
|
$attributes | ) |
|
|
protected |
This section of code was broken out because the child filter AuthorizeByGroup can use this method as well.
Based on the LDAP product, it will do an optimized search using the required attribute values from the user to get their group membership, recursively.
- Exceptions
-
- Parameters
-
- Returns
- array
Definition at line 76 of file AttributeAddUsersGroups.php.
References sspmod_ldap_Auth_Process_BaseFilter\$attribute_map, $attributes, $map, SimpleSAML\Logger\debug(), getGroupsActiveDirectory(), getGroupsOpenLdap(), search(), and sspmod_ldap_Auth_Process_BaseFilter\var_export().
Referenced by process().
80 $this->title .
'Checking for groups based on the best method for the LDAP product.' 85 switch ($this->product) {
86 case 'ACTIVEDIRECTORY':
98 $this->title .
'Searching LDAP using the default search method.' 104 $this->title .
'The memberof attribute [' . $map[
'memberof'] .
105 '] is not defined in the user\'s Attributes: ' . implode(
', ', array_keys(
$attributes)));
111 $this->title .
'The memberof attribute [' . $map[
'memberof'] .
122 $this->title .
'User found to be a member of the groups:' . implode(
'; ', $groups)
getGroupsActiveDirectory($attributes)
Active Directory optimized search using the required attribute values from the user to get their grou...
var_export($value)
Local utility function to get details about a variable, basically converting it to a string to be use...
getGroupsOpenLdap($attributes)
OpenLDAP optimized search using the required attribute values from the user to get their group member...
if(array_key_exists('yes', $_REQUEST)) $attributes
search($memberof)
Looks for groups from the list of DN's passed.
◆ getGroupsActiveDirectory()
sspmod_ldap_Auth_Process_AttributeAddUsersGroups::getGroupsActiveDirectory |
( |
|
$attributes | ) |
|
|
protected |
Active Directory optimized search using the required attribute values from the user to get their group membership, recursively.
- Exceptions
-
- Parameters
-
- Returns
- array
Definition at line 179 of file AttributeAddUsersGroups.php.
References sspmod_ldap_Auth_Process_BaseFilter\$attribute_map, $attributes, $map, SimpleSAML\Logger\debug(), searchActiveDirectory(), and sspmod_ldap_Auth_Process_BaseFilter\var_export().
Referenced by getGroups().
183 $this->title .
'Searching LDAP using ActiveDirectory specific method.' 192 $this->title .
'The DN attribute [' . $map[
'dn'] .
193 '] is not defined in the user\'s Attributes: ' . implode(
', ', array_keys(
$attributes)));
199 $this->title .
'The DN attribute [' . $map[
'dn'] .
searchActiveDirectory($dn)
Searches LDAP using a ActiveDirectory specific filter, looking for group membership for the users DN...
var_export($value)
Local utility function to get details about a variable, basically converting it to a string to be use...
if(array_key_exists('yes', $_REQUEST)) $attributes
◆ getGroupsOpenLdap()
sspmod_ldap_Auth_Process_AttributeAddUsersGroups::getGroupsOpenLdap |
( |
|
$attributes | ) |
|
|
protected |
OpenLDAP optimized search using the required attribute values from the user to get their group membership, recursively.
- Exceptions
-
- Parameters
-
- Returns
- array
Definition at line 137 of file AttributeAddUsersGroups.php.
References sspmod_ldap_Auth_Process_BaseFilter\$attribute_map, $attributes, $map, SimpleSAML\Logger\debug(), and sspmod_ldap_Auth_Process_BaseFilter\getLdap().
Referenced by getGroups().
141 $this->title .
'Searching LDAP using OpenLDAP specific method.' 148 $openldap_base = $this->config->getString(
'ldap.basedn',
'ou=groups,dc=example,dc=com');
150 $this->title .
"Searching for groups in ldap.basedn ".$openldap_base.
" with filter (".
$map[
'memberof'].
"=".
$attributes[
$map[
'username']][0].
") and attributes ".
$map[
'member']
156 $all_groups = $this->
getLdap()->searchformultiple($openldap_base, array(
$map[
'memberof'] =>
$attributes[
$map[
'username']][0]) , array($map[
'member']));
162 foreach ($all_groups as $group_entry) {
163 $groups[] .= $group_entry[$map[
'member']][0];
if(array_key_exists('yes', $_REQUEST)) $attributes
getLdap()
Getter for the LDAP connection object.
◆ process()
sspmod_ldap_Auth_Process_AttributeAddUsersGroups::process |
( |
& |
$request | ) |
|
This is run when the filter is processed by SimpleSAML.
It will attempt to find the current users groups using the best method possible for the LDAP product. The groups are then added to the request attributes.
- Exceptions
-
- Parameters
-
Definition at line 22 of file AttributeAddUsersGroups.php.
References sspmod_ldap_Auth_Process_BaseFilter\$attribute_map, $attributes, $map, $request, SimpleSAML\Logger\debug(), getGroups(), and sspmod_ldap_Auth_Process_BaseFilter\var_export().
25 assert(array_key_exists(
'Attributes',
$request));
29 $this->title .
'Attempting to get the users groups...' 47 $this->title .
'The group attribute [' . $map[
'groups'] .
54 $group_attribute = array_merge($group_attribute, $groups);
55 $group_attribute = array_unique($group_attribute);
59 $this->title .
'Added users groups to the group attribute [' .
60 $map[
'groups'] .
']: ' . implode(
'; ', $groups)
getGroups($attributes)
This section of code was broken out because the child filter AuthorizeByGroup can use this method as ...
foreach($paths as $path) $request
var_export($value)
Local utility function to get details about a variable, basically converting it to a string to be use...
if(array_key_exists('yes', $_REQUEST)) $attributes
◆ search()
sspmod_ldap_Auth_Process_AttributeAddUsersGroups::search |
( |
|
$memberof | ) |
|
|
protected |
Looks for groups from the list of DN's passed.
Also recursively searches groups for further membership. Avoids loops by only searching a DN once. Returns the list of groups found.
- Parameters
-
- Returns
- array
Definition at line 217 of file AttributeAddUsersGroups.php.
References sspmod_ldap_Auth_Process_BaseFilter\$attribute_map, $attributes, $map, SimpleSAML\Logger\debug(), and sspmod_ldap_Auth_Process_BaseFilter\getLdap().
Referenced by getGroups().
219 assert(is_array($memberof));
222 static $searched = array();
232 $this->title .
'Checking DNs for groups.' .
233 ' DNs: '. implode(
'; ', $memberof) .
234 ' Attributes: ' .
$map[
'memberof'] .
', ' .
$map[
'type'] .
235 ' Group Type: ' . $this->type_map[
'group']
239 $use_group_name = FALSE;
240 $get_attributes = array(
$map[
'memberof'],
$map[
'type']);
241 if (isset(
$map[
'name']) &&
$map[
'name']) {
242 $get_attributes[] =
$map[
'name'];
243 $use_group_name = TRUE;
247 foreach ($memberof as $dn) {
250 if (isset($searched[$dn])) {
256 $searched[$dn] = $dn;
266 if (!in_array($this->type_map[
'group'],
$attributes[
$map[
'type']],
true)) {
284 return array_unique($groups);
if(array_key_exists('yes', $_REQUEST)) $attributes
getLdap()
Getter for the LDAP connection object.
search($memberof)
Looks for groups from the list of DN's passed.
◆ searchActiveDirectory()
sspmod_ldap_Auth_Process_AttributeAddUsersGroups::searchActiveDirectory |
( |
|
$dn | ) |
|
|
protected |
Searches LDAP using a ActiveDirectory specific filter, looking for group membership for the users DN.
Returns the list of group DNs retrieved.
- Parameters
-
- Returns
- array
Definition at line 296 of file AttributeAddUsersGroups.php.
References sspmod_ldap_Auth_Process_BaseFilter\$attribute_map, $map, SimpleSAML\Logger\debug(), sspmod_ldap_Auth_Process_BaseFilter\getLdap(), SimpleSAML\Logger\notice(), and sspmod_ldap_Auth_Process_BaseFilter\var_export().
Referenced by getGroupsActiveDirectory().
298 assert(is_string($dn) && $dn !=
'');
305 $this->title .
'Searching ActiveDirectory group membership.' .
307 ' DN Attribute: ' .
$map[
'dn'] .
308 ' Member Attribute: ' .
$map[
'member'] .
309 ' Type Attribute: ' .
$map[
'type'] .
310 ' Type Value: ' . $this->type_map[
'group'] .
311 ' Base: ' . implode(
'; ', $this->base_dn)
315 $this->
getLdap()->setOption(LDAP_OPT_REFERRALS, 0);
319 $entries = $this->
getLdap()->searchformultiple(
321 array(
$map[
'type'] => $this->type_map[
'group'],
$map[
'member'] .
':1.2.840.113556.1.4.1941:' => $dn),
335 foreach ($entries as $entry) {
337 if (isset($entry[
$map[
'dn']][0])) {
338 $groups[] = $entry[$map[
'dn']][0];
343 if (isset($entry[strtolower($map[
'dn'])][0])) {
344 $groups[] = $entry[strtolower($map[
'dn'])][0];
349 if (isset($entry[
'dn'])) {
350 $groups[] = $entry[
'dn'];
356 $this->title .
'The DN attribute [' .
357 implode(
', ', array($map[
'dn'], strtolower($map[
'dn']),
'dn')) .
358 '] could not be found in the entry. ' . $this->
var_export($entry)
var_export($value)
Local utility function to get details about a variable, basically converting it to a string to be use...
getLdap()
Getter for the LDAP connection object.
The documentation for this class was generated from the following file: