The ldap login is working correctly. I then tried to enable the group mapping through the LDAPGroups module. I configured it as follows:
Groups exist as LDAP entries where a multivalued attribute contains the members' CNs
cn=groups,dc=mydomain,dc=org
When my user logs in - it logs them in - but doesn't forward them to the next page. And in the httpd error log is this message:
PHP Fatal error: Call to a member function getOption() on a non-object in /home/drupal-5.0/sites/all/modules/ldap_integration/ldapgroups.module on line 290, referer: http://mydomain.org/user/login?destination=node
Here is my environment:
Drupal 5.0
Configuration file Protected
Cron maintenance tasks Last run 1 min 55 sec ago
You can run cron manually.
Database schema Up to date
File system Writable (public download method)
MySQL database 5.0.22
PHP 5.1.6
Unicode library PHP Mbstring Extension
Web server Apache/2.2.0 (Fedora)
Authenticating to a Mac OS X Open Directory Server (10.4.8)
Comments
Comment #1
cbutera commentedForgot to mention -
Attribute holding group members:
memberUid
Comment #2
kreaper commentedcbutera
In your LDAP Config, What option do you have in the Login Procedure ? Drupal first and then LDAP or LDAP only ?
Comment #3
cbutera commentedDrupal's own database. If it fails, will look on the LDAP directory
Comment #4
cbutera commentedWhen I switched to LDAP-only the error went away. However, I still don't see any of the groups coming in. Do I need to edit the LDAPGroups file at all? That used to be only for custom mappings.
Comment #5
kreaper commentedThx -- Looks like the issue I described in http://drupal.org/node/104544 is coming to haunt me again. I will focus on getting that squared away.
Also, you are correct (see - http://drupal.org/node/79918). You are required to specify what LDAP groups you want to turn them into roles. This is cause most large environments with LDAP/AD have quite a few groups and all of them are not necessarily meant for drupal :)
let me know how that goes.
Comment #6
cbutera commentedGreat - figured that out and groups are now working for me.
Thanks for your quick response.
Comment #7
kreaper commentedThe issue is now fixed in HEAD. It was coming from ldapauth.module.
Comment #8
kreaper commentedComment #9
kreaper commentedComment #10
kreaper commented@cbutera
W/regards to #4 - I want to clarify that if you do want to have ALL of your LDAP Groups turned into DRUPAL roles, all you have to do is comment out the ldapgroups_roles_filter in the ldapgroups.conf.php.
Just making sure.. :)
Comment #11
cbutera commentedGood to know - maybe you can write that as a comment in the ldapgroups.conf.php file?
I'll download HEAD and test it now.
Comment #12
cbutera commentedSorry to say but I got the same error with the new version of HEAD.
Works fine set to LDAP-only.
Comment #13
cbutera commentedActually the error is on line 291 now:
PHP Fatal error: Call to a member function getOption() on a non-object in /home/drupal-5.0/sites/all/modules/ldap_integration/ldapgroups.module on line 291, referer: http://mydomain.org/user/login?destination=node
Comment #14
scafmac commentedKreaper,
I noticed this the other day when I was trying to setup ldapgroups on Drupal 5. I had the error on line 290, but you must have added a line to head since I downloaded it. The problem seems to be the call to the global $ldap object. At least in my setup, it is an empty object at line 290. I didn't get a chance to debug it further though - just wanted to share the little I knew about it.
Comment #15
kreaper commentedI will take a look at it -- I got the same error in my test install last night and my new commit code did not produce that error. When the option "check with drupal first" is checked, the $ldap object is not initialized at all. In that case, there should be NO ldap groups to map. It could be as simple as checking for that NULL entry and returning back.
I will be able to look at it tonight - after my day job is over :)
Comment #16
cbutera commentedI just downloaded the latest HEAD (1/31) and the error is still there:
PHP Fatal error: Call to a member function getOption() on a non-object in /home/drupal-5.1/sites/all/modules/ldap_integration/ldapgroups.module on line 288, referer: http://mydomain.org/user/login?destination=node
(Which refers to your msg) - so I commented that line out and got:
PHP Fatal error: Call to a member function getOption() on a non-object in /home/drupal-5.1/sites/all/modules/ldap_integration/ldapgroups.module on line 292, referer: http://mydomain.org/user/login?destination=node
To be clear - I have it set to check Drupal first - but I am testing with an LDAP user (not a local user).
Let me know if I can provide additional information.
Comment #17
kreaper commentedCan you check your php.init file and see if register globals is set to On ?
I have HEAD and I can't seem to replicate it :(
Comment #18
kreaper commentedoops I meant the php.ini file.
Comment #19
cbutera commentedSorry - no register globals in not on. Did you see I clarified I am testing with an LDAP user (not a local user). So in that case it should still go into the groups module right?
Comment #20
kreaper commentedI have register globals turned on. Can you try with that ? When testing with local user, it LDAP group detection should never take place. The problem seem to arise when testing with LDAP user. Somehow i have a feeling that php.ini is not allowing the global variables to be set -- the way I am setting it.
rajeev
Comment #21
cbutera commentedJust tried that
Edited /etc/php.ini
register_globals = On
Restarted Apache
PHP Fatal error: Call to a member function getOption() on a non-object in /home/drupal-5.1/sites/all/modules/ldap_integration/ldapgroups.module on line 292, referer: http://mydomain.org/user/login?destination=node
Comment #22
kreaper commentedThx to cbutera and scafmac's efforts, the bug has been found and the fix is in HEAD
The bug was related to a situation where there was local account AND an LDAP account with the same name.
Comment #23
kreaper commentedComment #24
kreaper commentedCan I close this ticket ?
Comment #25
cbutera commentedI believe so.
Comment #26
cbutera commentedAlso you might want to remove the msg line that produces:
LDAP resource in ldapgroups_detect_groups: LDAP_SERVER_NAME
when a user logs in.