From f2a29007f96f33da77440cd10f475c2af946573e Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 23 Jan 2013 16:27:03 +0800 Subject: Bug 812433: create a report for auditing bugzilla security group membership --- .../en/default/hook/reports/menu-end.html.tmpl | 11 ++- .../en/default/pages/email_queue.html.tmpl | 2 +- .../en/default/pages/group_admins.html.tmpl | 2 +- .../en/default/pages/group_members.html.tmpl | 97 ++++++++++++++++++++++ .../en/default/pages/group_members.json.tmpl | 32 +++++++ .../en/default/pages/group_membership.html.tmpl | 2 +- .../en/default/pages/user_activity.html.tmpl | 2 +- 7 files changed, 140 insertions(+), 8 deletions(-) create mode 100644 extensions/BMO/template/en/default/pages/group_members.html.tmpl create mode 100644 extensions/BMO/template/en/default/pages/group_members.json.tmpl (limited to 'extensions/BMO/template/en') diff --git a/extensions/BMO/template/en/default/hook/reports/menu-end.html.tmpl b/extensions/BMO/template/en/default/hook/reports/menu-end.html.tmpl index dae7f9108..35644c1e4 100644 --- a/extensions/BMO/template/en/default/hook/reports/menu-end.html.tmpl +++ b/extensions/BMO/template/en/default/hook/reports/menu-end.html.tmpl @@ -24,19 +24,22 @@ Release Tracking Report - For triaging release-train flag information. - [% IF user.in_group('editusers') %] + [% IF user.in_group('editusers') || user.in_group('infrasec') %]
  • Group Admins - - Group Admins Report + - Lists the administrators of each group.
  • - [% END %] - [% IF user.in_group('editusers') || user.in_group('infrasec') %]
  • Group Membership Report - Lists the groups a user is a member of.
  • +
  • + + Group Members Report + - Lists the users of groups. +
  • [% END %] [% IF user.in_group('admin') || user.in_group('infra') %]
  • diff --git a/extensions/BMO/template/en/default/pages/email_queue.html.tmpl b/extensions/BMO/template/en/default/pages/email_queue.html.tmpl index 0e4a37551..5c7970506 100644 --- a/extensions/BMO/template/en/default/pages/email_queue.html.tmpl +++ b/extensions/BMO/template/en/default/pages/email_queue.html.tmpl @@ -15,7 +15,7 @@

    [% jobs.size FILTER none %] email(s) in the queue.

    - +
    diff --git a/extensions/BMO/template/en/default/pages/group_admins.html.tmpl b/extensions/BMO/template/en/default/pages/group_admins.html.tmpl index 1afcdb0b8..01bb744c4 100644 --- a/extensions/BMO/template/en/default/pages/group_admins.html.tmpl +++ b/extensions/BMO/template/en/default/pages/group_admins.html.tmpl @@ -25,7 +25,7 @@ %] [% IF groups.size > 0 %] -
    Insert Time Run Time
    +
    diff --git a/extensions/BMO/template/en/default/pages/group_members.html.tmpl b/extensions/BMO/template/en/default/pages/group_members.html.tmpl new file mode 100644 index 000000000..daf4d5b0d --- /dev/null +++ b/extensions/BMO/template/en/default/pages/group_members.html.tmpl @@ -0,0 +1,97 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% INCLUDE global/header.html.tmpl + title = "Group Members Report" + style_urls = [ "extensions/BMO/web/styles/reports.css" ] +%] + + + + +
    Name Admins
    + + + + +
    Group + + + + +
    + + +[% IF group != '' %] + +

    + Members of the [% group FILTER html %] group: +

    + + [% IF types.size > 0 %] + + + + + + + + + [% FOREACH type = types %] + [% count = loop.count() %] + + + + + + [% END %] +
    TypeCountMembersLast Seen (days ago)
    + [% "via " UNLESS type.name == 'direct' %] + [% type.name FILTER html %] + + [% type.members.size FILTER html %] + + + [% FOREACH member = type.members %] + + + + + [% END %] +
    + + + [% member.name FILTER html %] <[% member.email FILTER email FILTER html %]> + + + + [% member.lastseen FILTER html %] +
    +
    + + JSON + [% ELSE %] +

    + This group is empty. +

    + [% END %] + +[% END %] + +[% INCLUDE global/footer.html.tmpl %] diff --git a/extensions/BMO/template/en/default/pages/group_members.json.tmpl b/extensions/BMO/template/en/default/pages/group_members.json.tmpl new file mode 100644 index 000000000..f80fc8c5f --- /dev/null +++ b/extensions/BMO/template/en/default/pages/group_members.json.tmpl @@ -0,0 +1,32 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[ + [% SET count = 0 %] + [% FOREACH type = types %] + [% SET count = count + type.members.size %] + [% END %] + [% SET i = 0 %] + [% FOREACH type = types %] + [% FOREACH member = type.members %] + [% SET i = i + 1 %] + { "login": "[% member.login FILTER email FILTER js %]", + [% IF type.name == "direct" %] + "membership": "direct", + [% ELSE %] + "membership": "indirect", + "group": [% type.name FILTER js %]", + [% END %] + [% IF include_disabled %] + "disabled": "[% member.is_enabled ? "false" : "true" %]", + [% END %] + "lastseen": "[% member.lastseen FILTER js %]" + }[% "," UNLESS i == count %] + [% END %] + [% END %] +] diff --git a/extensions/BMO/template/en/default/pages/group_membership.html.tmpl b/extensions/BMO/template/en/default/pages/group_membership.html.tmpl index 2680c7da2..32484b13f 100644 --- a/extensions/BMO/template/en/default/pages/group_membership.html.tmpl +++ b/extensions/BMO/template/en/default/pages/group_membership.html.tmpl @@ -48,7 +48,7 @@ [% IF users.size %] - +
    [% FOREACH u = users %] diff --git a/extensions/BMO/template/en/default/pages/user_activity.html.tmpl b/extensions/BMO/template/en/default/pages/user_activity.html.tmpl index 377d7c244..f299b862b 100644 --- a/extensions/BMO/template/en/default/pages/user_activity.html.tmpl +++ b/extensions/BMO/template/en/default/pages/user_activity.html.tmpl @@ -106,7 +106,7 @@ [% IF operations.size > 0 %]
    -
    [% u.user.identity FILTER html %]
    +
    [% IF who_count > 1 %] -- cgit v1.2.3-24-g4f1b
    Who