Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Down for Maintenance v1.2


mhormann

Recommended Posts

I saw that with Jean-Luc Friez's update of Down for Maintenance v1.2 we now have the option of auto-updating the Admin's IP (in case you dial-in)—which is a very useful feature.

 

The only problem is a very minor thing in the code that got overlooked:

 

To make the contrib work, you HAVE to have an unused 'Configuration Group ID' (this is what people tell you to change in the SQL file, i.e. make it > 15).

 

Now Jean-Luc already set it to '16' for all of us using MS2, only the Admin IP check still checks for a hard-coded '15' in the file '/catalog/admin/configuration.php'.

 

You MUST modify this number to be THE SAME as the one in the SQL statements:

 

Open '/catalog/admin/configuration.php' and find:

  // *** Add for getting the actual IP (when not fix)
 if ($HTTP_GET_VARS['gID'] == '15') {
   $IP_Admin = tep_db_prepare_input(getenv(REMOTE_ADDR));
   $IP_Admin_DB_query = tep_db_query ("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'EXCLUDE_ADMIN_IP_FOR_MAINTENANCE'");
   $IP_Admin_DB = tep_db_fetch_array($IP_Admin_DB_query);
   if ($IP_Admin_DB['configuration_value'] != $IP_Admin) {
     tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $IP_Admin . "' where configuration_key = 'EXCLUDE_ADMIN_IP_FOR_MAINTENANCE'");
   }
 }
 // *** end

 

Edit so it will use YOUR NUMBER as group ID instead:

  if ($HTTP_GET_VARS['gID'] == '16') {

(I used a 16 here, the number that currently is in the SQL file.)

 

And voil?! It will auto-update your IP whenever you go to 'Site Maintenance' in your Admin Panel.

 

Regards,

Matthias

I don't want to set the world on fire—I just want to start a flame in your heart.

 

osCommerce Contributions:

Class cc_show() v1.0 – Show Credit Cards, Gateways

More Product Weight v1.0

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...