[fixed] LDAP Auth support broken

All about webserver configurations, PHP and databases.

Moderator: Thorsten

Post Reply
derLars
Posts: 13
Joined: Tue Aug 04, 2009 3:25 pm

[fixed] LDAP Auth support broken

Post by derLars » Tue Aug 04, 2009 6:45 pm

Hi everyone!

First things first - great software, I'm totally in love with it, especially the very nice OO.

I've started implementing PMF in my university to replace the current helpdesk-system. Starting with PMF 2.5, one of the features should be ldap-authentication. However, I can't get it running and just get a blank-screen when activating it.

During installation, all ldap-data was correctly set and logging in with the local PMF-admin works and not existing users are rejected. However, as soon as someone tries to login via LDAP-Auth (existing or not), I only the blank screen without any error messages.

I started digging through the code and it seems that the default encryption method was not accepted due to a missing "inc/PMF_Enc/Enc.php"-file. I've added a dummy file, but still no luck.

Before I dig into the code any further, I'd like to ask what exactly has been implemented yet.
* is it possible to assign users to groups according to LDAP-paths?
* if not, are PMF-users automatically created on the first successful auth, so that they may be added to a PMF-group (similar to stud.IP, e.g.)?

Regards,
Lars
Last edited by derLars on Wed Aug 05, 2009 2:55 pm, edited 1 time in total.

Thorsten
Posts: 14728
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP Auth support broken

Post by Thorsten » Tue Aug 04, 2009 9:00 pm

Hi,

could you please enable the DEBUG mode in inc/Init.php and try it again?
derLars wrote:I started digging through the code and it seems that the default encryption method was not accepted due to a missing "inc/PMF_Enc/Enc.php"-file. I've added a dummy file, but still no luck.
I'll check this issue.
derLars wrote:* is it possible to assign users to groups according to LDAP-paths?
no.
derLars wrote:* if not, are PMF-users automatically created on the first successful auth, so that they may be added to a PMF-group (similar to stud.IP, e.g.)?
yes, after a successful login, the user will get some local informations.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

derLars
Posts: 13
Joined: Tue Aug 04, 2009 3:25 pm

Re: LDAP Auth support broken

Post by derLars » Wed Aug 05, 2009 12:22 am

Thorsten wrote:could you please enable the DEBUG mode in inc/Init.php and try it again?
Already tried that, no luck either. I'll trace some more tomorrow and give an update, where the problem is, but I suspect the problem to be with the (at the first login) non-existing user in the database.

Thanks for the answer, see you tomorrow!

Thorsten
Posts: 14728
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP Auth support broken

Post by Thorsten » Wed Aug 05, 2009 4:42 am

Hi,

okay! Thank you very much for your help!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

derLars
Posts: 13
Joined: Tue Aug 04, 2009 3:25 pm

Re: LDAP Auth support broken

Post by derLars » Wed Aug 05, 2009 8:33 am

Okay, I've traced the problem through and I'm really puzzled, how the ldap-password-auth worked at all - could you shed some light on this:

Code: Select all

// this calls PMF_User_CurrentUser::login(...)
// index.php, line 96
if ($user->login($faqusername, $faqpassword)) { ... }

// in inc/PMF_User/CurrentUser.php, lines 122 and following, all registered authentication
// methods are called. Line 131 calls PMF_Auth_AuthLdap::checkLogin(...)
if (!$auth->checkLogin($login)) {...}

// in inc/PMF_Auth/AuthLdap.php::checkLogin(), line 137, the Authmodule tries to determine, if the user exists
$r = $this->ldap->getCompleteName($login);
However, $this->ldap is NULL, and this is where the system just breaks up.

Now, I didn't find where PMF_Auth_AuthLdap::$ldap is supposed to be set, but I didn't find it.
Any ideas?

Regars,
Lars

derLars
Posts: 13
Joined: Tue Aug 04, 2009 3:25 pm

Re: LDAP Auth support broken

Post by derLars » Wed Aug 05, 2009 2:07 pm

I've managed to get it all working, added some extra functionality and put together a patch-file along with some description in the "bug report"-forum, but my post seems to be in the moderation line...

-----
I reposted it. ;)

Thorsten
Posts: 14728
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: LDAP Auth support broken

Post by Thorsten » Wed Aug 05, 2009 2:30 pm

Hi,

thanks... the AuthLDAP code was an external code contribution...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

Post Reply