HOWTO:Share a User DB Between Multiple Sites

From e107 Wiki
Jump to: navigation, search

e107 Wiki: English | Русский | Deutsch | Français | Magyar | Português | Български | Česky | Nederlands | Ελληνικά | Italiano | Norske | Polska | Slovenščina | Español | Svenska | Translate: Wiki | Page

logo_wiki.png

Current Release 1.0.4 | e107.org | Download | Changelog | Forum | Plugins | Themes | RSS Feed of Latest Changes | Atom Feed of Latest Changes


HOWTO:Share a User DB Between Multiple Sites
Main page > I : First Aid > II : Development > III : Administration > IV : How To's > V : Plugin Writing > VI : Theming & Shortcodes


This page is a stub. You can help e107 by expanding it.

Introduction

This guide takes you step-by-step through sharing a user database between multiple sites.

WARNING

This probably isn't the best solution. There is one small bug: when a user changes their password, sometimes the site that is edited is mean and wont let the user do anything along the way of posting or changing settings. Also, I don't know much about PHP or MySQL. This idea only came to me just before I fell asleep one night and took me half an hour to get working. I have barely tested it.

Several other things:

Its quite possible that this method won't reliably access the single user database, since there are a number of ways of specifying the user table, and this method only updates one of them.
There could be complications with extended user fields, and user classes.
Each user has only a single set of counters for things such as forum posts, so these can get out of step - especially if the 'recalculate' options are used.

Essentially E107 is currently not designed to support this - so while enough will happen to convince you its working, and possibly even enough to be acceptable, it won't work 100%. (And this applies to various other suggested methods of achieving the same result, as well).

One other thing: if you want to install a non-core plug-in on the edited install, you'll need to do one of two things:

I: Install it before you edit the e107 install

or

II: Extract it to your desktop and preform Step 2.

What you'll need:

- A program like [1] that can find and replace code from the source files of e107 all at once.
- A piece of software like [2] which installs Apache, MySQL, and PHP.


STEP I.

OK first you'll need to install 2 copies of e107 on your computer to a directory structure similar to this:

C:/Program Files/EasyPHP/www/e107/e107_1

C:/Program Files/EasyPHP/www/e107/e107_2


Launch EasyPHP and right click the task bar icon for EasyPHP and click "Local Web". Your default browser should show up with a blue web page. Click on the directory where the two copies of e107 reside and then navigate to the first install. The standard e107 install page should show up. Just install this as standard with the following information:

MySQL User name:root

MySQL Password:

Database name:e107 check the create button.

Database prefix:e107_

Then just install as usual.

Once you've finished installing the first copy on e107, navigate to the second install and use the following data to install:

MySQL Username:root

MySQL Password:

Database name:e107

Database prefix:e107_2


STEP II.

Open Dreamweaver and Press Ctrl+F.

You will see a "Find and Replace" dialog pop-up; enter the following info:

Find in:Folder...

the box next to it will require you to navigate to the first install base directory.

Find:("user

Replace:("2user

then click Replace All.

And that's basically it. You should now be able to register as a new user on one install and show up on the other.