Hello,
I've made some custom pages that i really don't want guests to see, but rather only proper users.
Ive been looking through lots of the code to try and figure out what i need to add to my pages to make coppermine check for authentication on my custom pages.
The most frustrating thing is i remember reading a post from Gau Gau where he said something about authenticating users, but i simply cannot find it.
I'm fairly certain its not more than one line of code, as i believe most of coppermine's pages are authenticated.
If someone knows the code or the post on user authentication, please reply.
Thanks
Tim
Album properties (http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#album_prop), change "Album can be viewed by" from "Everybody (public album)" to "Members of the registered group". Explained in the docs - please read before posting. No modification of the code needed.
Sorry,
There is a misunderstanding.
I have created a "custom page", my own page that uses:
<?php
define('IN_COPPERMINE', true);
require('include/init.inc.php');
pageheader('Main Forum');
include('source_main_forum.php');
pagefooter();
//(!USER_ID) {
?>
to create the menu system around my own content.
This is an entirely seperate page from the coppermine photo gallery. You wrote some code once that allowed a "custom page" to be authenticated.
Sorry for the misunderstanding.
Tim
To check if the visitor is logged in, try using the constant USER_ID:<?php
if (!USER_ID) {
// the visitor is a guest
cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
}
?>
Gau Gau,
This worked perfectly. I sincerely thank-you for your time!
Cheers
Tim