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

cbutera’s picture

Forgot to mention -

Attribute holding group members:
memberUid

kreaper’s picture

cbutera

In your LDAP Config, What option do you have in the Login Procedure ? Drupal first and then LDAP or LDAP only ?

cbutera’s picture

Drupal's own database. If it fails, will look on the LDAP directory

cbutera’s picture

When 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.

kreaper’s picture

Thx -- 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.

cbutera’s picture

Great - figured that out and groups are now working for me.

Thanks for your quick response.

kreaper’s picture

The issue is now fixed in HEAD. It was coming from ldapauth.module.

kreaper’s picture

Version: 5.x-1.x-dev » master
Status: Active » Fixed
kreaper’s picture

Assigned: Unassigned » kreaper
kreaper’s picture

@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.. :)

cbutera’s picture

Good to know - maybe you can write that as a comment in the ldapgroups.conf.php file?

I'll download HEAD and test it now.

cbutera’s picture

Status: Fixed » Active

Sorry to say but I got the same error with the new version of HEAD.

Works fine set to LDAP-only.

cbutera’s picture

Actually 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

scafmac’s picture

Kreaper,

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.

kreaper’s picture

I 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 :)

cbutera’s picture

I 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.

kreaper’s picture

Can 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 :(

kreaper’s picture

oops I meant the php.ini file.

cbutera’s picture

Sorry - 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?

kreaper’s picture

I 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

cbutera’s picture

Just 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

kreaper’s picture

Thx 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.

kreaper’s picture

Status: Active » Fixed
kreaper’s picture

Can I close this ticket ?

cbutera’s picture

Status: Fixed » Closed (fixed)

I believe so.

cbutera’s picture

Also you might want to remove the msg line that produces:
LDAP resource in ldapgroups_detect_groups: LDAP_SERVER_NAME

when a user logs in.