Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-11-26 13:09:48

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,529
Website GitHub Twitter

2 txp webiste with same user table?

Hi

I have 2 txp website with 2 différent domains, is it possible to both to share the same user table?

I dont know how to handle that! sincing the 2 tables? I can make them share the same DB using the prefix table, but how to make the user table the same is not clear in my mind!

Help appreciated.

Offline

#2 2015-11-26 14:10:11

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: 2 txp webiste with same user table?

I don’t think that is possible without modifying TXP code.
You could create/delete/modify users in one TXP install and periodically copy the txp_users content to the other TXP install.

Offline

#3 2015-11-26 14:37:27

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,529
Website GitHub Twitter

Re: 2 txp webiste with same user table?

Thanks ruud for the answer

I was digging a little on Mysql and found information about views, we can create a view from a table with this code:

CREATE VIEW new_txp_users AS SELECT * FROM txp_users;

But i should test that the view is working like a regular table on localhost to see if that work!

ADD: I tested it on localhost and that works, i can access both txp installation with the same user table, i can also make changes on user data in both installation! that’s really funny!

Last edited by Dragondz (2015-11-26 14:45:44)

Offline

#4 2015-11-26 16:40:00

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: 2 txp webiste with same user table?

ruud wrote #296832:

You could create/delete/modify users in one TXP install and periodically copy the txp_users content to the other TXP install.

Plugin playground ahead!

Offline

#5 2015-11-26 18:20:03

kuopassa
Plugin Author
From: Porvoo, Finland
Registered: 2008-12-03
Posts: 229
Website

Re: 2 txp webiste with same user table?

In a live scenario if websites A and B are located in different servers, and A is the main website, you might have to allow external database access for B. This kind of arrangement could cause latency issues for B.

Offline

#6 2015-11-26 19:15:24

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: 2 txp webiste with same user table?

I think allowing external database access will be more problematic than the latency (the users table typically doesn’t change a lot).

Still learning new stuff about TXP. First time I noticed those callbacks ;)

Offline

Board footer

Powered by FluxBB