By prameya on
I am new to drupal, but the attraction is too strong. I want to start a community portal with multiple language. The main site is going to be english while the other site will be nepalese (unicode). I want to install it as domain.com --> main installation (english) and domain.com/ne --> second installtion (nepalese). But I want both the sites to share a common login system.. is that possible?
please advise alternatives. both the sites will have blog, forum and other modules, user should be able to have access to both. How to make this possible??
Thanks
Comments
If you can do PHP, you can
If you can do PHP, you can get drupal to authenticate with anything like
http://api.drupal.org/api/4.7/function/hook_user
So you could get all the sites to authenticate back to a nominated "main" site?
also theres a module for distributed authetnication
Shared login
Here's the simplest way to do this without breaking anything (as far as i know).
In your settings.php file in the sites directory, you'll find
$db_url = 'mysql://username:password@localhost/databasename';change that to the following (capitalized things need to be changed to appropriate values)
This should work as it does for me, you'll need both DB's to share the same DB username and password, and you'll need to do this on both sites.
Ron Williams
http://ronwilliams.io/
almost got it
Do I have to load the drupal query on both the databases?
The login database is same on both the sites, and content database will be different.. right?
awesome!
It works perfectly, I used different db for each installation. Thanks!
undo share login?
OK, I set my site up exactly as suggested above. I only have three users right now and some content.
My problem is that I keep getting errors when I backup my site and restore it in testing (the original site is still good). The errors I get are very similar to the errors that some people got on these forums relating to auto_increment problems. However, it appears to me now, after working on it for several days, that it is has to do with how I shared the login.
Anyway, I am now trying to undo the shared login to at least test it (I really don't have to have a shared login anyway). I assumed that I could just copy the users, sessions and sequences tables from the login database to the two main databases. It didn't work that way. On closer inspection, I have tried to delete the sequences table entries that seemed to be from the other database to no avail.
Any suggestions as to how to unshare my logins?
Tried shared login
Hi Ron,
I tried changing the settings.php for the site but its not work for me.
Ex: common database user name is root and password is null.
Site 1 admin username - root and password is root123 and database name - site1
site 2 admin username - admin and password is admin123 database name - site2
Now I went to site 2 settings.php and changed it like that.
$db_url = 'mysql://root@localhost/site2';
$db_prefix = array(
'default' => 'site2.',
'users' => 'site1.',
'sessions' => 'site1.',
'sequences' => 'site1.',
);
and saved it.
After that my access to site2 login has gone and I am not able to login to site2 using admin account.
so i think it didn't solve the problem.
Please correct me if I am wrong.