Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: a php site only for member  (Read 4710 times)

0 Members and 1 Guest are viewing this topic.

DaBe

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 110
a php site only for member
« on: January 25, 2008, 08:43:11 pm »

Hello

How I can make a normal php page only for the member avaible?


Logged

Nibbler

  • Guest
Re: a php site only for member
« Reply #1 on: January 25, 2008, 08:45:35 pm »

You need to include coppermine's include/init.inc.php and then check that the USER_ID constant is nonzero.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: a php site only for member
« Reply #2 on: January 26, 2008, 02:57:58 am »

Something like
Code: [Select]
<?php
define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');
pageheader('Hello member');
if (!
USER_ID) {
    
cpg_die(ERROR$lang_errors['access_denied'], __FILE____LINE__);
}
?>

Your custom content here
<?php
pagefooter
();
?>
should do the trick.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.