Merge branch 'release/1.10.10'

This commit is contained in:
Andy Miller
2021-04-07 10:50:44 -06:00
7 changed files with 22 additions and 15 deletions

View File

@@ -1,3 +1,10 @@
# v1.10.10
## 04/07/2021
1. [](#bugfix)
* Fixed missing `admin-preset.css` in multisite environments
* Regression: Fixed broken 2FA form [#2109](https://github.com/getgrav/grav-plugin-admin/issues/2109)
# v1.10.9
## 04/06/2021

View File

@@ -34,7 +34,6 @@ use Grav\Plugin\Admin\Themes;
use Grav\Plugin\Admin\AdminController;
use Grav\Plugin\Admin\Twig\AdminTwigExtension;
use Grav\Plugin\Admin\WhiteLabel;
use Grav\Plugin\FlexObjects\FlexFormFactory;
use Grav\Plugin\Form\Form;
use Grav\Plugin\Form\Forms;
use Grav\Plugin\Login\Login;
@@ -684,10 +683,10 @@ class AdminPlugin extends Plugin
$twig->twig_vars['forms'] = $forms;
// preserve form validation
if (!isset($twig->twig_vars['form'])) {
if ($this->admin->form) {
$twig->twig_vars['form'] = $this->admin->form;
} elseif (isset($header->form)) {
if ($this->admin->form) {
$twig->twig_vars['form'] = $this->admin->form;
} elseif (!isset($twig->twig_vars['form'])) {
if (isset($header->form)) {
$twig->twig_vars['form'] = new Form($page);
} elseif (isset($header->forms)) {
$twig->twig_vars['form'] = new Form($page, null, reset($header->forms));

View File

@@ -1,7 +1,7 @@
name: Admin Panel
slug: admin
type: plugin
version: 1.10.9
version: 1.10.10
description: Adds an advanced administration panel to manage your site
icon: empire
author:

View File

@@ -250,21 +250,26 @@ class LoginController extends AdminController
return $this->createRedirectResponse('/');
}
$login = $this->getLogin();
$this->page = $this->createPage('login');
$this->form = $this->getForm('admin-login-twofa');
$this->form = $this->getForm('login-twofa');
try {
$this->checkNonce();
} catch (PageExpiredException $e) {
$this->setMessage($this->translate('PLUGIN_ADMIN.INVALID_SECURITY_TOKEN'), 'error');
return $this->createDisplayResponse();
// Failed 2FA nonce check, logout and redirect.
$login->logout(['admin' => true]);
$this->form->reset();
return $this->createRedirectResponse('/');
}
$post = $this->getPost();
$data = $post['data'] ?? [];
$login = $this->getLogin();
try {
$twoFa = $login->twoFactorAuth();
} catch (TwoFactorAuthException $e) {

View File

@@ -10,8 +10,6 @@
{% endblock %}
{% block form %}
{% set form = forms['login'] %}
{% for field_name,field in form.fields %}
{% if field.type %}
{% set field = field|merge({ name: field.name ?? field_name }) %}

View File

@@ -5,8 +5,6 @@
{% block form %}
{% set form = forms['login-twofa'] %}
{% for field_name, field in form.fields %}
{% if field.type %}
{% set field = field|merge({ name: field.name ?? field_name }) %}

View File

@@ -1,6 +1,6 @@
{% do assets.addCss(theme_url~'/css-compiled/nucleus.css', {priority: 20}) %}
{% do assets.addCss(theme_url~'/css-compiled/template.css', {priority: 20}) %}
{% do assets.addCss(base_url_frontend~'/assets/admin-preset.css', {priority: 5}) %}
{% do assets.addCss('asset://admin-preset.css', {priority: 5}) %}
{% do assets.addCss(theme_url~'/css-compiled/simple-fonts.css') %}
{% do assets.addCss(theme_url~'/css/fork-awesome.min.css') %}
{% do assets.addCss(theme_url~'/css/chartist.min.css') %}
@@ -13,4 +13,4 @@
{% endif %}
{% if language_codes.rtl(grav.user.language) %}
{% do assets.addCss(theme_url~'/css/rtl.css') %}
{% endif %}
{% endif %}