Author Topic: 2 installations sharing the same login and users  (Read 4862 times)

0 Members and 1 Guest are viewing this topic.

Offline Kjeld

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • iKjeld.com
2 installations sharing the same login and users
« on: June 03, 2007, 07:20:29 AM »
I am thinking about setting up two installations of 4images that would share users. I have very carefully searched the forum, and although there are similar threads I couldn't find the answer to my dilemma. I was hoping someone would be able to think with and tell me if I am correct or wrong, or whether I am trying to do something that may potentially damage my data.

These are the requirements:

1. Installation 2 would use the users of installation 1
2. All other data (images, categories, comments, captions, etc.) would be separate

I have been playing around to figure out how to do this.

In installation 2, I changed "includes/constants.php" as follows:

from
Code: [Select]
define('USERS_TABLE', $table_prefix.'users');
to
Code: [Select]
define('USERS_TABLE', 'installation1_users');
This worked fine. The users were now available in installation 2.

However, when I log in at installation 1, I am still not logged in at installation 2 and visa versa.

This is of course because of the cookie settings in includes/sessions.php. I figure I must change sessions.php of installation 2. I tried several combinations, but couldn't figure it out.

If my setup for installation 1 is domain.com/photos and for installation 2 is domain.com/photos2, how should I change the following in sessions.php of installation 2?

Code: [Select]
define('COOKIE_PATH', '');
My questions in summary:

1. What do I put in COOKIE_PATH?
2. Is there anything else that I would need to change?
3. Is there any danger that data may get damaged, or that the program won't work when two installations share users and 1 cookie?

I  am sure that many other users would benefit from this modification as well, so I hope there will be some good input.  :D

Offline KurtW

  • 4images Guru
  • *******
  • Posts: 2.778
    • View Profile
    • Malediven-Bilder ~~Dreams~~
Re: 2 installations sharing the same login and users
« Reply #1 on: June 03, 2007, 12:04:22 PM »
Hi,

use your modification also for:
Code: [Select]
define('SESSIONS_TABLE', 'installation1_sessions');
define('SESSIONVARS_TABLE', 'installation1_sessionvars');
   :wink:


cu
KUrt

Offline Kjeld

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • iKjeld.com
Re: 2 installations sharing the same login and users
« Reply #2 on: June 03, 2007, 02:05:02 PM »
Aha, I missed that one. Thanks, Kurt!  :D

Offline Kjeld

  • Newbie
  • *
  • Posts: 27
    • View Profile
    • iKjeld.com
Re: 2 installations sharing the same login and users
« Reply #3 on: June 03, 2007, 03:16:59 PM »
I am still not clear what I should put in COOKIE_PATH and question 3. Any ideas anyone?

1. What do I put in COOKIE_PATH?
2. Is there anything else that I would need to change?
3. Is there any danger that data may get damaged, or that the program won't work when two installations share users and 1 cookie?