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: Sun Nov 28, 2004 8:27 pm Reply with quote

For those that distribute scripts, you will want to update them for v7.6, but want to keep them backward compatible with previous versions of nuke. This is how you do it for the admin URL redirect that hides the admin.php filename:

Lets say you have this coded:
Code:
<a target='_blank' href='http://www.google.com'>Google</a>


This will tell google that the referring page is:
Code:
http://www.mysite.com/admin.php


Were not worried that google knows what our admin file has been renamed to, but we are worried about those hackers finding out. We need to hide them. This is what you need to do:

Near the top of the admin file, put:
Code:
global $hideURL;


$sqlV = "select * from ".$prefix."_config";
$resultV = $db->sql_query($sqlV);
$confV = $db->sql_fetchrow($resultV);
if ($confV['Version_Num'] >= '7.6') {
   $hideURL = 'index.php?url=';
} else {
   $hideURL = '';
}


At the top of each function in the admin file, put:
Code:
global $hideURL;


Where you have every outbound URL, add to the beginning of it:
Code:
".$hideURL."


Like this:
Code:
<a target='_blank' href='".$hideURL."http://www.google.com'>Google</a>


note the single quote before the double quote

This adds index.php?url= before the outbound URL if the version of nuke is 7.6 or higher. For older versions, nothing is added, and the URL looks as it has always looked. An added bonus for this is, if a user now is using nuke less that 7.6, updates your script, then in the future, updates to 7.6 or higher, your script will automatically start using the URL redirect protection.

_________________
How deep can we dig the rabbit hole? 
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 ©