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

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

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