Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6
Author Message
SuperCat
Hangin' Around


Joined: Nov 27, 2004
Posts: 37
Location: MN

PostPosted: Sat Nov 27, 2004 6:18 pm Reply with quote

The new admin file renamablility will bring a nice layer of security to nuke. So that means all the developers out there will be recoding their stuff for 7.6. Here is a nice way to keep those scripts compatible with previous versions of nuke:

This line in particular will make it backward compatible:
Code:
if ($admin_file == '') { $admin_file = 'admin'; }


At the top of the admin file for your script, have this code:
Code:
global $prefix, $db, $admin_file;

if ($admin_file == '') { $admin_file = 'admin'; }
if (!eregi("".$admin_file.".php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
$aid = substr("$aid", 0,25);
$row = $db->sql_fetchrow($db->sql_query("SELECT radminsuper FROM " . $prefix . "_authors WHERE aid='$aid'"));
if ($row['radminsuper'] == 1) {


At the top of the case file for your script, have this code:
Code:
global $admin_file;

if ($admin_file == '') { $admin_file = 'admin'; }
if (!eregi("".$admin_file.".php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }


At the top of your links file for your script, have this code:
Code:
global $admin_file;

if ($admin_file == '') { $admin_file = 'admin'; }
if (!eregi("".$admin_file.".php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©