Skip to content

Commit

Permalink
Merge branch 'release/1.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Dec 10, 2018
2 parents 32d991e + 6c38274 commit d36dbe8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v1.3.2
## 12/10/2018

1. [](#bugfix)
* if `allow_login` is `false` don't allow a logged in user to skip maintenance page

# v1.3.1
## 02/17/2017

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Maintenance
version: 1.3.1
version: 1.3.2
description: Puts your grav site into a maintenance mode
icon: exclamation-triangle
author:
Expand Down
4 changes: 2 additions & 2 deletions languages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ en:

es:
PLUGIN_MAINTENANCE:
OFFLINE_MARKDOWN: "# Sitio offline\n## Por favor inténtalo mas tarde..."
OFFLINE_MARKDOWN: "# Sitio offline\n## Por favor, inténtalo más tarde..."
AUTHORIZED_ACCESS: "**Se requiere acceso autorizado**"
BLUEPRINTS:
STATUS: Estado del plugin
MODE: Modo mantenimiento
MODE_HELP: Activa o desactiva el modo mantenimiento, en todo el sitio
ALLOW_LOGIN: Permitir acceso
ALLOW_LOGIN_HELP: Si deseas proporcionar un formulario de inicio de sesión para que los usuarios autorizados puedan acceder al sitio
ACCESS: Accesso
ACCESS: Acceso
ACCESS_HELP: La cadena de autorización ACL que debe ser verdadera para que un usuario acceda al sitio
PAGE_ROUTE: Ruta de la página de mantenimiento
PAGE_ROUTE_HELP: La ruta de acceso a la página Grav personalizada que deseas utilizar para el mantenimiento
Expand Down
2 changes: 1 addition & 1 deletion maintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function onPagesInitialized(Event $event)

/** @var User $user */
$user = $this->grav['user'];
if ($user->authenticated && $user->authorize($config['login_access'] ?: 'site.login')) {
if ($config['allow_login'] && $user->authenticated && $user->authorize($config['login_access'] ?: 'site.login')) {
// User has been logged in and has permission to access the site when it is in maintenance mode.
return;
}
Expand Down
4 changes: 2 additions & 2 deletions templates/maintenance.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

{% block content %}

{{ 'PLUGIN_MAINTENANCE.OFFLINE_MARKDOWN'|t|markdown|raw }}
{{ page.content|default('PLUGIN_MAINTENANCE.OFFLINE_MARKDOWN'|t|markdown|raw) }}

{% if maintenance.allow_login and not grav.user.authenticated %}
<div id="maintenance-login" style="text-align: center;">
{% include 'partials/login-form.html.twig' with {content: 'PLUGIN_MAINTENANCE.AUTHORIZED_ACCESS'|t|markdown, show_login_form: true }%}
</div>
{% endif %}
{% endblock %}
{% endblock %}

0 comments on commit d36dbe8

Please sign in to comment.