Merge branch 'develop' into 1.9

This commit is contained in:
Andy Miller
2019-01-14 18:13:23 -07:00
4 changed files with 23 additions and 1 deletions

View File

@@ -929,6 +929,7 @@ class AdminPlugin extends Plugin
'admin.statistics' => 'boolean', 'admin.statistics' => 'boolean',
'admin.plugins' => 'boolean', 'admin.plugins' => 'boolean',
'admin.themes' => 'boolean', 'admin.themes' => 'boolean',
'admin.tools' => 'boolean',
'admin.users' => 'boolean', 'admin.users' => 'boolean',
]; ];
$admin->addPermissions($permissions); $admin->addPermissions($permissions);

View File

@@ -163,6 +163,18 @@ form:
label: Parents Levels label: Parents Levels
size: small size: small
help: The number of levels to show in parent select list help: The number of levels to show in parent select list
pages.show_modular:
type: toggle
label: Modular parents
hightlight: 1
default: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
help: Show modular pages in the parent select list
google_fonts: google_fonts:
type: toggle type: toggle

View File

@@ -372,6 +372,9 @@ class Admin
$ipKey = Uri::ip(); $ipKey = Uri::ip();
$redirect = $post['redirect'] ?? $this->base . $this->route; $redirect = $post['redirect'] ?? $this->base . $this->route;
// Pseudonymization of the IP
$ipKey = sha1($ipKey . $this->grav['config']->get('security.salt'));
// Check if the current IP has been used in failed login attempts. // Check if the current IP has been used in failed login attempts.
$attempts = count($rateLimiter->getAttempts($ipKey, 'ip')); $attempts = count($rateLimiter->getAttempts($ipKey, 'ip'));

View File

@@ -4,6 +4,7 @@
{% set last_page_route = admin.page.getLastPageRoute %} {% set last_page_route = admin.page.getLastPageRoute %}
{% set show_slug_val = true %} {% set show_slug_val = true %}
{% set show_fullpath_val = false %} {% set show_fullpath_val = false %}
{% set show_all_val = true %}
{% set show_parents = config.get('plugins.admin.pages.show_parents') %} {% set show_parents = config.get('plugins.admin.pages.show_parents') %}
{% if show_parents == 'folder' %} {% if show_parents == 'folder' %}
@@ -14,7 +15,12 @@
{% set limit_levels_val = config.get('plugins.admin.pages.parents_levels') %} {% set limit_levels_val = config.get('plugins.admin.pages.parents_levels') %}
{% set defaults = {show_root:true, show_all:true, show_slug:show_slug_val, show_fullpath:show_fullpath_val, default:last_page_route, limit_levels:limit_levels_val} %} {% set show_modular_val = config.get('plugins.admin.pages.show_modular') %}
{% if show_modular_val == false %}
{% set show_all_val = false %}
{% endif %}
{% set defaults = {show_root:true, show_all:show_all_val, show_modular:show_modular_val, show_slug:show_slug_val, show_fullpath:show_fullpath_val, default:last_page_route, limit_levels:limit_levels_val} %}
{% set field = field|merge(defaults) %} {% set field = field|merge(defaults) %}
{{ parent() }} {{ parent() }}
{% endblock %} {% endblock %}