Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2022
    Location
    Chennai
    Posts
    26
    Plugin Contributions
    0

    help question Maintenance Mode: Allow Access to Specific Pages

    Dear Friends,

    We are currently using Zen Cart 1.5.8 under PHP 8.1.9 Version at www.celextel.com.

    The following custom pages are using application_top.php and hence do not show up during Maintenance Mode.
    atom.php
    rss.php
    sitemap.php


    These are directly accessable files and does not use index.php?main_page.

    We would like these pages to show up during Maintenance Mode.

    Please suggest us the code to be used for this purpose in the following file:
    includes/init_includes/init_customer_auth.php

    Thanks,

    Lakshmanan
    Last edited by celextel108; 23 Oct 2022 at 08:23 AM.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,475
    Plugin Contributions
    88

    Default Re: Maintenance Mode: Allow Access to Specific Pages

    Do you want these pages to show up for everyone during Maintenance Mode?

  3. #3
    Join Date
    Sep 2022
    Location
    Chennai
    Posts
    26
    Plugin Contributions
    0

    Default Re: Maintenance Mode: Allow Access to Specific Pages

    Quote Originally Posted by lat9 View Post
    Do you want these pages to show up for everyone during Maintenance Mode?
    Yes, please help.

    We have been using osCommerce since 2004 and switching over to Zen Cart after testing.

    Thanks,

    Lakshmanan
    Last edited by celextel108; 23 Oct 2022 at 01:56 PM.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,475
    Plugin Contributions
    88

    Default Re: Maintenance Mode: Allow Access to Specific Pages

    For zc158, add the highlighted lines to /includes/init_includes/init_customer_auth.php (starting at line 37 for zc158) to enable those three scripts (presumably in the site's root directory) to be accessed by everyone even if maintenance-mode is active:
    Code:
    /**
     * check to see if site is DFM, and set a flag for use later
     */
    if (DOWN_FOR_MAINTENANCE == 'true') {
      if (!zen_is_whitelisted_admin_ip()){
        if ($_GET['main_page'] != DOWN_FOR_MAINTENANCE_FILENAME) $down_for_maint_flag = true;
      }
    //-bof-20221023-lat9-Enable **all** accesses to the root's atom.php, rss.php or sitemap.php to be accessed during maintenance-mode
      if (strpos($_SERVER['REQUEST_URI'], 'atom.php') !== false || strpos($_SERVER['REQUEST_URI'], 'rss.php') !== false || strpos($_SERVER['REQUEST_URI'], 'sitemap.php') !== false) {
        $down_for_maint_flag = false;
      }
    //-eof-20221023-lat9
    }

  5. #5
    Join Date
    Sep 2022
    Location
    Chennai
    Posts
    26
    Plugin Contributions
    0

    Default Re: Maintenance Mode: Allow Access to Specific Pages

    Quote Originally Posted by lat9 View Post
    For zc158, add the highlighted lines to /includes/init_includes/init_customer_auth.php (starting at line 37 for zc158) to enable those three scripts (presumably in the site's root directory) to be accessed by everyone even if maintenance-mode is active:
    Code:
    /**
     * check to see if site is DFM, and set a flag for use later
     */
    if (DOWN_FOR_MAINTENANCE == 'true') {
      if (!zen_is_whitelisted_admin_ip()){
        if ($_GET['main_page'] != DOWN_FOR_MAINTENANCE_FILENAME) $down_for_maint_flag = true;
      }
    //-bof-20221023-lat9-Enable **all** accesses to the root's atom.php, rss.php or sitemap.php to be accessed during maintenance-mode
      if (strpos($_SERVER['REQUEST_URI'], 'atom.php') !== false || strpos($_SERVER['REQUEST_URI'], 'rss.php') !== false || strpos($_SERVER['REQUEST_URI'], 'sitemap.php') !== false) {
        $down_for_maint_flag = false;
      }
    //-eof-20221023-lat9
    }
    This code is working. We appreciate your help in this regard.

    Thanks,

  6. #6
    Join Date
    Sep 2022
    Location
    Chennai
    Posts
    26
    Plugin Contributions
    0

    Default Re: Maintenance Mode: Allow Access to Specific Pages

    Your code is working. We appreciate your help in this regard.

    Thanks,

    Lakshmanan

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,475
    Plugin Contributions
    88

    Default Re: Maintenance Mode: Allow Access to Specific Pages

    Thanks for the feedback that the coding is working ... and welcome to the Zen Cart community!

 

 

Similar Threads

  1. v157 Stuck in maintenance mode !!!
    By split63 in forum General Questions
    Replies: 7
    Last Post: 15 Jan 2022, 08:15 PM
  2. v156 Stuck in Maintenance Mode
    By RixStix in forum Upgrading to 1.5.x
    Replies: 3
    Last Post: 9 Jan 2019, 04:46 AM
  3. using a new .htaccess file to allow specific access?
    By torvista in forum General Questions
    Replies: 2
    Last Post: 7 May 2010, 07:03 PM
  4. IP Address Allow in Maintenance:
    By rlexyd in forum General Questions
    Replies: 2
    Last Post: 21 Apr 2010, 02:18 AM
  5. Problem w/ Maintenance Mode
    By Crash44 in forum General Questions
    Replies: 2
    Last Post: 13 Feb 2010, 05:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR