By bazzly on
Can someone point me to a good how to? Does this have to be setup from initial install, or can this be done if the site has already been created?
I'd like uses to be able to log on to one site, and automatically be logged on to the other.
so if the user logs onto site1.com and goes to site2.site1.com the user will already be logged on.
I have seen how tos doing it from the settings.php, but that is from initial install.
Thanks
Comments
_
The only tutorial i know of is at http://drupal.org/node/147828. It's for d5, but should be essentially the same for d6. Not sure it allows you to share profiles however.
You may also want to look at the http://drupal.org/project/domain module.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Yes I saw that
Yes I saw that http://drupal.org/node/147828 but its for a shared database. I would think there is something out there.
I played around with the domain module a bit...need to figure out how to get it to work on the user end of things.
Thank anyway :)
=-=
I did some fairly extensive research on this awhile back. There is no module that does what you ask. Nor does it seem that the settings.php array will work with 2 seperate databases that you want to share tables with. The only sharing that seems to be supported in the shared database method.
My guess is a custom module would have to be written to bridge drupal to drupal. much like a module to bridge a 3rd party script to drupal. ie: phpbb, vb, smf
Good to know....bummer, but
Good to know....bummer, but good to know. Thanks!
Quick question....when doing shared database for the second site install, I set my settings.php with
$db_prefix = array(
'default' => 'drupal2_',
'authmap' => '',
'profile_fields' => '',
'profile_values' => '',
'role' => '',
'sessions' => '',
'users' => '',
'users_roles' => '',
);
now when I go to http://drupal2.local/install.php the installer comes up and and starts to runs. The problem is it kicks errors that the tables listed above in my settings.php already exists. I know they do....but do I want it to over write them? If so how would I do that?
The other question, is....Would it be better to use a fresh install on the main before doing the second site. My main site has a few users in it and some content. (I know those tables would be wiped if It wrote over them.) I wonder if that is part of the reason for the errors aside from them already being in the database. Not a big deal if I need to start over it just Time...
Any advice?
=-=
overwrite them? no you don't. you need to set a prefix during installation of site two so tables are overwritten.
you don't want to mess with settings.php until you physically have both sites and their tables installed. In shared DB, that means your first site can have a prefix or not, and your second site MUST have a prefix and if your using a prefix on your first site, the prefix on site2 MUST be different.
site1_authmap
site1_profile_fields
site2_authmap
site2_profile_fields
so on so forth.
you can set a prefix during drupal installation by expanding the advanced collpased menu when filling in your DB information.
Ok so if I get this
Ok so if I get this correctly. My main site is installed all default, so no prefix.
My second site I need to install with a prefix (did this during the install under advanced). Once that is done I then change the settings.php to share the tables?
If I want it to share two ways (example: site1->site2 and site2->site1) would I edit the settings.php from both sites? Or would I just edit the settings.php from the main site?
I tried to edit both settings.php
om my main I have (no prefix)
$db_prefix = array(
'default' => '',
'authmap' => '',
'profile_fields' => '',
'profile_values' => '',
'role' => '',
'sessions' => '',
'users' => '',
'users_roles' => '',
);
On my second site I have
$db_prefix = array(
'default' => 'test_',
'authmap' => 'test_',
'profile_fields' => 'test_',
'profile_values' => test_'',
'role' => 'test_',
'sessions' => 'test_',
'users' => 'test_',
'users_roles' => 'test_',
);
So how do I get the user to auto log on to the second site? Also if a user creates an account on one of the sites, will it carry over to the other?
At one point a found a very nice post about all this and what options to set but never bookmarked it. Now I can no longer find it.
thanks
=-=
I'd use google to find relevant information. I don't like the idea of sharing a database one iota thus I've never done it to give you any specifics beyond what I've already given.
Ok thanks.... Unfortunially
Ok thanks.... Unfortunially google is not helping much. I didnt think it be this difficult to have a user auto logon. I have read numerous post of people doing it, but nothing on how to do it.
Thanks for the info!!! You helped a lot!
Well decided to try this
Well decided to try this http://drupal.org/node/201673
The first install goes fine, but after dropping the tables and starting the second install the installer fails. So for anyone thinking of trying it....well good luck I guess..... It does have a lot of good information though.
Update: this works to share users across sites. http://drupal.org/node/22267 but I cant seem to get the user to automatically logon across the two sites
I tried to enable the $cookie_domain = 'example.com'; in the sub sites settings.php, but the user will not log in with that enabled.
Any Ideas?
=-=
I think you need to add the module single sign on to the mix.
That did it!!! You are the
That did it!!! You are the man!! Thanks again!
Seems like you are using shared tables, same database...
Another way to go about this is to use the Domain module (plus Single Sign On). It addresses a lot of these issues without having to deal with the complexity of prefixing tables.
I'm still looking for a way to do logins across databases....sigh.
Funny you say that...I just
Actually its different databases, with shared tables.
Funny you say that...I just wrote a how to for myself posted on my blog. But you have to drop and add tables.
Let me know if you want me to post the blog
=-=
posting it as a handbook page in the documentation area would be of benefit for the community at large and newcomers seeking the same information in future.
Yes I know...The main reason
Yes I know...The main reason I posted on my blog is well.....it could use some improvement. But if its fine the way it is I can post it there.
As of the moment, I just found a better way of doing part of it so I need to revise a section.
=-=
No worries. Was just throwing it out there so that you knew you could post to the handbooks.
Ok silly question....how and
Would you want to take a quick look at it before I post it? Can I send you the link some how? Dont want to post it if its gonna cause confusion. I understand it because I did it.
What do you think I should use for Parent?
What's your blog address,
What's your blog address, I'd be interested in reading it :)
I placed the info in my
I placed the info in my profile under interests. I dont want to spam the forum. If folks find it to be worth something, I'll post it to the book.
why don't you solve this through MySQL?
ever tried the simplest solution?
> just go ahead and install the drupal main site and its subsite(s) as you would normally do
> in phpmyadmin (or other methods), select the database for the subsite (!), and then drop the 'users', 'profile_fields' and 'profile_values' tables
> make a query like this for all tables:
CREATE VIEW users AS SELECT * FROM yourmaindatabasename.users;
CREATE VIEW profile_fields AS SELECT * FROM yourmaindatabasename.profile_fields;
CREATE VIEW profile_values AS SELECT * FROM yourmaindatabasename.profile_values;
> you're done!
Instead of constantly manipulating drupal with modules, using the above method just lets you use one single share table, on whatever subsite you might be.
Good luck!
W.
Related modules about single
Related modules about single sign-on at https://www.drupal.org/search/site/single%20AND%20Single%20Sign-On?f%5B0...