coppermine-gallery.com/forum

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: windhunter on April 06, 2004, 10:45:45 AM

Title: How can I figure out whether the user is logged on or not
Post by: windhunter on April 06, 2004, 10:45:45 AM
I'm making a mod.
I would like to check (on page matej.php) whether the user currently viewing matej.php is logged to the CPG or not.

Can I just look if the cookie of CPG exists? How can I do this?
Is there a simple function integrated into CPG, so I would only have to copy it to matej.php or include it?


tx in advance

matej
Title: How can I figure out whether the user is logged on or not
Post by: Nibbler on April 06, 2004, 12:17:08 PM
If you include init.inc.php (which you probably are) then you can check USER_ID like this:


If (USER_ID)
{
logged in stuff
} else {
user not logged in stuff
}
Title: How can I figure out whether the user is logged on or not
Post by: windhunter on April 06, 2004, 12:58:15 PM
thank you,
that is just what I needed