I have installed and configured the ldap_integration module and have it up and running successfully. That being said, I am needing to achieve something that this module may not be capable of, in which case some guidance would be helpful. Hopefully though, it is capable of doing what I need and I am just overlooking something.
I work for a school in a university. We use the university's main campus LDAP directory for authentication. Each person on campus has their own entry in the directory and as such, has specific attributes classifying what kind of individual they are (ie. student, staff, faculty, etc...). Currently, anyone that provides correct username/password combos gains access to my Drupal site. What I would like to do is limit the access to people in a specific department **AND** a classification of staff **OR** faculty. The reason I cannot use just the department as the attribute to search against is because it will let students of the school into the site. The reason I cannot use just the classification attribute is because it would allow ALL staff and/or faculty into the site. This site is just supposed to be for the eyes of the faculty and staff of our individual school, not the entire university.
So, the settings in the ldapgroups section I am using is "Group by attribute" with the following two attributes selected "ou" and "employeeType". I then have roles setup for each of the valid "ou's" (departments) and the "employeeTypes" (this also includes "students" not just "staff" or "faculty") to be able to access the content on the site. Though this blocks out the annonymous, and students of other schools, it allows students (because they are associated with the department), all faculty (because they match "faculty"), and all staff (because...well, you get the idea). I guess what I am looking for is a conditional statement. In coding terms:
if (ou == "VALID DEPARTMENT" && (employeeType == "staff" || employeeType == "faculty")) {
Let them in
} else {
Don't let them in
}
Thanks in advance for your help.
Comments
Comment #1
Jay Almers commentedAnyone?
Comment #2
rmiddle commentedjealmers,
Check out ldap_integration/ldap_integration/ldapauth.conf.php it should have what you need.
Thanks
Robert
Comment #3
Jay Almers commentedGood call Robert, that worked great. I essentially setup filters as follows:
if (in_array("3501",$attributes['departmentnumber'])) {
if (in_array("STAFF",$attributes['employeetype']) && in_array("FACULTY",$attributes['employeetype'])){
return TRUE;
}
}
Thanks for the help...this one is closed. =)
Comment #4
Jay Almers commented