mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-26 07:46:31 +01:00
Fixed proxy/browser caching issues in admin pages
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
## mm/dd/2020
|
||||
|
||||
1. [](#bugfix)
|
||||
* Fixed issue that would force a page reload when failing to install/update a plugin or theme.
|
||||
* Fixed issue that would force a page reload when failing to install/update a plugin or theme
|
||||
* Fixed proxy/browser caching issues in admin pages
|
||||
|
||||
# v1.9.16
|
||||
## 09/01/2020
|
||||
|
||||
@@ -451,6 +451,8 @@ class AdminPlugin extends Plugin
|
||||
// Replace page service with admin.
|
||||
$this->grav['page'] = function () use ($self) {
|
||||
$page = new Page();
|
||||
|
||||
// Plugins may not have the correct Cache-Control header set, force no-store for the proxies.
|
||||
$page->expires(0);
|
||||
|
||||
if ($this->grav['user']->authorize('admin.login')) {
|
||||
@@ -467,6 +469,7 @@ class AdminPlugin extends Plugin
|
||||
if (file_exists(__DIR__ . "/pages/admin/{$self->template}.md")) {
|
||||
$page->init(new \SplFileInfo(__DIR__ . "/pages/admin/{$self->template}.md"));
|
||||
$page->slug(basename($self->template));
|
||||
|
||||
return $page;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Generic Ajax
|
||||
template: default
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.login: true
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Backup
|
||||
template: default
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.maintenance: true
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Cache
|
||||
template: default
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.cache: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Config
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.configuration: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Dashboard
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.login: true
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
---
|
||||
title: Access Denied
|
||||
expires: 0
|
||||
---
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ robots: noindex,nofollow
|
||||
template: error
|
||||
routable: false
|
||||
http_response_code: 404
|
||||
expires: 0
|
||||
---
|
||||
|
||||
Woops! Looks like this page doesn't exist.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: News Feed
|
||||
template: ajax
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.login: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Forgot password
|
||||
expires: 0
|
||||
|
||||
form:
|
||||
fields:
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: PHP Info
|
||||
template: config
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.settings: true
|
||||
admin.super: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Installer
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.install: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Admin Login
|
||||
expires: 0
|
||||
|
||||
forms:
|
||||
login:
|
||||
@@ -13,7 +14,7 @@ forms:
|
||||
autofocus: true
|
||||
validate:
|
||||
required: true
|
||||
|
||||
|
||||
password:
|
||||
type: password
|
||||
placeholder: PLUGIN_ADMIN.PASSWORD
|
||||
@@ -33,5 +34,5 @@ forms:
|
||||
type: text
|
||||
id: twofa-code
|
||||
autofocus: true
|
||||
placeholder: PLUGIN_ADMIN.2FA_CODE_INPUT
|
||||
placeholder: PLUGIN_ADMIN.2FA_CODE_INPUT
|
||||
---
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Media
|
||||
template: default
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.pages: true
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Notifications
|
||||
template: default
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.login: true
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Pages Filter
|
||||
template: default
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.pages: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Pages
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.pages: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Plugins
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.plugins: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Preview
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.pages: true
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
---
|
||||
expires: 0
|
||||
|
||||
form:
|
||||
fields:
|
||||
- name: username
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Reset password
|
||||
expires: 0
|
||||
|
||||
form:
|
||||
fields:
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Site Settings
|
||||
template: config
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.settings: true
|
||||
admin.super: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Statistics
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.statistics: true
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Configuration
|
||||
template: config
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.configuration: true
|
||||
admin.super: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Grav Themes
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.themes: true
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
---
|
||||
title: Grav Tools
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.login: true
|
||||
---
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Updates
|
||||
template: default
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.maintenance: true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: User
|
||||
expires: 0
|
||||
|
||||
access:
|
||||
admin.users: true
|
||||
|
||||
Reference in New Issue
Block a user