Google

NukeCoder

Menu


Donations

Find our service's and script's useful? Make a small donation to show your support.

 Recent Donations:
 01. Krike (10-14)
 02. Trunks (09-07)
 03. Spasticdonkey (05-08)

Important Notes for PHP-Nuke Users
There are certain bits of code in php-nuke, nukesentinel, and shortLinks that can interfere with The Digital Shop normal functionality.  To get around this, you will need to make a few simple edits.

Start by opening mainfile.php
Find the following code:(Note: this code may not appear in your mainfile.php.  If not, please skip this step)

// Posting from other servers in not allowed
// Fix by Quake
// Bug found by PeNdEjO
 
if ($_SERVER['REQUEST_METHOD'] == "POST") {
  if (isset($_SERVER['HTTP_REFERER'])) {
    if (!stripos_clone($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])) {
        die('Posting from another server not allowed!');
    }
  } else {
    die($posttags);
  }
}


Change to:

if ($name != "Digital_Shop" && $_GET['act'] != "process_ipn")
{

if ($_SERVER['REQUEST_METHOD'] == "POST") {
  if (isset($_SERVER['HTTP_REFERER'])) {
    if (!stripos_clone($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'])) {
        die('Posting from another server not allowed!');
    }
  } else {
    die($posttags);
  }
}

}


If you are using shortLinks to generate search engine friendly url's then you will need to apply the following fix.  This fix will disable shortLinks on the admin pages of The Digital Shop because it breaks the find as you type functions.

Find the following code:

if (isset($tnsl_bUseShortLinks) && $tnsl_bUseShortLinks && file_exists(INCLUDE_PATH.'includes/tegonuke/shortlinks/shortlinks.php') ) {


Change to:

if (isset($tnsl_bUseShortLinks) && $tnsl_bUseShortLinks && file_exists(INCLUDE_PATH.'includes/tegonuke/shortlinks/shortlinks.php') && ($name !== 'Digital_Shop' && $_GET['do'] != 'administer')) {

If you are using GoogleTap or GT-Nextgen(which are no longer supported/maintained), you will need to make similar changes.

You can now Save and Close mainfile.php.


Now open includes/nukesentinel.php (assuming you have nukesentinel installed)
This fix will stop nukesentinel from blocking paypal's IPN.  When paypal sends the IPN, it doesn't send a User Agent and nukesentinel doesn't like that so it blocks the request.  This will keep purchases from being added to the database and may make your customers quite mad when they pay for the goods and don't receive them.

Find:

// Invalid user agent
if($nsnst_const['user_agent']=="none" AND !stristr($_SERVER['PHP_SELF'], "backend.php") AND ($nsnst_const['remote_ip'] != $nsnst_const['server_ip'])) {
  echo abget_template("abuse_invalid2.tpl");
  die();
}


Change to:

if ($name != "Digital_Shop" && $_GET['act'] != "process_ipn")
{
// Invalid user agent
if($nsnst_const['user_agent']=="none" AND !stristr($_SERVER['PHP_SELF'], "backend.php") AND ($nsnst_const['remote_ip'] != $nsnst_const['server_ip'])) {
  echo abget_template("abuse_invalid2.tpl");
  die();
}
}



The next problem is really specific to Internet Explorer and the captcha in The Digital Shop.  If you have the flood blocker enabled in nukesentinel and you are using captcha for free downloads in your shop, a problem will occur with sessions that will prevent Internet Explorer users from being able to download files even after entering the correct captcha code.  To fix this, we just disable the flood blocker for the captcha and free download page.  If you do not use the shop for free downloads or if you do not use the flood blocker you can skip this section.

Find the following code:

$blocker_row = $blocker_array[11];
if($blocker_row['activate'] > 0) {
  session_start();
  //session_name("NSNST_Flood");
  if(!($_SESSION["NSNST_Flood"])){
    $_SESSION["NSNST_Flood"] = time();
    ab_flood($blocker_row);
  }else{
    ab_flood($blocker_row);
    $_SESSION["NSNST_Flood"] = time();
  }
  //session_write_close();
}



Change to:

if ($name != 'Digital_Shop' && ($_GET['act'] != 'captcha' && $_GET['act'] != 'downloadFile'))
{

$blocker_row = $blocker_array[11];
if($blocker_row['activate'] > 0) {
  session_start();
  //session_name("NSNST_Flood");
  if(!($_SESSION["NSNST_Flood"])){
    $_SESSION["NSNST_Flood"] = time();
    ab_flood($blocker_row);
  }else{
    ab_flood($blocker_row);
    $_SESSION["NSNST_Flood"] = time();
  }
  //session_write_close();
}

}



Last Updated: 2007-12-20 20:51:25 (809 views)