Help on how to tackle the situation

PandorasFire - January 19, 2009 - 20:59

I know php/mysql as well as xhtml/css. I have looked over some of the code and some of the documentation. Overall this site has a pretty strong community, it's a bit hard for me to find the documentations though.

Anyways, what I am trying to accomplish is I have my brother who owns three domains and has a web hosting service with HostMonster.

I installed these three domains via multisite, so each of these domains have their own database but are running on a single codebase. Furthermore, I installed this module, multisite_api with multisite_login for drupal6.x. From what I read, this person basically stores the information and checks it against the other sites associated with the multisite_api. This works, because when I log in as the administrator, which has the same username/password for each of these domains, it signs in on all sites.

In addition to the above module, I also installed the phpbbforum integration module so I am integrating my drupal 6.9 installation with a phpbb3.04 installation. All this works however I would like to explain the ideal and where I am stuck at.

The Ideal: Three domains: www.domain1.com , www.domain2.com , www.domain3.com , running on one drupal codebase installation and running different databases. However, I want them to share users, therefore, creating/signing on/logging out of one site, logs you out of all the sites. In addition, I want to have one forum installation of phpbb3 to be able to share users with these three domains. Therefore, when you are signed into any of these sites, you will be brought to the same forums with the same username/information. I also would like them to share the same profile fields that are already enabled with the phpbbforum integration module.

Reality(What is happening now): Some problems I had while trying to achieve this will be listed in order.
1. I installed the multisite as the directions from the documentation. My first problem as listed above, that I was involve with hostmonster. Practically, any domain hosted on their shared domain hosting services, are listed as a folder in the main public_html folder. For example, domain1.com will redirect to home/username/public_html/. However, domain2.com and domain3.com will redirect to home/username/public_html/domain2/ & home/username/public_html/domain3 (respectively).
1a. I used a symlink script in php to change this, and this fixed it by directing those directories to the home/username/public_html/sites/domain2.com & home/username/public_html/sites/domain3.com --which is where I wanted it to go for the drupal installation.
2. After I fixed the above problem, I installed PHPBB3 in the directory home/username/public_html/forums.
3. I then installed the phpbbforum module and followed the steps for the domain1.com forums. It works, when I'm logged into PHPBB3, it logs me in to domain1.com and vice versa. Same with account creation. However, when I went to domain2.com's admin & domain3.com's admin and tried the phpbbforum integration module, it does not work, it says 'phpbb user: anonymous ...etc...' [So I skipped this to see if I can fix it later]
4. Then I went to install the multisite_login module which is built upon the multisite_api. The first problem I encountered was that when I logged in domain1.com, it logged me into domain2.com and domain3.com but whenever I logged in to domain2.com or domain3.com it would not log into domain1.com but the others. I fixed this by going to my /sites/ directory and adding /domain1.com/ directory and going into the multisite_api and disable all those under 'default'.
4a. This fixed the problem, so no matter which domain I log into, I log into all the other sites, but not the forums.
5. So now I am stuck, I can't seem to do what I originally wanted to do [in the ideal] After reading,reviewing some code, I noticed that these modules are just hacks and not real implementations of actually sharing users. So I decided that I might as well just make my own module that allows this.

My question is since I am new to PHPBB3 and Drupal, I wanted to know atleast for drupal's end of this problem where to find the best practices for coding in drupal and other things so I make sure I don't have problems with other modules on this site for future endeavors. So what I am asking is for some help in architecturing/problem solving this problem as I am new to these CMS's and don't really have the time to study the whole code and juts need a general direction where I can go.

P.S. domain1.com/forums , domain2.com/forums , domain3.com/forums all goes to the same phpbb installation as I wanted to [for those wondering]

Any help is appreciative !!!

Additional information: The

PandorasFire - January 19, 2009 - 21:01

Additional information:
The phpbbforum integration module: http://drupal.org/project/phpbbforum
The Multisite API module: http://drupal.org/project/multisite_api
The Multisite login module: http://drupal.org/project/multisite_login

^^ Links for the modules for those who are interested in helping out and believe that I can achieve the ideal with just a few php edits with the above modules. However, I am pretty confident that I have to conquer this with my own module.

only one way

ludo1960 - January 19, 2009 - 21:05

It's the domain module you need http://drupal.org/project/domain , good luck!

According to that link, they

PandorasFire - January 19, 2009 - 21:24

According to that link, they all share the database. I am hoping that they don't because that would make it a lot harder if I ever needed to update drupal. Any other suggestions?

EDIT: Also I read that it deals mostly with subdomains. Keep in mind that these are all domains and not subdomains or subdirectories of domains.

OK

ludo1960 - January 19, 2009 - 21:40

This is interesting, dig a bit deeper into the sub modules that come with the domain module, I'm almost sure there is a way to do this. Try sending http://drupal.org/user/20975 a begging letter :-)

Edit:

You have the possibility of using different tables, check out the Domain Prefix packaged module

Haha I'll message that user

PandorasFire - January 19, 2009 - 22:18

Haha I'll message that user for some information, but seems like he has a lot going on so I doubt my request will get heard. I will look into that module you recommended to me and really dig into it and see if it works on my test site.

=-=

VM - January 19, 2009 - 22:24

I don't believe there is a way to share logins without sharing databases. to share tables you have to edit the array in settings.php

that said, I've never found a way, and I've tried pretty darned hard, to have seperate databases sharing the users table to no avail.

I'd have to assume that it isn't at all possible for this reason as well. groups.drupal.org and drupal.org don't have a single login that will keep you logged in on both sites. I'd figure drupal.org and it's network would implement if it was indeed possible.

Ok

ludo1960 - January 19, 2009 - 22:26

I tried to write a little script to do something similar, would like to further this. Please keep me informed of progress and PM if you like

I was thinking of using

PandorasFire - January 19, 2009 - 22:50

I was thinking of using something like one database = that holds all user tables. and somehow link that to the rest of the databases which they refer to. So one main database just for user tables. [Not too sure if its practical/possible in a database management system] { I am taking a data management systems course this semester, so def. by the end of this semester I will most likely figure out a solution to my problem }

=-=

VM - January 19, 2009 - 22:55

I believe sessions table would also have to be shared.

OK interested

ludo1960 - January 19, 2009 - 22:57

Keep me informed please, this is a goody!

True but I was thinking

PandorasFire - January 19, 2009 - 23:21

True but I was thinking about making a new database, and copy the only user on these sites so far.

So basically I have 3 db's for drupal, 1 for phpbb3, and 1 to keep track of all user information.

So I was thinking of rewriting the login procedures for each of these sites / phpbb3 and basically make it that if you create a user on any of these sites it will create an identical one on the other db's and when you are logging in, all it does is check it against the master database which is the database containing every single user ever made.

Hmm

ludo1960 - January 19, 2009 - 23:35

That could turn into pandoras box, can it be done?

It can but I'm not sure if

PandorasFire - January 20, 2009 - 12:42

It can but I'm not sure if its practical/good, might be for a small site, but if it ever got to mediumish type of congestion, it is too slow. I'll try messing around by making functions later in the week after I have gotten a chance to look at the source.

 
 

Drupal is a registered trademark of Dries Buytaert.