forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: dnadan on June 18, 2007, 06:30:31 pm

Title: Login Recognition
Post by: dnadan on June 18, 2007, 06:30:31 pm
I'm looking for a way to check for if a user is logged in on a non-coppermine site.  I.e. I want to use a php script "require" to check if the username and password are set in the cookie.  But I'm not sure how to get that info out.

So my end result i'm looking for is a page that loads and using php will say something like "please login to coppermine to view this page" or else if they are logged in it will show the content. 

I hope that made sense what I'm looking for.  Thanks in advance for anyone who has any suggestions, let me know if I can clarify better
Title: Re: Login Recognition
Post by: Sami on June 18, 2007, 06:55:55 pm
It would better if you tell us what are you really want to do with that external page
Title: Re: Login Recognition
Post by: dnadan on June 19, 2007, 01:02:07 am
Its a family web page with some personal content on it.  So there is a general welcome page for all.  But Then when they log in they can access other pages with personal content and other things.  One of the pages links to coppermine to see photos.  But I don't want them to have to log in again on the coppermine page, but I also don't want to turn off passwords on coppermine because I don't want someone to see pictures on coppermine unless they have logged in.

hope that helps, let me know if I need to clarify.  Ive looked around in the forums and seen things about miniCMS or phpNUKE as portal systems, but phpNUKE is beyond me, and I installed miniCMS and I can't figure out how to do much with that.

So any help or any pointing in the right direction would help a ton.  Thanks again
Title: Re: Login Recognition
Post by: dnadan on June 19, 2007, 01:51:27 am
I guess what I'm really looking for is a way to make my non-coppermine pages read the cookie set by coppermine.  So if someone can help me figure out how to parse out the username and password from the cookie so I can check them, then I think I can do the rest.  Thanks
Title: Re: Login Recognition
Post by: Nibbler on June 19, 2007, 01:54:37 am
Username and password are not stored in the cookie for security reasons. You'd need to read the session id from the cookie and look it up in the database to see if it is valid. See how it works in bridge/coppermine.inc.php