Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel™ v2.6.x
Author Message
kb9nha
Regular
Regular


Joined: Apr 26, 2008
Posts: 60
Location: Windy City

PostPosted: Tue May 04, 2010 12:34 am Reply with quote

I've installed NukeSentinel (version 2.6.01) recently on my website. I was also able to edit the core files except for index.php on (/module/Your_Account/index.php). I can't find the script that need to be edited. It's totallt different from what was written in the NukeSentinel edit core files instruction. I'm using PCN Xtreme V5.1 (versio 8.1). The index.php file is below. I been trying to get help at PCN site as well. Any help I could get is very much appreciated. I got limited knowledge in solving this problem.

Code:
<?php


/************************************************************************/
/*    Pc-Nuke! Systems -  Advanced Content Management System            */
/************************************************************************/
/*    Created by Pc-Nuke! Systems -- Released: 2008                     */
/*    http://www.pcnuke.com                                             */
/*    All Rights Reserved || 2003-2008 || by Pc-Nuke!                   */
/************************************************************************/
/*         The Power of the Nuke - Without the Radiation!               */
/************************************************************************/
/************************************************************************/
/* - Copyright Notice (read and understand the GNU_GPL)                 */
/* - THIS PACKAGE IS RELEASED AS GPL/GNU SCRIPTING.                     */
/* - http://www.pcnuke.com/modules.php?name=GNU_GPL                     */
/************************************************************************/
/* CNB Your Account: An Advanced User Management System for phpnuke     */
/* Copyright (c) 2004 by Comunidade PHP Nuke Brasil                     */
/* http://dev.phpnuke.org.br & http://www.phpnuke.org.br                */
/************************************************************************/
/* CNBYA - the official successor of NSN Your Account by Bob Marion       */
/************************************************************************/
/**********************************/
/*  Module Configuration          */
/* (right side on) v3.1           */
/* Remove the following line      */
/* will remove the right side     */
/**********************************/
define('INDEX_FILE', true);
$index    = 1;

if (!defined('MODULE_FILE')) {
    die ("You can't access this file directly...");
}

require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);

require_once("modules/Your_Account/includes/constants.php");
if (!defined('CNBYA')) { echo "CNBYA protection"; exit; }
include_once("modules/$module_name/includes/functions.php");
$ya_config = ya_get_configs();
$userpage = 1;

include("modules/$module_name/navbar.php");
include("modules/$module_name/includes/cookiecheck.php");

cookiedecode($user);

switch($op) {

    case "activate":
        include("modules/$module_name/public/activate.php");
    break;

    case "avatarlist":
        if (is_user($user)) {
            include("modules/$module_name/public/avatarlist.php");
        } else {
            notuser();
        }
    break;

    case "avatarsave":
        if (is_user($user)) {
            include("modules/$module_name/public/avatarsave.php");
        } else {
            notuser();
        }
    break;

    case "avatarlinksave":
        if (is_user($user)) {
            include("modules/$module_name/public/avatarlinksave.php");
        } else {
            notuser();
        }
    break;

    case "broadcast":
        if ($broadcast_msg == 1) {
            include("modules/$module_name/public/broadcast.php");
        } else {
            disabled();
        }
    break;

    case "delete":
        if ($ya_config['allowuserdelete'] == 1) {
            include("modules/$module_name/public/delete.php");
        } else {
            disabled();
        }
    break;

    case "deleteconfirm":
        if ($ya_config['allowuserdelete'] == 1) {
            include("modules/$module_name/public/deleteconfirm.php");
        } else {
            disabled();
        }
    break;

    case "editcomm":
        include("modules/$module_name/public/editcomm.php");
    break;

    case "edithome":
        include("modules/$module_name/public/edithome.php");
    break;

    case "edittheme":
    break;

   case "changemail":
      include("modules/$module_name/public/changemail.php");
      changemail();
   break;


    case "chgtheme":
        if ($ya_config['allowusertheme']==0) {
            include("modules/$module_name/public/chngtheme.php");
        } else {
            disabled();
        }
    break;

    case "edituser":
        include("modules/$module_name/public/edituser.php");
    break;

    case "gfxadminimage":
   // menelaos: dynamically insert the version number in the admin config panel image Copyright (c) 2004 :-)
   $icon      = "images/admin/users.png";
   $image      = ImageCreateFromPNG($icon);
   $text_color   = ImageColorAllocate($image, 0, 0, 0);
   Header("Content-type: image/png");
   ImageString ($image, 1, 7, 38, $cnbyaversion, $text_color);
   ImagePNG($image, '', 75);
   ImageDestroy($image);
      
   break;

    case "gfx":
    // Begin Copyright (c) 2004 by NukeScripts Network
        $datekey = date("F j");
        $rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
        $code = substr($rcode, 2, $ya_config['codesize']);
        $ThemeSel = get_theme();
        if (file_exists("themes/$ThemeSel/images/code_bg.png")) {
            $codeimg = "themes/$ThemeSel/images/code_bg.png";
            include("themes/$ThemeSel/theme.php");
            $tcolor = str_replace("#", "", $textcolor1);
            $tc_r = hexdec(substr($tcolor, 0, 2));
            $tc_g = hexdec(substr($tcolor, 2, 2));
            $tc_b = hexdec(substr($tcolor, 4, 2));
        } else {
            $codeimg = "images/code_bg.png";
            $tc_r = $tc_g = $tc_b = 0;
        }
        $image = ImageCreateFromPNG($codeimg);
        $text_color = ImageColorAllocate($image, $tc_r, $tc_g, $tc_b);
        Header("Content-type: image/png");
        ImageString ($image, 5, 5, 2, $code, $text_color);
        ImagePNG($image, '', 75);
        ImageDestroy($image);
        die();
    // End Copyright (c) 2004 by NukeScripts Network
    break;

   case "login":
      $result  = $db->sql_query("SELECT * FROM ".$user_prefix."_users WHERE username='$username'");
      $setinfo = $db->sql_fetchrow($result);

      // menelaos: check of the member agreed with the TOS and update the database field
      if (($ya_config['tos'] == intval(1)) AND ($_POST['tos_yes'] == intval(1))) {
      $db->sql_query("UPDATE ".$user_prefix."_users SET agreedtos='1' WHERE username='$username'");
      }
      $forward = ereg_replace("redirect=", "", "$redirect");
      if (ereg("privmsg", $forward)) { $pm_login = "active"; }
   if ($db->sql_numrows($result) == 0) {
      include("header.php");
      Show_CNBYA_menu();
      OpenTable();
      echo "<center><font class='title'>"._SORRYNOUSERINFO."</font></center>\n";
      CloseTable();
      include("footer.php");
   } elseif ($db->sql_numrows($result) == 1 AND $setinfo['user_id'] != 1 AND $setinfo['user_password'] != "" AND $setinfo['user_active'] >0 AND $setinfo['user_level'] >0) {
        global $gfx_chk;
      $dbpass     = $setinfo[user_password];
      $non_crypt_pass = $user_password;
      $old_crypt_pass = crypt($user_password,substr($dbpass,0,2));
      $new_pass = md5($user_password);
      if (($dbpass == $non_crypt_pass) OR ($dbpass == $old_crypt_pass)) {
         $db->sql_query("UPDATE ".$user_prefix."_users SET user_password='$new_pass'   WHERE username='$username'");
         $result = $db->sql_query("SELECT user_password FROM ".$user_prefix."_users   WHERE username='$username'");
         list($dbpass) = $db->sql_fetchrow($result);
      }
      if ($dbpass != $new_pass) {
         Header("Location: modules.php?name=$module_name&stop=1");
         return;
      }
      $datekey = date("F j");
      $rcode = hexdec(md5($_SERVER['HTTP_USER_AGENT'] . $sitekey . $random_num . $datekey));
      $code  = substr($rcode, 2, $ya_config['codesize']);
      if ($gfx_chk == 0){
          $code = $gfx_check;}
      if (extension_loaded("gd") AND $code != $gfx_check AND ($ya_config['usegfxcheck'] == 2 OR $ya_config['usegfxcheck'] == 3)) {
         Header("Location: modules.php?name=$module_name&stop=11");
         die();
      } else {
         // menelaos: show a member the current TOS if he has not agreed yet
         if (($ya_config['tos'] == intval(1)) AND ($ya_config['tosall'] == intval(1)) AND ($setinfo[agreedtos] != intval(1))) {
            if($_POST['tos_yes'] != intval(1)) {
            include("modules/$module_name/public/ya_tos.php");
            exit;
            }
         }
         // menelaos: show a member the current TOS if he has not agreed yet

          yacookie($setinfo[user_id], $setinfo[username], $new_pass, $setinfo[storynum], $setinfo[umode], $setinfo[uorder], $setinfo[thold], $setinfo[noscore], $setinfo[ublockon], $setinfo[theme], $setinfo[commentmax]);
         $last_ip = $_SERVER["REMOTE_ADDR"];
         $db->sql_query("DELETE FROM ".$prefix."_session WHERE uname='$uname' AND guest='1'");
          //$db->sql_query("UPDATE ".$prefix."_users SET last_ip='$last_ip' WHERE username='$username'");   
         //if ($Version_Num >= 7.6) $db->sql_query("UPDATE ".$prefix."_users SET last_ip='$last_ip' WHERE username='$username'");
            


/*
//////////////////////////////////////////////////////////////////////////////////////////
/// IP Display & DB input update, by: hammer 2007.12.15  Only registered users can see links on this board! Get registered or login! ///
//////////////////////////////////////////////////////////////////////////////////////////

global $db,$user,$admin,$bgcolor, $bgcolor2, $bgcolor1, $prefix;
cookiedecode($user);
$ip = $_SERVER["REMOTE_ADDR"];
$username = $cookie[1];
if ($username == "") {$username = "Anonymous";}

$isphash = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$ispstr = preg_split("/\./", $isphash);
$xy = count($ispstr);
$x = $xy - 1;
$y = $xy - 2;
$i = $xy - 3;
$pc  = "" . $ispstr[$i] . "";
$isp = "" . $ispstr[$y] . "." . $ispstr[$x] . "";
$ip  = "" . $_SERVER['REMOTE_ADDR'] . "";
   
//$content .= "<center><b>IP</b>: &nbsp;$ip</center>";

if (is_admin($admin) OR (is_user($user))) {

$sql = "UPDATE ".$prefix."_users SET last_ip = '$ip' WHERE username = '$username'";
$db->sql_query($sql);

}
   
//////////////////////////////////////////////////////////////////////////////////////////
/// IP Display & DB input update, by: hammer 2007.12.15  Only registered users can see links on this board! Get registered or login! ///
//////////////////////////////////////////////////////////////////////////////////////////
*/








         
      }

      // menelaos: the cookiecheck is run here
      if ($ya_config['cookiecheck']==1) {
      $cookiecheck   = yacookiecheckresults();
      }
         
      if ($pm_login != "") {
         Header("Location: modules.php?name=Private_Messages&file=index&folder=inbox");
      } else if ($redirect == "" ) {
         Header("Location: modules.php?name=Your_Account&op=userinfo&bypass=1&username=$username");
      } else if ($mode == "") {
         Header("Location: forums.html?file=$forward");
      } else if ($t !="")  {
         Header("Location: forums.html?file=$forward&mode=$mode&t=$t");
      } else {
         Header("Location: forums.html?file=$forward&mode=$mode&f=$f");
      }
      } elseif ($db->sql_numrows($result) == 1 AND ($setinfo['user_level'] < 1 OR $setinfo['user_active'] < 1)) {
         include("header.php");
         Show_CNBYA_menu();
         OpenTable();
         if ($setinfo['user_level'] == 0) {
            echo "<br><center><font class=\"title\"><b>"._ACCSUSPENDED."</b></font></center><br>\n";
         } elseif ($setinfo['user_level'] == -1) {
            echo "<br><center><font class=\"title\"><b>"._ACCDELETED."</b></font></center><br>\n";
         } else {
            echo "<br><center><font class=\"title\"><b>"._SORRYNOUSERINFO."</b></font></center><br>\n";
         }
      CloseTable();
      include("footer.php");
      } else {
      Header("Location: modules.php?name=$module_name&stop=1");
      }
      break;

    case "logout":
        cookiedecode($user);
        $r_uid = $cookie[0];
        $r_username = $cookie[1];
        setcookie("user");
        if (trim($ya_config[cookiepath]) != '') setcookie("user","expired",time()-604800,"$ya_config[cookiepath]"); //correct the problem of path change
        $db->sql_query("DELETE FROM ".$prefix."_session WHERE uname='$r_username'");
        $db->sql_query("OPTIMIZE TABLE ".$prefix."_session");
        //$db->sql_query("DELETE FROM ".$prefix."_bbsessions WHERE session_user_id='$r_uid'");
        //$db->sql_query("OPTIMIZE TABLE ".$prefix."_bbsessions");
        $user = "";
        include("header.php");
        if ($redirect != "") {
            echo "<META HTTP-EQUIV=\"refresh\" content=\"2;URL=modules.php?name=$redirect\">";
        } else {
            echo "<META HTTP-EQUIV=\"refresh\" content=\"2;URL=index.php\">";
        }
        title(_YOUARELOGGEDOUT);
        include("footer.php");
    break;

    case "mailpasswd":
        include("modules/$module_name/public/mailpass.php");
    break;

    case "my_headlines":
        include("modules/$module_name/public/headlines.php");
    break;

    case "new_user":
     if (is_user($user)) {
            mmain($user);
        } else {
if ($ya_config['allowuserreg']==0) {
    if ($ya_config['coppa'] == intval(1)) {
       if($_POST['coppa_yes']!= intval(1)) {
         include("modules/$module_name/public/ya_coppa.php");
         exit;
     }
          }
     if ($ya_config['tos'] == intval(1)) {
       if($_POST['tos_yes'] != intval(1)) {
         include("modules/$module_name/public/ya_tos.php");
         exit;
     }
          }
        if ($ya_config['coppa'] !== intval(1) OR $ya_config['coppa'] == intval(1) AND $_POST['coppa_yes'] = intval(1)){
       if ($ya_config['tos'] !== intval(1) OR $ya_config['tos'] == intval(1) AND $_POST['tos_yes']=intval(1)){       
           if ($ya_config['requireadmin'] == 1) {
                    include("modules/$module_name/public/new_user1.php");
                } elseif ($ya_config['requireadmin'] == 0 AND $ya_config['useactivate'] == 0) {
                    include("modules/$module_name/public/new_user2.php");
                } elseif ($ya_config['requireadmin'] == 0 AND $ya_config['useactivate'] == 1) {
                    include("modules/$module_name/public/new_user3.php");
                }
             }
         }
           }else {
    disabled();   
  }
}
    break;

    case "new_confirm":
        if (is_user($user)) {
            mmain($user);
        } else {
            if ($ya_config['allowuserreg']==0) {
                if ($ya_config['requireadmin'] == 1) {
                    include("modules/$module_name/public/new_confirm1.php");
                } elseif ($ya_config['requireadmin'] == 0 AND $ya_config['useactivate'] == 0) {
                    include("modules/$module_name/public/new_confirm2.php");
                } elseif ($ya_config['requireadmin'] == 0 AND $ya_config['useactivate'] == 1) {
                    include("modules/$module_name/public/new_confirm3.php");
                }
            } else {
                disabled();
            }
        }
    break;

    case "new_finish":
        if (is_user($user)) {
            mmain($user);
        } else {
            if ($ya_config['allowuserreg']==0) {
                if ($ya_config['requireadmin'] == 1) {
                    include("modules/$module_name/public/new_finish1.php");
                } elseif ($ya_config['requireadmin'] == 0 AND $ya_config['useactivate'] == 0) {
                    include("modules/$module_name/public/new_finish2.php");
                } elseif ($ya_config['requireadmin'] == 0 AND $ya_config['useactivate'] == 1) {
                    include("modules/$module_name/public/new_finish3.php");
                }
            } else {
                disabled();
            }
        }
    break;

    case "pass_lost":
        include("modules/$module_name/public/passlost.php");
    break;

    case "saveactivate":
        include("modules/$module_name/public/saveactivate.php");
    break;

    case "savecomm":
        if (is_user($user)) {
            include("modules/$module_name/public/savecomm.php");
        } else {
            notuser();
        }
    break;

    case "savehome":
        if (is_user($user)) {
            include("modules/$module_name/public/savehome.php");
        } else {
            notuser();
        }
    break;

    case "savetheme":
        if (is_user($user)) {
            if ($ya_config['allowusertheme']==0) {
                include("modules/$module_name/public/savetheme.php");
            } else {
                disabled();
            }
        } else {
            notuser();
        }
    break;

    case "saveuser":
        if (is_user($user)) {
            include("modules/$module_name/public/saveuser.php");
        } else {
            notuser();
        }
    break;

    case "userinfo":
        include("modules/$module_name/public/userinfo.php");
    break;
   
   case "ShowCookiesRedirect":
        ShowCookiesRedirect();
    break;

    case "ShowCookies":
        ShowCookies();
    break;

    case "DeleteCookies":
        DeleteCookies();
    break;

    default:
        mmain($user);
    break;

}

?>
 
View user's profile Send private message
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Tue May 04, 2010 7:42 am Reply with quote

Wow. The Sentinel version is out of date. The CNBYA version is out of date. Led by Kguske we did a tremendous amount of work in transitioning CNBYA to RNYA (Ravennuke Your Account) a couple of RN releases ago. Hundreds, if not thousands of bugs (big and small) were quashed in that effort.

I doubt that anyone here has the time to go digging into the details of how PCN Extreme deals with CNBYA let alone throwing an old version of NS into the mix. Of course some folks are very generous and you never know ... but ...

If you can possibly do it I'd recommend RN 2.40.01.
 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel™ v2.6.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 ©