Using an existing user table from another product

felgall

Joined: 2013-10-09
Posts: 16
Posted: Wed, 2013-10-09 08:58

I am looking to integrate Gallery 3 into an existing membership site. All of the members are already logged in by the time they would get anywhere near the gallery and so there is no need for them to log in again as that's just duplicating things.

I was hoping to be able to replace the users table in gallery with a view that pointed to equivalent fields in the existing membership site but that didn't work.

I want Gallery to recognise that everyone that accesses it is already logged in as a registered user. Does anyone have any suggestions on how to achieve this? It looks trivially easy to create new themes and slightly modify the user module to do everything else I need to be able to integrate it, I just need to be able to figure a way to override the user table with information in the equivalent table that already exists.

Does anyone have any suggestions on what I can try that might work?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2013-10-09 14:54
 
felgall

Joined: 2013-10-09
Posts: 16
Posted: Wed, 2013-10-09 18:22

Thanks for those suggestions. I don't have enough knowledge of how Gallery works yet to have any idea of whether either of those could be adapted to what I need but I am sure a study of them will help.

 
felgall

Joined: 2013-10-09
Posts: 16
Posted: Wed, 2013-10-09 20:21

I've had a look at those and none of them are what I am after. Each of those provides an alternative login mechanism to the one that exists in Gallery. I need to get rid of the login in gallery completely because with where I am intending to implement it everyone is already logged in before they can access Gallery at all.

What I want is a way to have Gallery recognise that anyone accessing it is already logged in and to access their details from the site where they already logged in. They should not have to login to Gallery as they are already logged in by the time they get to any Gallery page. No login/logout or register links should appear within Gallery at all as all of that isa already handled by the system I am trying to embed it in.

Basically I need to do the following.

1. The Gallery authentication system that checks if people are logged in or not needs to accept that everyone is logged in and to never ask anyone to login.
2. Instead of reading the user table Gallery needs to read the table that contains the user identities from the system it is being embedded in.
3. All references to logging in/registering / logging out / updating profile etc need to be removed from Gallery as they are already handled by the main system.

I don't expect to find any module that is going to come even remotely close to being able to do this for me. What I need to know is what parts of the system I should be looking at to find the parts that perform the functionality that I need to delete from Gallery.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2013-10-09 21:15

Gallery2 has this capability

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
felgall

Joined: 2013-10-09
Posts: 16
Posted: Wed, 2013-10-09 21:38

I made several attempts to download Gallery 2 - each crashed before completing the download. If I can't get the base product to download then what it could or couldn't do becomes irrelevant.

Perhaps its time to start looking again at alternative products. I've already eliminated Gallery 2, zenphoto and coppermine as not providing what I am looking for - I wonder what others are out there that might be able to be adapted to what I need.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2013-10-09 23:20

Gallery2 files are hosted on sourceforge.net, I highly doubt the download crashed.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
felgall

Joined: 2013-10-09
Posts: 16
Posted: Thu, 2013-10-10 01:02

I tried several timesand each time it crashed. You doubting that it could happen doesn't change the fact that it did - several times.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2013-10-10 01:09

your connection must suck as I just downloaded on my phone http://codex.galleryproject.org/Gallery2:Download#Packages

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2013-10-10 03:22

Downloads work for me as well.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
felgall

Joined: 2013-10-09
Posts: 16
Posted: Thu, 2013-10-10 05:24

I downloaded Gallery 3 without any problems. It is Gallery 2 that refuses to download. I have downloaded los of other things at various times and have only ever had problems with Gallery 2 - anything else downloads fine.

Anyway that has nothing to do with what I am asking about as I would prefer not to use Gallery 2 even if I could get it to download as it seems really bloated compared to Gallery 3 which more closely matches to what I am after.

 
felgall

Joined: 2013-10-09
Posts: 16
Posted: Thu, 2013-10-10 18:09

Finally managed to get a copy of Gallery 2 by downloading it using a different computer with lower security settings. When II attempted to run the install I got a screen full of error messages and had to scroll down to see the page itself. As soon as I pressed the button to go to the first step of the install it crashed.

So forget suggesting that I try the extremely antiquated Gallery 2.

Unless I can find an alternative script that is as close to what I want as Gallery 3 is I guess I'll just have to do a major rewrite of sections of Gallery 3 to do what I want using code that I can understand.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Thu, 2013-10-10 20:58

The benefits of open source at it's finest! Good for you.

FWIW, G2 downloads and installs great for me.

 
felgall

Joined: 2013-10-09
Posts: 16
Posted: Thu, 2013-10-10 21:12

Having had a closer look at all the code in the user module I think I have now figured out why substituting a view for the user table didn't work. The rpoblem was that it provided no way for Gallery 3 to identify who it is that is logged in.

I am going to try implementing the view again but this tile I am also going to change the code so that the calls in Gallery 3 to validate the password will always retiurn true and also so that calls to get the guest user get the currently logged in user. As the script appears to treat anyone who doesn't log in as if they are logged in as guest this should hopefully fix things so that the script will work. Just have to wait until I get home to try it.

If those changes work then I can add the extra code to verify that the person accessing the page is logged in to my site.

Thanks for all the suggestions. It is great to see that this script has an active forum community.

 
felgall

Joined: 2013-10-09
Posts: 16
Posted: Fri, 2013-10-11 09:32

I've solved the problem of getting Gallery to use my existing membership data by using a view. Currently it always defaults to the user with id 1.

The main system uses a session to keep track of a logged in user but while the correct session is getting passed to Gallery 3 when it is first called, every subsequent call has a different session id so as soon as you leave the first page or reload the first page you are automatically logged out of the entire site.

So my new question is now: How do I stop Gallery 3 generating a new session id on every page load?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2013-10-11 13:41
Quote:
Currently it always defaults to the user with id 1.

That is the guest user ID of G3.

I'm no session expert but the session ID is in the DB and perhaps your CMS can query that? I don't think it changes on each page load.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team