[phpldapadmin] contributions and questions related to authentication and hooks

Dieter Plaetinck <[email protected]> Fri, 4 Jun 2010 16:05:06 +0200
Newsgroups gmane.comp.ldap.davedap
Organization Kangaroot
Message-ID <[email protected]>
Hi devs,

Let me start off with my contribution:
I added login and logout hooks, and an example for them in
hooks/functions/example.php

http://github.com/kangaroot/phpldapadmin/commit/b035e148ba44f335daee62a07e520c20a0628894

I am unfamiliar with the phpldapadmin code but I tested it and it works
for me. And afaict they adhere to the used syntax style.


Now, what I'm up to is this:
I want to modify the login functionality to provide client certificate logins
(using apache mod_ssl).  the login logic in php itself is actually quite easy and i have succeeded at doing this, but I don't know how to integrate it into
phpldapadmin. (the certificates provide a unique id which i can retrieve from ldap)
The current password login can be left available, but should only be
reachable by going to another url, I want the certificate login should be the
default. Authentication code is typically something which is all over the place, so any tips/pointers are greatly appreciated.


Something else I want to do: whenever *any* data is modified through PLA,
I want to log it.
As far as I can see, all those cases are catched if i handle the following hooks:
post_entry_create
post_entry_delete
post_entry_rename
post_entry_modify
post_attr_add
post_attr_modify
post_attr_delete

Right?



And lastly, something I noticed:
post_session_init is ran twice on logout and twice on login.
When I execute a function upon the hook and write the following to a file:
print_r(args,true));
print_r(get_defined_constants(),true));
print_r(get_defined_vars(),true));
then i notice that the "environment" (ie the things I logged) are identical.
So I got curious why this is executed twice. maybe lib/common.php gets sourced twice or something.

Oh and btw, the source code looks documented quite well.
thanks for that.

Dieter

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
______________________________________
phpLDAPadmin development mailing list.
To unsbuscribe: https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel
http://phpldapadmin.sourceforge.net/