News:

CPG Release 1.6.31
Minor maintenance release
Clean up remaining remnants of the .net CPG website
Improved installer_stub compatibility with various server configurations

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 :)