Jump to content

version warning message


peterp

Recommended Posts

Hi All,

         One of my clients is running version 6.0.6 and is quite happy and does not want to upgrade at all, however he is getting the warning message in his admin which states "Warning: Your store is not up-to-date v6.4.3 is available but you are running 6.0.6 update now" . How do I suppress this message, he is currently undergoing a software audit and intends to update in the near future but for now wants this message to be removed.

Thanks for any help

Best regards,

Peterp

Link to comment
Share on other sites

For CC605 (CC606 probably has the same line numbers), in /admin/sources/dashboard.index.inc.php:

Find near line 69:

## Check current version
if (!isset($_SESSION['version-check']) && $request = new Request('www.cubecart.com', '/version-check/'.CC_VERSION)) {
	$request->skiplog(true);
	$request->setMethod('get');
	$request->cache(true);
	$request->setSSL(true);
	$request->setUserAgent('CubeCart');
	$request->setData(array('version' => CC_VERSION));

	if (($response = $request->send()) !== false) {
		if (version_compare(trim($response), CC_VERSION, '>')) {
			$GLOBALS['main']->setACPWarning(sprintf($lang['dashboard']['error_version_update'], $response, CC_VERSION).' <a href="?_g=maintenance&node=index#upgrade">'.$lang['maintain']['upgrade_now'].'</a>');
		}
		$_SESSION['version-check'] = true;
	}
}

Change to:

## Check current version
if (false && !isset($_SESSION['version-check']) && $request = new Request('www.cubecart.com', '/version-check/'.CC_VERSION)) {
	$request->skiplog(true);
	$request->setMethod('get');
	$request->cache(true);
	$request->setSSL(true);
	$request->setUserAgent('CubeCart');
	$request->setData(array('version' => CC_VERSION));

	if (($response = $request->send()) !== false) {
		if (version_compare(trim($response), CC_VERSION, '>')) {
			$GLOBALS['main']->setACPWarning(sprintf($lang['dashboard']['error_version_update'], $response, CC_VERSION).' <a href="?_g=maintenance&node=index#upgrade">'.$lang['maintain']['upgrade_now'].'</a>');
		}
		$_SESSION['version-check'] = true;
	}
}
$_SESSION['version-check'] = true; // Make sure CubeCart knows that a version-check has been made, no need to keep checking.

The added 'false' means the version-check will not take place, and the added line at the bottom replicates what would have happened after a version-check.

Link to comment
Share on other sites

Hi Brian,

I have done this change but unfortunately the error still appears when the admin dashboard is first displayed, if the user goes to another selection (e.g. products) and then comes back to the dashboard then it doesn't display the version number error again. How do I stop it from appearing in the for instance.

Best Regards,

Peterp

Link to comment
Share on other sites

That should have worked.

In Store Settings, Advanced tab, enable debugging. Enter your local IP address in the following field (www.showmyip.com).

Now, when viewing any page, below the contents, there will be a grey debug section. Look in the SESSION: section, '__system' element, 'version_check' key. It should have a value of 1.

The value will obviously be '1' after the dashboard gets displayed, and viewing all pages after that. (It seems that SESSION is given to the debug spool before the version check is made, so the very first viewing of the Dashboard will not have 'version_check'. But the 'false' expression that is now part of the if() test should keep the code from making the test in the first place.)

The actual admin login screen should not have 'version_check' at all.

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi Brian,

Sorry about the delay in answering I have been caught up in other projects, anyway I have turn on the debug option and rerun the admin but I still get the error message. Please see below the debug display the version is set to 1

SESSION:

'__client' =>
'ip_address' => 137.147.26.45
'useragent' => Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
'session_start' => 1625636262
'session_last' => 1625636263
'currency' => AUD
'admin_id' => 1
'__system' =>
'token' => 3d8f2c233cc955a4aab673e2f0fd1c94
'__admin_data' =>
'admin_id' => 1
'customer_id' => 0
'status' => 1
'name' => Website Owner
'username' => peterp
'new_password' => 1
'email' => [email protected]
'verify' =>
'logins' => 155
'super_user' => 1
'notes' =>
'failLevel' => 0
'blockTime' => 0
'lastTime' => 1625636262
'browser' => Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
'ip_address' => 137.147.26.45
'language' => en-US
'dashboard_notes' =>
'order_notify' => 1
'tour_shown' => 1
'__admin' =>
'user_language' => en-US
'version-check' => 1
 
Any ideas how to stop this error message appearing on the first display of the admin dashboard.
After the first display the error message doesn't appear again, its just on the very fist display of the dashboard.
 
Hope you can help
Best Regards,
Peterp
Link to comment
Share on other sites

The 'version_check' should be under "__system". (Well, maybe that's for versions more recent.)

Still, adding the false as shown below should have worked.

## Check current version
if (false && !isset($_SESSION['version-check']) && $request = new Request('www.cubecart.com', '/version-check/'.CC_VERSION)) {

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...