719

Product support

Get help in the plugin support forum.

  • Added on Nov 1, 2018
  • Current version: 1.0.1
  • Platform Compatibility
    v3.x not tested
    v2.x not tested
    v1.x use latest
  • Created by

Categories

This plugin is an extension for the RainLab.User & the KurtJensen.Passage plugin. This extension adds the possibility to skip the maintenance page for frontend user by authentification.

Hint: This plugin does not have any settings or UI.

Requirements

This Plugin for OctoberCMS requires 2 Plugins:

This Plugin requires an active maintenance page:

  • For example: maintenace.html (Enable and select this page in Settings - Maintenance mode)

First off install the required plugins & setup a maintenance page, please. After you done this, you are able to install this plugin.

There are two ways to give frontend user access to skip the maintenance page:

Via Group

  1. Navigate in Backend to Users - User Groups
  2. Create a new group called Skip Maintenance (individual) with the Code skip-maintenance (important)
  3. Navigate in Backend to Users
  4. Select or create a new user
  5. Add this user to the Group Skip Maintenance
  6. Login with this user in the frontend

Via Passage Key

  1. Navigate in Backend to Users - Passage Keys
  2. Create a new passage key called skip-maintenance (important)
  3. Navigate in Backend to Users - User Variances
  4. Create a new variance
  5. Select a user you want to give access to skip the maintenance page, the passage key skip-maintenance, set the check on Grant and click create
  6. Login with this user in the frontend

Hint: This plugin does not have any settings or UI.

Example, Inspiration & Troubleshooting

Example

You see an example by using the account component by User Plugin below.

maintenance.htm

title = "Maintenance"
url = "/maintenance"
layout = "web"
is_hidden = 0

[account]
redirect = "home"
==
<div class="container">
    <h1>Maintenance</h1>
    <p class="text-muted">Currently we are installing system updates or just place new content to our website.<br />We ll be back soon.</p>
    <div class="well">
        {% if user %}
                <p><strong>Hello{% if user.name %} {{ user.name }}{% endif %}!</strong></p>
                <p>
                    {% if inGroup('skip-maintenance') or can('skip-maintenance') %}
                        <a href="{{ '/'|app }}">See website</a> |
                    {% endif %}
                    <a class="text-danger" data-request="onLogout" data-request-data="redirect: '/good-bye'">Sign out</a>
                </p>
        {% else %}
            {% component 'account' %}
        {% endif %}
    </div>
</div>

Working perfect with Code login

You could also use the Code login Plugin to give the users a better login experience.

maintenance.htm

title = "Maintenance"
url = "/maintenance"
layout = "web"
is_hidden = 0

[session]
[codeLogin]
redirect = "home"
visible = 0
button = "enter"
==
<div class="container">
    <h1>Maintenance</h1>
    <p class="text-muted">Currently we are installing system updates or just place new content to our website.<br />We ll be back soon.</p>
    <div class="well">
        {% if user %}
                <p><strong>Hello{% if user.name %} {{ user.name }}{% endif %}!</strong></p>
                <p>
                    {% if inGroup('skip-maintenance') or can('skip-maintenance') %}
                        <a href="{{ '/'|app }}">See website</a> |
                    {% endif %}
                    <a class="text-danger" data-request="onLogout" data-request-data="redirect: '/good-bye'">Sign out</a>
                </p>
        {% else %}
            {% component 'codeLogin' %}
        {% endif %}
    </div>
</div>

Cache troubleshooting

Issue: You are logged in and added the user to the group skip-maintenance or the user variance, but still see the maintenance page?

Fix: Try to clear the browser cache and OctoberCMS Cache via Clear file cache. Also check the URL you entered. If the url is f.e. "/maintenance" you will see the maintenance page even if you are logged in.

1.0.1

First version of Skip Maintenance

Nov 01, 2018