Closed (fixed)
Project:
LDAP integration
Version:
6.x-1.0-beta2
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2011 at 20:35 UTC
Updated:
6 Apr 2012 at 19:22 UTC
Hi,
I'd like to limit the logon to only specific LDAP-accounts (based on their e-mail addresses).
Is this possible?
What do I have to put in the 'php filter'-field to only allow LDAP-access to user1@domain.com & user2@domain.com
(something like return $ldap['mail']==user1@domain.com? don't have a clue)
Regards.
Comments
Comment #1
cgmonroe commentedClearing out old support requests - reopen if problem still exists in newest code (dev)
That said:
The "PhP to filter users based on their ldap data" code works as follows:
Best practice for complicated tests would be to create a custom module with a mymodule_ldap_filter( $ldap ) function. This function would perform the checks you need to determine if an ldap user can log in.
Then the filter code would be entered as: return mymodule_ldap_filter( $ldap );
One other thing to note is that the ldapgroups module might be an easier method of doing this. It has an option to deny access to any ldap user who is not a member of a specific group.