How can I override some, but not all of the functions provided by user.module?

For example, I don't want the user to be able to change their name, email address or password. I'd like to override the user_authenticate function to only allow local users, but authenticate them against LDAP (without the @server in the username). I'd like to disable user registration, but allow the system to create new users that don't exist as long as they pass LDAP authentication. There's more, but you get the idea...

What is the correct way to override some functions in a core module such as user.module, without completely replacing it?

Comments

yelvington’s picture

I have the same interest for integrating with another (non-LDAP) registration system. For the time being we have simply made the "my account" link disappear, but I want it back -- because I want to use the profile. module, buddylist, et cetera.

Anybody?

harry slaughter’s picture

I'm currently trying to integrate an existing user database into drupal. i'd like drupal to use my own database for most of the authentication and user info stuff so that drupal can play with other parts of the system that need the same info.

some of the drupal specific data in the users table will be left alone (timezone, signature, theme, picture, etc...). but the more generic stuff shared among the wider system (uid, name, pass, mail, etc...) will need to be stored in the broader system's database.

Only option I'm thinking of at the moment is to rewrite user.module to include access to my own database and modify calls where needed. But i'm not sure (in fact, i doubt) that the users table is accessed/modified only from user.module.

there are plenty of references to 'distributed authentication' within drupal.org, but no mentions of integrating an external source of user info into a drupal instance.

--
Living in fear of patch hell?
Want a stable development environment?
Support Dev Releases: http://drupal.org/node/30903
Support Code cleanup too: http://drupal.org/node/28540

--
Devbee - http://devbee.net/

sangamreddi’s picture

hi,

Check this out sharing user base
http://drupal.org/node/32179

Sunny
www.gleez.com