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:
Flavio Copes
2016-04-27 19:48:16 +02:00
committed by Andy Miller
parent a8fd34c67d
commit 33e363affa
5 changed files with 12 additions and 7 deletions

View File

@@ -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);

View File

@@ -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'])) {

View File

@@ -1,7 +1,8 @@
---
title: Users
title: User
access:
admin.users: true
admin.login: true
admin.super: true
---

View File

@@ -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">

View File

@@ -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">