Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-53

Add "Maintenance Mode" option for Website

    Details

    • Type: Feature Request
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.0
    • Fix Version/s: 5.2.0-B1
    • Component/s: Front End
    • Labels:
      None
    • Additional information:
      Hide

      There have been some cases when original described functionality (above in description field) will NOT work as expected.

      For example when there is NO Database connection to the server which leads to NO way of getting/guess if it's a Maintenance mode or IP enabled or the way to show some message stored in DB itself.

      [B]1. Following variables will be added to top portion of DEBUG.PHP[/B] (after DBG_MAX_SQL_TIME):

      define('MAINTENANCE_MODE_FRONT', 0); // Set to 1 for SOFT Maintenance mode, set to 2 for HARD Maintenance mode (no DB load)
      define('MAINTENANCE_MODE_ADMIN', 0); // Set to 1 for SOFT Maintenance mode, set to 2 for HARD Maintenance mode (no DB load)
      define('MAINTENANCE_MODE_IPS', ''); // Define IP addresses/hosts, which will be able to continue accessing website

      There will be 2 separate settings - 1 for Front and 1 for Admin with single List of IPs to exclude from Maintenance. User can specify if he wants SOFT or HARD Maintenance mode enabled.

      [B][I]Soft Front[/I][/B] - all users (except excluded IPs/hosts) are logged out and auto-redirected (301 code) to the specified Front-end template (setting below)

      [B][I]Soft Admin[/I][/B] - all users (except excluded IPs/hosts) are logged out and auto-redirected (301 code) to the Admin Login page which will display the message (setting below) instead of the usual Login Form.

      [B][I]Hard Front / Admin[/I][/B] - all users (except excluded IPs/hosts) are logged out and auto-redirected (301 code) to Static page that was generateed from template (setting below) - http://www.yourwebsite.com/system/maintenance.php

      [B]NOTES:[/B]

      a. in case if there is NO DB Connection (Admin, Front, Cron) for ANY reason - user will be automatically redirected to http://www.yourwebsite.com/system/maintenance.php

      b. Auto-redirect to 404 page if Soft Maint. template is missing or not specified, but Soft Mode has been enabled.

      c. Still try redirecting to http://www.yourwebsite.com/system/maintenance.php even if page is missing.

      [B]2. Add 4 new Configuration variables under "Website Settings"[/B] (after Perform Exact Search):

      [B][I]MaintenanceMessageFront[/I][/B] (Maintenance Message for Front End) - textarea

      [I]hint:[/I] This message will be shown on Front End when either Soft or Hard Maintenance modes are enabled via debug.php file or there no Database connection.
      [I]default:[/I] Website is currently undergoing the upgrades. Please come back shortly! <br/><br/>Thank you for your patience.

      [B][I]MaintenanceMessageAdmin[/I][/B] (Maintenance Message for Admin) - textarea

      [I]hint:[/I] This message will be shown on Admin instead of Login form either when Soft or Hard Maintenance modes are enabled via debug.php file or there no Database connection.
      [I]default:[/I] Website is currently undergoing the upgrades. Please come back shortly! <br/><br/>Thank you for your patience.

      [B][I]SoftMaintenanceTemplate[/I][/B] (Template for Soft Maintenance) - input field

      [I]hint:[/I] This template will be shown to the Front End users when Soft Maintenance mode is active.
      [I]default:[/I] maintenance

      [B][I]HardMaintenanceTemplate[/I][/B] (Template for Hard Maintenance) - input field

      [I]hint:[/I] This template will be used to static HTML file under /system folder to be shown on Front-end or Admin when Hard Maintenance mode is active. Static page should be generated from specified here template by clicking "Generate" button.
      [I]default:[/I] maintenance
      [I]button:[/I] add "Generate Page" button next to the Input field with option to generate/regenerate the template. Don't perform generation if "HardMaintenanceTemplate" is empty or does NOT exists.

      [B]3. Add maintenance.tpl Template to Advanced and Default themes[/B]

      Using default CMS design and using Front End MaintenanceMessageFront setting. It would be great if we can add nofollow="1" Meta settings for this template in the Head portion of the page

      Show
      There have been some cases when original described functionality (above in description field) will NOT work as expected. For example when there is NO Database connection to the server which leads to NO way of getting/guess if it's a Maintenance mode or IP enabled or the way to show some message stored in DB itself. [B] 1. Following variables will be added to top portion of DEBUG.PHP [/B] (after DBG_MAX_SQL_TIME): define('MAINTENANCE_MODE_FRONT', 0); // Set to 1 for SOFT Maintenance mode, set to 2 for HARD Maintenance mode (no DB load) define('MAINTENANCE_MODE_ADMIN', 0); // Set to 1 for SOFT Maintenance mode, set to 2 for HARD Maintenance mode (no DB load) define('MAINTENANCE_MODE_IPS', ''); // Define IP addresses/hosts, which will be able to continue accessing website There will be 2 separate settings - 1 for Front and 1 for Admin with single List of IPs to exclude from Maintenance. User can specify if he wants SOFT or HARD Maintenance mode enabled. [B] [I] Soft Front [/I] [/B] - all users (except excluded IPs/hosts) are logged out and auto-redirected (301 code) to the specified Front-end template (setting below) [B] [I] Soft Admin [/I] [/B] - all users (except excluded IPs/hosts) are logged out and auto-redirected (301 code) to the Admin Login page which will display the message (setting below) instead of the usual Login Form. [B] [I] Hard Front / Admin [/I] [/B] - all users (except excluded IPs/hosts) are logged out and auto-redirected (301 code) to Static page that was generateed from template (setting below) - http://www.yourwebsite.com/system/maintenance.php [B] NOTES: [/B] a. in case if there is NO DB Connection (Admin, Front, Cron) for ANY reason - user will be automatically redirected to http://www.yourwebsite.com/system/maintenance.php b. Auto-redirect to 404 page if Soft Maint. template is missing or not specified, but Soft Mode has been enabled. c. Still try redirecting to http://www.yourwebsite.com/system/maintenance.php even if page is missing. [B] 2. Add 4 new Configuration variables under "Website Settings" [/B] (after Perform Exact Search): [B] [I] MaintenanceMessageFront [/I] [/B] (Maintenance Message for Front End) - textarea [I] hint: [/I] This message will be shown on Front End when either Soft or Hard Maintenance modes are enabled via debug.php file or there no Database connection. [I] default: [/I] Website is currently undergoing the upgrades. Please come back shortly! <br/><br/>Thank you for your patience. [B] [I] MaintenanceMessageAdmin [/I] [/B] (Maintenance Message for Admin) - textarea [I] hint: [/I] This message will be shown on Admin instead of Login form either when Soft or Hard Maintenance modes are enabled via debug.php file or there no Database connection. [I] default: [/I] Website is currently undergoing the upgrades. Please come back shortly! <br/><br/>Thank you for your patience. [B] [I] SoftMaintenanceTemplate [/I] [/B] (Template for Soft Maintenance) - input field [I] hint: [/I] This template will be shown to the Front End users when Soft Maintenance mode is active. [I] default: [/I] maintenance [B] [I] HardMaintenanceTemplate [/I] [/B] (Template for Hard Maintenance) - input field [I] hint: [/I] This template will be used to static HTML file under /system folder to be shown on Front-end or Admin when Hard Maintenance mode is active. Static page should be generated from specified here template by clicking "Generate" button. [I] default: [/I] maintenance [I] button: [/I] add "Generate Page" button next to the Input field with option to generate/regenerate the template. Don't perform generation if "HardMaintenanceTemplate" is empty or does NOT exists. [B] 3. Add maintenance.tpl Template to Advanced and Default themes [/B] Using default CMS design and using Front End MaintenanceMessageFront setting. It would be great if we can add nofollow="1" Meta settings for this template in the Head portion of the page
    • Change Log Message:
      Added "maintenance mode" for website
    • Story Points:
      3
    • External issue ID:
      65
    • Patch Instructions:

      Patches must be submitted through Phabricator.

      Description

      Add ability to put site in "Maintenance Mode". Useful, when site upgrade is made, when users could actually be browsing it (on both admin and front-end). Mode can be turned on by defining constant somewhere or by configuration variable.

      When mode is on, then all sessions will be automatically ended and when user's visit site or try to login, then warning about maintenance mode will be shown and that they are welcome to visit site later.

      Could actually specify IP of guy, who is performing maintenance so he could still perform login and browse site, but other users may not.

      General Rules in "Maintenance Mode":

      I. ENABLING "Maintenance Mode"
      ==============================
      1. NEW "Maintenance Mode" section under Admin->Configuration->Advanced.

      Will have options:

      a. Enable Maintenance Mode (check-box)
      b. EXCEPTIONS (textarea, IPs separated with semi-column
      c. TEMPLATE (input, to be shown on Front End, ie. no_permission)
      d. SYSTEM message (textarea, to be displayed on Admin Login screen)

      II Front End:
      =============
      1. END all Existing Sessions and LOGOUT users.

      2. REDIRECT all New and Existing Users to "maintenance_template" (new TPL to be added under platform).

      3. EXCEPTIONS are IPs specified in Admin Config settings (see above)

      III Admin:
      ==========
      1. END all Existing Sessions and LOGOUT users.

      2. SHOW message on Login screen stating that site is in "Maintenance Mode" and display System Message (defined via Site Configuration in Admin)

      3. EXCEPTIONS are IPs specified in Admin Config settings (see above)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: