mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-05-05 15:15:33 +02:00
Merge pull request #524 from getgrav/feature/show-account-page-for-login-acl
Show account page for users with admin.login ACL
This commit is contained in:
committed by
Andy Miller
parent
a8fd34c67d
commit
33e363affa
@@ -336,6 +336,11 @@ class Admin
|
||||
$obj = User::load(preg_replace('|users/|', '', $type));
|
||||
$obj->merge($post);
|
||||
|
||||
$data[$type] = $obj;
|
||||
} elseif (preg_match('|user/|', $type)) {
|
||||
$obj = User::load(preg_replace('|user/|', '', $type));
|
||||
$obj->merge($post);
|
||||
|
||||
$data[$type] = $obj;
|
||||
} elseif (preg_match('|config/|', $type)) {
|
||||
$type = preg_replace('|config/|', '', $type);
|
||||
|
||||
@@ -1580,14 +1580,16 @@ class AdminController
|
||||
*/
|
||||
public function taskContinue()
|
||||
{
|
||||
$data = (array) $this->data;
|
||||
|
||||
if ($this->view == 'users') {
|
||||
$this->setRedirect("{$this->view}/{$this->post['username']}");
|
||||
$this->setRedirect("{$this->view}/{$data['username']}");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->view == 'groups') {
|
||||
$this->setRedirect("{$this->view}/{$this->post['groupname']}");
|
||||
$this->setRedirect("{$this->view}/{$data['groupname']}");
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1596,7 +1598,6 @@ class AdminController
|
||||
return false;
|
||||
}
|
||||
|
||||
$data = (array) $this->data;
|
||||
$route = $data['route'] != '/' ? $data['route'] : '';
|
||||
$folder = ltrim($data['folder'], '_');
|
||||
if (!empty($data['modular'])) {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
title: Users
|
||||
title: User
|
||||
|
||||
access:
|
||||
admin.users: true
|
||||
admin.login: true
|
||||
admin.super: true
|
||||
---
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
{#{% if admin.authorize %}#}
|
||||
<div id="admin-user-details">
|
||||
<a href="{{ base_url_relative }}/users/{{ admin.user.username|e }}">
|
||||
<a href="{{ base_url_relative }}/user/{{ admin.user.username|e }}">
|
||||
<img src="https://www.gravatar.com/avatar/{{ admin.user.email|md5 }}?s=48" />
|
||||
|
||||
<div class="admin-user-names">
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
{% if admin.route %}
|
||||
{% set user = admin.data('users/' ~ admin.route) %}
|
||||
{% set title = "PLUGIN_ADMIN.USER"|tu ~ ": " ~ admin.route|e %}
|
||||
|
||||
{% else %}
|
||||
{% set title = "PLUGIN_ADMIN.USERS"|tu %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% block titlebar %}
|
||||
{% if not admin.route %}
|
||||
<div class="button-bar">
|
||||
Reference in New Issue
Block a user