Make admin only access to custom file Make admin only access to custom file
 

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]

Main Menu

Make admin only access to custom file

Started by galacnet, September 14, 2006, 07:52:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

galacnet

Hello,

I made a custom file and I would like a logged in Admin to have access to it.
What are the files that I need to include to make that possible?

Thanks :)

Nibbler

Include init.inc.php and check with

if (!GALLERY_ADMIN_MODE) die('Access denied');

galacnet

I added this

Quoterequire('../include/init.inc.php');
if (!GALLERY_ADMIN_MODE) die('Access denied');

It says "Not in Coppermine"

The file is in a subdirectory.

galacnet

Sorry about the above post.
I looked around the script of those sections that are admin only and inserted this.

Quotedefine('IN_COPPERMINE', true);
require('../include/init.inc.php');
if (!GALLERY_ADMIN_MODE) die('Access denied');

Now the script is just a blank white page....

Joachim Müller

You can only do this for files that reside within coppermine's root folder. It can't exist outside of that folder.

galacnet

Guess I need to reprogram my script on a work around.
Thanks for the help :)