From 58c4f6814461ee4e35f0cffbdd63d948df940d35 Mon Sep 17 00:00:00 2001 From: dklawren Date: Mon, 9 Apr 2018 23:17:44 -0400 Subject: Bug 1328900 - Create new group called 'disableusers' that can only edit the bugmail and disabledtext fields of a user --- template/en/default/admin/admin.html.tmpl | 2 +- template/en/default/admin/users/edit.html.tmpl | 73 +++++++++++----------- template/en/default/admin/users/list.html.tmpl | 15 ++--- template/en/default/admin/users/userdata.html.tmpl | 49 ++++++++------- template/en/default/global/header.html.tmpl | 2 +- .../en/default/global/site-navigation.html.tmpl | 20 +++--- template/en/default/global/user.html.tmpl | 2 +- 7 files changed, 85 insertions(+), 78 deletions(-) (limited to 'template') diff --git a/template/en/default/admin/admin.html.tmpl b/template/en/default/admin/admin.html.tmpl index 62a246ceb..09fe00835 100644 --- a/template/en/default/admin/admin.html.tmpl +++ b/template/en/default/admin/admin.html.tmpl @@ -56,7 +56,7 @@ You can also automate this check by running sanitycheck.pl from a cron job. A notification will be sent per email to the specified user if errors are detected. - [% class = (user.in_group('editusers') || user.can_bless) ? "" : "forbidden" %] + [% class = (user.in_group('editusers') || user.in_group('disableusers') || user.can_bless) ? "" : "forbidden" %]
Users
Create new user accounts or edit existing ones. You can also add and remove users from groups (also known as "user privileges").
diff --git a/template/en/default/admin/users/edit.html.tmpl b/template/en/default/admin/users/edit.html.tmpl index 4eb62e763..de9826800 100644 --- a/template/en/default/admin/users/edit.html.tmpl +++ b/template/en/default/admin/users/edit.html.tmpl @@ -68,9 +68,10 @@ $(function() {
[% PROCESS admin/users/userdata.html.tmpl - editform = 1 - editusers = editusers - otheruser = otheruser + editform = 1 + editusers = editusers + disableusers = disableusers + otheruser = otheruser %] [% IF groups.size %] @@ -125,43 +126,46 @@ $(function() { [% END %] - - - - - - [% IF otheruser.groups_owned.size %] + [% IF editusers %] - + + + + [% IF otheruser.groups_owned.size %] + + + + + [% END %] + + + + [% END %] - - - -
Product responsibilities: - [% IF otheruser.product_responsibilities.size %] - [% PROCESS admin/users/responsibilities.html.tmpl otheruser = otheruser %] - [% ELSE %] - none - [% END %] -
Groups Owned:Product responsibilities: - [% can_edit_groups = user.in_group('creategroups') %] - [% FOREACH group = otheruser.groups_owned %] - [% IF can_edit_groups %] - + [% IF otheruser.product_responsibilities.size %] + [% PROCESS admin/users/responsibilities.html.tmpl otheruser = otheruser %] + [% ELSE %] + none + [% END %] +
Groups Owned: + [% can_edit_groups = user.in_group('creategroups') %] + [% FOREACH group = otheruser.groups_owned %] + [% IF can_edit_groups %] + + [% END %] + [% group.name FILTER html %] + [% '' IF can_edit_groups %]
[% END %] - [% group.name FILTER html %] - [% '' IF can_edit_groups %]
+
Last Login: + [% IF otheruser.last_seen_date %] + [% otheruser.last_seen_date FILTER html %] + [% ELSE %] + never [% END %]
Last Login: - [% IF otheruser.last_seen_date %] - [% otheruser.last_seen_date FILTER html %] - [% ELSE %] - never - [% END %] -

@@ -171,11 +175,10 @@ $(function() { [% INCLUDE listselectionhiddenfields %] - [% IF editusers %], [% ELSE %] or [% END %] - View Account History - [% IF editusers %] or View Admin History diff --git a/template/en/default/admin/users/list.html.tmpl b/template/en/default/admin/users/list.html.tmpl index 3ebfc2970..db425b40d 100644 --- a/template/en/default/admin/users/list.html.tmpl +++ b/template/en/default/admin/users/list.html.tmpl @@ -45,23 +45,24 @@ {name => 'last_seen_date' heading => 'Last Login' } - {heading => 'Account History' - content => 'View' - contentlink => 'editusers.cgi?action=activity' _ - '&userid=%%userid%%' _ - listselectionurlparams - } ] %] [% IF editusers %] [% columns.push({ + heading => 'Account History' + content => 'View' + contentlink => 'editusers.cgi?action=activity' _ + '&userid=%%userid%%' _ + listselectionurlparams + } + { heading => 'Admin History' content => 'View' contentlink => 'editusers.cgi?action=admin_activity' _ '&userid=%%userid%%' _ listselectionurlparams - }) + }) %] [% END %] diff --git a/template/en/default/admin/users/userdata.html.tmpl b/template/en/default/admin/users/userdata.html.tmpl index 449a1b143..c4ab07010 100644 --- a/template/en/default/admin/users/userdata.html.tmpl +++ b/template/en/default/admin/users/userdata.html.tmpl @@ -54,7 +54,7 @@ - [% IF editusers %] + [% IF editusers || disableusers %] @@ -94,7 +94,9 @@ [% END %] +[% END %] +[% IF editusers || disableusers %] @@ -122,30 +124,31 @@ explain why.) - [% IF editform %] - - - - [% IF user.in_group('bz_can_disable_mfa') %] - [% IF otheruser.mfa %] - - [% ELSE %] - Disabled - [% END %] +[% END %] + +[% IF editform && editusers %] + + + + [% IF user.in_group('bz_can_disable_mfa') %] + [% IF otheruser.mfa %] + [% ELSE %] - [% otheruser.mfa ? "Enabled - " _ otheruser.mfa : "Disabled" FILTER html %] + Disabled [% END %] - - - [% END %] + [% ELSE %] + [% otheruser.mfa ? "Enabled - " _ otheruser.mfa : "Disabled" FILTER html %] + [% END %] + + [% END %] [% Hook.process('end') %] diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl index 1d304ad04..cf1c8b991 100644 --- a/template/en/default/global/header.html.tmpl +++ b/template/en/default/global/header.html.tmpl @@ -294,7 +294,7 @@

  • Reports
  • - [% IF user.in_group('tweakparams') || user.in_group('editusers') || user.can_bless + [% IF user.in_group('tweakparams') || user.in_group('editusers') || user.can_bless || user.in_group('disableusers') || (Param('useclassification') && user.in_group('editclassifications')) || user.in_group('editcomponents') || user.in_group('admin') || user.in_group('creategroups') || user.in_group('editkeywords') || user.in_group('bz_canusewhines') diff --git a/template/en/default/global/site-navigation.html.tmpl b/template/en/default/global/site-navigation.html.tmpl index 06b0eaa92..510875422 100644 --- a/template/en/default/global/site-navigation.html.tmpl +++ b/template/en/default/global/site-navigation.html.tmpl @@ -69,22 +69,22 @@ [% END %] [%# *** Bugzilla Administration Tools *** %] - [% IF user.login %] - [% '' IF user.in_group('tweakparams') %] - [% '' IF user.in_group('editusers') %] + [% '' IF user.in_group('editusers') || user.in_group('disableusers') %] [% '' IF user.in_group('editcomponents') || user.get_products_by_permission("editcomponents").size %] - [% '' IF user.in_group('editcomponents') %] - [% '' IF user.in_group('creategroups') %] - [% '' IF user.in_group('editkeywords') %] - [% '' IF user.in_group('bz_canusewhines') %] - [% '' IF user.in_group('editcomponents') %] - [% END %] + [% END %] [% END %] diff --git a/template/en/default/global/user.html.tmpl b/template/en/default/global/user.html.tmpl index caea27c46..876d12805 100644 --- a/template/en/default/global/user.html.tmpl +++ b/template/en/default/global/user.html.tmpl @@ -28,7 +28,7 @@ [% IF user.id %]