coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: galacnet on September 14, 2006, 07:52:08 PM

Title: Make admin only access to custom file
Post by: galacnet on September 14, 2006, 07:52:08 PM
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 :)
Title: Re: Make admin only access to custom file
Post by: Nibbler on September 14, 2006, 08:04:42 PM
Include init.inc.php and check with

if (!GALLERY_ADMIN_MODE) die('Access denied');
Title: Re: Make admin only access to custom file
Post by: galacnet on September 14, 2006, 08:20:22 PM
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.
Title: Re: Make admin only access to custom file
Post by: galacnet on September 14, 2006, 08:35:44 PM
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....
Title: Re: Make admin only access to custom file
Post by: Joachim Müller on September 15, 2006, 06:04:05 AM
You can only do this for files that reside within coppermine's root folder. It can't exist outside of that folder.
Title: Re: Make admin only access to custom file
Post by: galacnet on September 15, 2006, 06:09:35 AM
Guess I need to reprogram my script on a work around.
Thanks for the help :)