[support] user module and custom ldap module advice

Peter Davis peterd at neustarlab.biz
Tue Nov 18 15:19:39 UTC 2008


Hi,

I am trying to identify the best solution (or perhaps, the most proper  
solution) for incorporating the core user module and a custom ldap  
module.  The ldap module holds all users for the system (of which  
drupal is only a part), and provides, via drupal, both search and view  
functionality.  It's important to note that not all ldap users will be  
in the drupal user tables (tho when a user logs into drupal, an  
account is automatically created locally).

The challenge i am facing is id rather not have 2 user view pages in  
place... just one.  By way of example:

/user/jsmith
/person/jsmith

both result in displaying jsmith's account (and should be identical  
renderings)

all users will always be found under /person (which starts the user  
load process from ldap), but i've not found a way to trick the user  
module into finding accounts which are not in drupal (only in ldap),  
as hook_user->load is called after an attempt has been made to locate  
the user in the drupal user store.

to add to the complexity, for various reasons, when extending the user  
profile from LDAP, I am storing these values via the profile module.

I've considered a few scenarios:

+ link_alter /user/% to /person/%, where i know i'll find the user but  
retain access to profile extensions
+ menu_alter /user/% to /person (which seems not to work)
+ find some way of getting the user module to look in ldap first

I considered bulk-loading from LDAP, but that introduces data  
duplication I'd like to avoid if at all possible.

thanks!
=peterd



More information about the support mailing list