Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
SuperCat
Hangin' Around


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

PostPosted: Sun Dec 05, 2004 2:59 pm Reply with quote

A new security featre in PHP-Nuke v7.6 will allow you to rename admin.php to whatever you want. This is a great way to keep hackers at bay. Only drawback is you need to hide that from others. Most people wont care what you name admin.php to cause they arent out to hack you. All the admin area stuff that comes with nuke 7.6 has this URL redirect built in. Anything you make or add on to nuke needs the URL redirect added in top either the admin area or to blocks. The reason for adding it to blocks is because they can sit on the left side of the page and are possibly clicked on by admins while viewing the admin area.

I have created an easy way to do this here...

Please respect my copyright when adding this code, add my copyright with URL as well Smile

Paste this code at the top of your block:
Code:
// Copyright SuperCat http://www.ourscripts.net

global $admin, $admin_file;
$self = ereg_replace("/", "",$_SERVER['PHP_SELF']);
if ($admin_file == '') { $admin_file = 'admin'; }
if ((is_admin($admin)) AND ("".$admin_file.".php" == $self)) {
   $sqlV = "select * from ".$prefix."_config";
   $resultV = $db->sql_query($sqlV);
   $confV = $db->sql_fetchrow($resultV);
   if ($confV['Version_Num'] >= '7.6') {
      $slURL = 'index.php?url=';
   } else {
      $slURL = '';
   }
}
// end copyright


Then at the beginning of each URL, add this:
Code:
".$preURL."


A sample URL looks like this:
Code:
<a target=\"_blank\" href=\"".$slURL."http://www.google.com\">


If $preURL is null, then you wont have anything added to the beginning of the URL and it will act as normal.

The reason to have it only redirect under certain circumstances is to limit the amount of redirects. Regular users shouldnt be subjected to redirects, as this is just annoying. When an admin isnt viewing the admin area, they shouldnt be subected to it either.

This is also backward compatible back to PHP-Nuke v6.5.

_________________
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:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

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 ©