[support] Sharing 'users' table with another database?

Cog Rusty cog.rusty at gmail.com
Sun Mar 8 16:05:40 UTC 2009


On Sun, Mar 8, 2009 at 5:44 AM, Thoughts Ltd <domains at thoughts.pro> wrote:
> Has anyone here know how to get Drupal to share the 'users' table with another database?
>
> (Or, in other words, connect to a different database to access the 'users' table.)
>
> I have a "people" database that I share between all my different projects, so that all of my clients/users need not sign up multiple times.  Signing up to anything gets them signed up to everything.  Change their name/email/password once, it's changed everywhere.
>
> I've been able to do this because I was hand-coding all of my projects, but now I'd like to use Drupal, yet still access this central "users" table (I can make it exactly fit Drupal's specs/schema).
>
> Perhaps there's a different way to achieve what I'm trying to do?
>
> Any suggestions or pointers?


Some resources that you may find useful:

For Drupal 6, check these API functions:
http://api.drupal.org/api/function/user_external_load
http://api.drupal.org/api/function/user_external_login/6 (Drupal 6 only)
http://api.drupal.org/api/function/user_external_login_register/6
(Drupal 6 only)
and generally the user API
http://api.drupal.org/api/file/modules/user/user.module/6

See how the first two are used in the code of
http://api.drupal.org/api/function/openid_authentication/6 (Drupal 6 only)

For Drupal 5, you can find a few relevant discussions around such as
http://drupal.org/node/151515
http://www.darrenmothersele.com/content/using-external-data-source-drupal-user-authentication-and-login
Maybe also the code of openid_authentication() in
http://drupal.org/project/openid

If your solution involves a Drupal bootstrap in an external php
script, make sure to set the $cookie_domain in Drupal's settings.php
file.


> Thanks much.
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>


More information about the support mailing list