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 -> NukeSentinel™ v2.4.x
Author Message
mojowares
New Member
New Member


Joined: Jul 10, 2006
Posts: 14

PostPosted: Fri Jul 14, 2006 6:36 pm Reply with quote

Hello All,


So first off, I am fairly new to doing most of this here and can use some guidance. I have PHPNuke 7.8 running and I was looking at how to make sure it is secured. I found out that I should patch it with a chatserv patch and then install NukeSentinel. So this is what I have done.

Install PHPNuke 7.8 (up and working)
Copied over the most recent chatserv patch files on top of my install. (had to update config.php again)

Did the edit per the Nuke Sentinel mainfile.php for 7.8, now this is where I get lost some. I used my text editor and did the search for the items that said find this and replace with this. Did that and when I went the site it said I had an error on line 159, now that area of the code is right in the middle of the stuff I copied over.


The line only has a �}�

Here is line 127 thru 159

Code:



if (defined('FORUM_ADMIN')) {
   @require_once("../../../config.php");
   @require_once("../../../db/db.php");
   @require_once("../../../includes/sql_layer.php");
   if (file_exists("../../../includes/custom_files/custom_mainfile.php")) { @include_once("../../../includes/custom_files/custom_mainfile.php"); }
   //@require_once("../../../includes/ipban.php");
   @include_once("../../../includes/nukesentinel.php");
   if (defined('NUKE_HEADER') && file_exists("../../../includes/custom_files/custom_head.php")) { @include_once("../../../includes/custom_files/custom_head.php"); }
   if (defined('NUKE_HEADER') && file_exists("../../../includes/custom_files/custom_header.php")) { @include_once("../../../includes/custom_files/custom_header.php"); }
} elseif (defined('INSIDE_MOD')) {
   @require_once("../../config.php");
   @require_once("../../db/db.php");
   @require_once("../../includes/sql_layer.php");
   if (file_exists("../../includes/custom_files/custom_mainfile.php")) { @include_once("../../includes/custom_files/custom_mainfile.php"); }
   //@require_once("../../includes/ipban.php");
   @include_once("../../includes/nukesentinel.php");
   if (defined('NUKE_HEADER') && file_exists("../../includes/custom_files/custom_head.php")) { @include_once("../../includes/custom_files/custom_head.php"); }
   if (defined('NUKE_HEADER') && file_exists("../../includes/custom_files/custom_header.php")) { @include_once("../../includes/custom_files/custom_header.php"); }
} else {
   @require_once("config.php");
   @require_once("db/db.php");
   @require_once("includes/sql_layer.php");
   if (file_exists("includes/custom_files/custom_mainfile.php")) { @include_once("includes/custom_files/custom_mainfile.php"); }
   //@require_once("includes/ipban.php");
   @include_once("includes/nukesentinel.php");
   if (defined('NUKE_HEADER') && file_exists("includes/custom_files/custom_head.php")) { @include_once("includes/custom_files/custom_head.php"); }
   if (defined('NUKE_HEADER') && file_exists("includes/custom_files/custom_header.php")) { @include_once("includes/custom_files/custom_header.php"); }
}
   /* FOLLOWING TWO LINES ARE DEPRECATED BUT ARE HERE FOR OLD MODULES COMPATIBILITY */
   /* PLEASE START USING THE NEW SQL ABSTRACTION LAYER. SEE MODULES DOC FOR DETAILS */
   require_once("includes/sql_layer.php");
   $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
}




Am I doing this right?
Thanks,
 
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9449
Location: Arizona

PostPosted: Fri Jul 14, 2006 8:22 pm Reply with quote

I think if you remove these lines you will get beyond this problem:


/* FOLLOWING TWO LINES ARE DEPRECATED BUT ARE HERE FOR OLD MODULES COMPATIBILITY */
/* PLEASE START USING THE NEW SQL ABSTRACTION LAYER. SEE MODULES DOC FOR DETAILS */
require_once("includes/sql_layer.php");
$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
}


_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
mojowares
PostPosted: Fri Jul 14, 2006 8:30 pm Reply with quote

Cool,

That gets me almost there!!!

Now some of the blocks have an error online 285

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/mysite/public_html/includes/sql_layer.php on line 285

Here is the code around that area...

Code:



function is_user($user) {
   global $prefix, $db, $user_prefix;
   if(!is_array($user)) {
      $user = base64_decode($user);
      $user = addslashes($user);
      $user = explode(":", $user);
      $uid = "$user[0]";
      $pwd = "$user[2]";
   } else {
      $uid = "$user[0]";
      $pwd = "$user[2]";
   }
   $uid = addslashes($uid);
   $uid = intval($uid);
   if ($uid != "" AND $pwd != "") {
      $result = $db->sql_query("SELECT user_password FROM ".$user_prefix."_users WHERE user_id='$uid'");
      $row = $db->sql_fetchrow($result);
      $pass = $row['user_password'];
      if($pass == $pwd && $pass != "") {
         return 1;
      }
   }
   return 0;
}


Line 285: $pwd = "$user[2]";


Thanks
 
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Sat Jul 15, 2006 12:15 am Reply with quote

I think you're looking at the wrong file. That error indicates there's an SQL query problem. What query though, it is hard to say. Looks like what Montego told you to remove stopped with old abstraction layer from working, thus the errors in sql_layer.php

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
montego
PostPosted: Sat Jul 15, 2006 6:39 am Reply with quote

Try moving this back up right after the include for the sql_layer in the last else statement. Maybe like this:

Code:


} else {
   @require_once("config.php");
   @require_once("db/db.php");
   @require_once("includes/sql_layer.php");
   $dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);
   if (file_exists("includes/custom_files/custom_mainfile.php")) { @include_once("includes/custom_files/custom_mainfile.php"); }
   //@require_once("includes/ipban.php");
   @include_once("includes/nukesentinel.php");
   if (defined('NUKE_HEADER') && file_exists("includes/custom_files/custom_head.php")) { @include_once("includes/custom_files/custom_head.php"); }
   if (defined('NUKE_HEADER') && file_exists("includes/custom_files/custom_header.php")) { @include_once("includes/custom_files/custom_header.php"); }
}


Evaders, I have never even looked at 7.8. If you know something that I am missing, please do not hesitate to jump in. I was thinking that the NS instructions were wanting that whole block replaced and felt that mojo hadn't done that completely. But, now I see you mean by possibly needing the additional line. I believe it should go in that else but am guessing that it would work right after the sql_layer.php include.
 
mojowares
PostPosted: Sat Jul 15, 2006 4:25 pm Reply with quote

Cool -- I seem to be getting close (or so I think)

Well it seems that Sentinel has a replacement file for the block-Modules.php but it seems this problem maybe due to a problem with the headers.php -- now I did do the edit per the instructions (correctly?? I hope).

So where do I start with this error?

Warning: Cannot modify header information - headers already sent by (output started at /home/fabcym/public_html/header.php:32) in /home/fabcym/public_html/blocks/block-Modules.php on line 16

Thanks!
 
gregexp
The Mouse Is Extension Of Arm


Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol

PostPosted: Sat Jul 15, 2006 4:54 pm Reply with quote

Redo the edit to the header.php file, and in the event that the problem remains, send it to me at Only registered users can see links on this board! Get registered or login!

and Ill be happy to apply them for you.

_________________
For those who stand shall NEVER fall and those who fall shall RISE once more!! 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
mojowares
PostPosted: Sun Jul 16, 2006 9:18 am Reply with quote

Ok, So I tired to edit the headers.php file that came with 7.8 install and the patched version, I must be missing'n something. File is on it way to you DarkLord and Thanks!
 
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 -> NukeSentinel™ v2.4.x

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 ©