Let's say I have 3 Drupal installations:
1- root
2- subdomain: /d1/
3- subdomain: /d2/

I want the root installation to handle the login/ registration/ sessions.
When the user in d2 click on my account it takes him to his account in the root installation.

What's the best way to achieve that? How to replicate the user accounts to the other installations? or there's no need to do that?

Comments

vm’s picture

All three DB's must be sharing the same DB, two with prefixes and investigate the single sign on.module or openID.module

then you must use the settings.php and work with the array that allows mutisite to share DB tables.

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

phpdude’s picture

Thanks for your quick reply.

1. openID - won't be suitable for my project.

2. Single sign on module looks good. (module page: http://drupal.org/node/50418)

* This module relies on several tables being shared between the master and
* slave sites. Here is an example of the "$db_prefix" variable you need to
* establish in all of your "settings.php" files in the "sites" directory.
* Each site should have a unique name in place of "somesitename_". While
* you can rename "shared_" to something else, the prefixes must be the
* same for all sites.
*
* @verbatim
* $db_prefix = array(
* 'default' => 'somesitename_',
* 'authmap' => 'shared_',
* 'profile_fields' => 'shared_',
* 'profile_values' => 'shared_',
* 'role' => 'shared_',
* 'sequences' => 'shared_',
* 'sessions' => 'shared_',
* 'users' => 'shared_',
* 'users_roles' => 'shared_',
* 'users_uid_seq' => 'shared_', // for pgsql

Does this mean that each one of the three installations will use its own tables (2 using prefixes) and share the tables mentioned above for the single sign on?

Database:
Main
--A- Shared tables (handles the shared sign on)
--B- Not Shared
D1_Main
--C- Not Shared
D2_Main
--D- Not Shared

Does this mean all of them are in the same database (on the same machine)??

Can I put them on different databases/ machines?
Machine/DB 1
--Main
----A- Shared tables (shared sign on)
----B- Not Shared
Machine/DB 2
--D1_Main
----C- Not Shared
Machine/DB 3
--D2_Main
----D- Not Shared

vm’s picture

Does this mean that each one of the three installations will use its own tables (2 using prefixes) and share the tables mentioned above for the single sign on?

yes

Does this mean all of them are in the same database (on the same machine)??

yes

Can I put them on different databases/ machines?

and share tables ? no. This would require remote access to the DB servers I believe & even at that, I've never seen anyone pull it off, or write up an ability to do so. I've tried on my own to share tables in seperate DB's and couldn't get it done.
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

phpdude’s picture

OK - thanks