Skip to content

Commit

Permalink
mod_admin_identity: Require module use rights to view user info data (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
robvandenbogaard committed Jan 4, 2023
1 parent 4a80150 commit d4a8e45
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion modules/mod_admin_identity/dispatch/admin_dispatch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%% -*- mode: erlang -*-
[
{admin_user, ["admin", "users"], controller_admin, [{template, "admin_users.tpl"}, {selected, "users"}, seo_noindex, ssl]},
{admin_user, ["admin", "users"], controller_admin, [{acl_module, mod_admin_identity}, {template, "admin_users.tpl"}, {selected, "users"}, seo_noindex, ssl]},

{identity_verify, ["identity", "verify", idn_id, verify_key], controller_template, [{template, "identity_verify.tpl"}, seo_noindex, ssl]}
].
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{% if m.acl.is_allowed.use.mod_admin_identity or id == m.acl.user %}
{% live template="_admin_identity_email.tpl" topic=["~site", "rsc", id, "identity"] id=id %}
{% endif %}
28 changes: 15 additions & 13 deletions modules/mod_admin_identity/templates/_admin_edit_sidebar.person.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,20 @@
</div>
{% endif %}

<div class="form-group">
<div class="alert alert-info">
{% with m.identity[id].user_info as user_info %}
{% if user_info.username %}
{_ Username _} <b>{{ user_info.username|escape }}</b>,
{_ last logon at _} {{ user_info.visited|date:_"Y-m-d H:i" }}.
{% elseif m.identity[id].is_user %}
{_ This person is also a user. _}
{% else %}
{_ This person is not yet a user. _}
{% endif %}
{% endwith %}
{% if m.acl.is_allowed.use.mod_admin_identity or id == m.acl.user %}
<div class="form-group">
<div class="alert alert-info">
{% with m.identity[id].user_info as user_info %}
{% if user_info.username %}
{_ Username _} <b>{{ user_info.username|escape }}</b>,
{_ last logon at _} {{ user_info.visited|date:_"Y-m-d H:i" }}.
{% elseif m.identity[id].is_user %}
{_ This person is also a user. _}
{% else %}
{_ This person is not yet a user. _}
{% endif %}
{% endwith %}
</div>
</div>
</div>
{% endif %}
{% endblock %}

0 comments on commit d4a8e45

Please sign in to comment.