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)
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)
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];
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'] .
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);
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)
getGroups($attributes)
This section of code was broken out because the child filter AuthorizeByGroup can use this method as ...
foreach($paths as $path) $request
getGroupsActiveDirectory($attributes)
Active Directory optimized search using the required attribute values from the user to get their grou...
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...
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
process(&$request)
This is run when the filter is processed by SimpleSAML.
getLdap()
Getter for the LDAP connection object.
search($memberof)
Looks for groups from the list of DN's passed.