Gallery login for other pages.

thesoarer
thesoarer's picture

Joined: 2002-10-05
Posts: 22
Posted: Wed, 2002-10-09 18:52

I would like to have a seperate login page for my members section that also logs them into Gallery. I also would like to make my members pages automaticly detect if they are logged in and show a log in page if they aren't.

Like, they go to the members index and it sees that they aren't logged in. So it displays a log in screen for them. Then they go to the member page 2 and it checks to see if they are logged in or not. Since they are it displays the regular content. Then they bookmark member page 2 and leave. Next day the come back to page 2, and since they aren't logged in it displays a log in screen. Once they log in page 2 displays correctly.

How can I do that? I don't want to use a portal system so that is out. Thanks.

 
thesoarer
thesoarer's picture

Joined: 2002-10-05
Posts: 22
Posted: Mon, 2002-10-14 04:00

Nobody have any ideas???

 
xylon

Joined: 2003-07-17
Posts: 2
Posted: Thu, 2003-07-17 14:19

This is exactly what I'm looking to do... Does anyone have any ideas?

 
h0bbel
h0bbel's picture

Joined: 2002-07-28
Posts: 13451
Posted: Fri, 2003-07-18 18:09

I've done something like that (with Bharat's helpt that is).

What I did was to make my own login system using mysql. Then i set up a session containing the username, and in init.php i added (on line 238)

/* Added for thp4 support. :) */
if ($_SESSION['thp4_username'] && !isset($gallery->user)) {
    $gallery->user = $gallery->userDB->getUserByUsername($_SESSION['thp4_username']);
 }

thp4 is my own system, and this now works as long as the same username is defined both places. The passwords don't need to be the same, since only the username variable is carried with the session.

Hope this gets you started. :)