i asked this question in a 1.5 thread by replying to a topic there, not realizing that it was 1.5.
I am trying to have multiple websites use the same users between sites, I know there are a couple extension to do this but the ones that I find for 1.7 do more than I want. I just want it so if a user is registered on one of my sites they don't need to create a new account on the second one. Also ensuring they have the same name and password between them.
I found a thread in the 1.5 forum that seems to address this showing how to modify the data base using views but as far as I can tell the 1.7 data base may be different.
So here is what I found. and my question.
I followed the instructions but Joomla 1.7 only has 2 of the tables listed in the instructions. Unless I am missing something. The ones that it has is, jos_users and jos_session .
I seem to be able to login on one site and be logged in the other, automatically after doing the views onto the first 2 tables, which is good.
But I want to make sure that everything is correct since the other 6 tables can't be done. Do I need to do more but with different tables.
I don't need this for community builder or anything, just plain Joomla user sync. I wan't users registered on one site to be registered on the other site.
The instructions that I found for Joomla 1.5 to get this working are
birnik wrote:tboheeren asked me, how I done it. I can't send personal messages yet, therefore I reply here. Hope he will read it.
As I managed to make two sites work with common user base, I decided to share how it should be done step by step.
What is the solution?
What the solution is not?
- Allows two or more Joomla! sites to have one and the same user base and sessions.
- It could be used for other stuff (i.e. banners, sections etc.) however this is not subject of this guide. We will review only users and sessions.
- It is not a bridge, a component, module, plugin or something like this. This is a solution on database level.
- If you want to share components, articles etc. it is much more complicated, however not impossible. But this is not something we will review here.
- It is not recommended to use this solution for two already existing sites, as at least one of them will either crash, or you will at least lose its user base.
- The users in the two (or more) sites will have one and the same access rights (i.e. super admin in one will be super admin in the others as well and so on, you cannot set different rights for the different sites).
BEFORE DOING ANYTHING TO YOUR EXISTING WEB SITES, MAKE A BACKUP, AS YOU MAY LOSE DATA.
- MySQL 5
- PHP 5
- Joomla! 1.5
- The sites should share one and the same database server and the database user should have access rights to all databases in use.
Step by step:
- Install Joomla! on localhost/site1 (or domain.com - doesn't matter) with database name site1.
- Install second Joomla! on localhost/site2 (or any domain) with database name site2 - it is important that the database user for both sites is one and the same.
- Open the configuration.php files of both installations and copy the secret value ($secret = 'somesymbolshere';) from the configuration of site1 to the configuration to site2. So both installations should have one and the same secret key in their configuration. If you want to add even more sites, the other sites should also have the same key for secret.
- Open phpMyAdmin of the database of site2 and execute one by one (each row is one execution) the following:Now run the following SQL queries in the same database (if necessary replace site1 with the corresponding database name used by site1)
Code: Select all
DROP TABLE `jos_users` DROP TABLE `jos_session` DROP TABLE `jos_stats_agents` DROP TABLE `jos_core_acl_aro` DROP TABLE `jos_core_acl_aro_groups` DROP TABLE `jos_core_acl_aro_map` DROP TABLE `jos_core_acl_sections` DROP TABLE `jos_core_acl_groups_aro_map`And that is all. Both sites will now have one and the same users and sessions. Adding more sites is easy, just follow the instructions here for site2 database and configuration file.
Code: Select all
CREATE VIEW jos_users AS SELECT * FROM site1.jos_users CREATE VIEW jos_session AS SELECT * FROM site1.jos_session CREATE VIEW jos_stats_agents AS SELECT * FROM site1.jos_stats_agents CREATE VIEW jos_core_acl_aro AS SELECT * FROM site1.jos_core_acl_aro CREATE VIEW jos_core_acl_aro_groups AS SELECT * FROM site1.jos_core_acl_aro_groups CREATE VIEW jos_core_acl_aro_map AS SELECT * FROM site1.jos_core_acl_aro_map CREATE VIEW jos_core_acl_aro_sections AS SELECT * FROM site1.jos_core_acl_aro_sections CREATE VIEW jos_core_acl_groups_aro_map AS SELECT * FROM site1.jos_core_acl_groups_aro_map
If you have existing site and you want the new one you are setting up to have all of the users of the old one, you can do it, by just imaging that your old site is site1 in this example and follow the instructions post installation.
If you have two existing sites - THIS IS NOT THE RIGHT SOLUTION FOR YOU.
As for versions 1.5 - there is no problem. Upgrade both of your installations without any worries.
As for version 1.6 - it is hard to say yet, as it is not stable enough.
Hope you find it useful. If you have any questions, ask in that thread.