By Lupin3rd on
I have a problem!
I want share users tables across more drupal sites... i read the page of handbook that explain how share tables...
all seem to works fine but there are a problem:
if a user create his account in the siteA and login in the siteB, he have an access denied, because the user isn't in the users_roles table of siteB. In this way the user isn't an "authenticated user" for siteB but only for siteA.
I can resolve the problem sharing users_roles table... but this is a good solution? in this way i must use same roles for users in both sites...
Suggest?
Comments
A solution...
I have solved the problem with a mod to the users module.
I have change this:
Whit this:
In this way the users are "user authenticated" in both sites.
Sharing tables
What you can do is use table prefixing to map one site's user-tables to the others.
$db_prefix = array(
"default" => "slave.",
"users" => "master.",
"sessions" => "master.",
"role" => "master.",
"authmap" => "master.",
"sequences" => "master.",
"users_roles" => "master."
);
Where "master" and "slave" are the database names. You can add any other table that needs sharing here.
--
If you have a problem, please search before posting a question.
With my little mod at users
With my little mod at users module (in all sites that share users must be modded) i can only share two tables:
$db_prefix = array(
"default" => "slave.",
"users" => "master.",
"sequences" => "master.",
);
In this way all sites have own users roles, own authoritation map, own sessions.
I only share the users, and i hope that it's a very good solution.