Bug 119485 : Templatise editusers.cgi

Patch by Marc Schumann <wurblzap@gmail.com>   r=GavinS, mkanat  a=justdave
This commit is contained in:
travis%sedsystems.ca 2005-02-28 20:41:45 +00:00
parent 78730b5ca0
commit a599c8a816
19 changed files with 1824 additions and 821 deletions

View File

@ -86,6 +86,7 @@ sub _create {
'name' => '',
'login' => '',
'showmybugslink' => 0,
'disabledtext' => '',
'flags' => {},
};
bless ($self, $class);
@ -101,9 +102,11 @@ sub _create {
my ($id,
$login,
$name,
$disabledtext,
$mybugslink) = $dbh->selectrow_array(qq{SELECT userid,
login_name,
realname,
disabledtext,
mybugslink
FROM profiles
WHERE $cond},
@ -115,6 +118,7 @@ sub _create {
$self->{'id'} = $id;
$self->{'name'} = $name;
$self->{'login'} = $login;
$self->{'disabledtext'} = $disabledtext;
$self->{'showmybugslink'} = $mybugslink;
# Now update any old group information if needed
@ -951,12 +955,14 @@ sub get_userlist {
return $self->{'userlist'};
}
sub insert_new_user ($$) {
my ($username, $realname) = (@_);
sub insert_new_user ($$;$$) {
my ($username, $realname, $password, $disabledtext) = (@_);
my $dbh = Bugzilla->dbh;
# Generate a new random password for the user.
my $password = &::GenerateRandomPassword();
$disabledtext ||= '';
# If not specified, generate a new random password for the user.
$password ||= &::GenerateRandomPassword();
my $cryptpassword = bz_crypt($password);
# XXX - These should be moved into ValidateNewUser or CheckEmailSyntax
@ -966,10 +972,12 @@ sub insert_new_user ($$) {
# Insert the new user record into the database.
$dbh->do("INSERT INTO profiles
(login_name, realname, cryptpassword, emailflags)
VALUES (?, ?, ?, ?)",
(login_name, realname, cryptpassword, emailflags,
disabledtext)
VALUES (?, ?, ?, ?, ?)",
undef,
($username, $realname, $cryptpassword, DEFAULT_EMAIL_SETTINGS));
($username, $realname, $cryptpassword, DEFAULT_EMAIL_SETTINGS,
$disabledtext));
# Return the password to the calling code so it can be included
# in an email sent to the user.
@ -1039,7 +1047,7 @@ Bugzilla::User - Object for a Bugzilla user
my $user = new Bugzilla::User($id);
# Class Functions
$random_password = insert_new_user($username, $realname);
$password = insert_new_user($username, $realname, $password, $disabledtext);
=head1 DESCRIPTION
@ -1132,6 +1140,10 @@ linkinfooter - Whether or not the query should be displayed in the footer.
=back
=item C<disabledtext>
Returns the disable text of the user, if any.
=item C<flush_queries_cache>
Some code modifies the set of stored queries. Because C<Bugzilla::User> does
@ -1254,12 +1266,18 @@ called "statically," just like a normal procedural function.
=item C<insert_new_user>
Creates a new user in the database with a random password.
Creates a new user in the database.
Params: $username (scalar, string) - The login name for the new user.
$realname (scalar, string) - The full name for the new user.
$password (scalar, string) - Optional. The password for the new user;
if not given, a random password will be
generated.
$disabledtext (scalar, string) - Optional. The disable text for the new
user; if not given, it will be empty.
Returns: The password that we randomly generated for this user, in plain text.
Returns: The password for this user, in plain text, so it can be included
in an e-mail sent to the user.
=item C<is_available_username>

View File

@ -213,7 +213,7 @@ sub CheckEmailSyntax {
my ($addr) = (@_);
my $match = Param('emailregexp');
if ($addr !~ /$match/ || $addr =~ /[\\\(\)<>&,;:"\[\] \t\r\n]/) {
ThrowUserError("illegal_email_address", { addr => $addr });
ThrowUserError("illegal_email_address", { addr => $addr }, 'abort');
}
}

View File

@ -1061,10 +1061,12 @@ Reason: %reason%
{
name => 'allowuserdeletion',
desc => 'The pages to edit users can also let you delete a user. But there ' .
'is no code that goes and cleans up any references to that user in ' .
'other tables, so such deletions are kinda scary. So, you have to ' .
'turn on this option before any such deletions will ever happen.',
desc => 'The pages to edit users can also let you delete a user. ' .
'Bugzilla will issue a warning in case you\'d run into ' .
'inconsistencies when you\'re about to do so, ' .
'but such deletions remain kinda scary. ' .
'So, you have to turn on this option before any such deletions ' .
'will ever happen.',
type => 'b',
default => 0
},

File diff suppressed because it is too large Load Diff

View File

@ -613,11 +613,11 @@ sub ValidatePassword {
my ($password, $matchpassword) = @_;
if (length($password) < 3) {
ThrowUserError("password_too_short");
ThrowUserError("password_too_short", undef, 'abort');
} elsif (length($password) > 16) {
ThrowUserError("password_too_long");
ThrowUserError("password_too_long", undef, 'abort');
} elsif ((defined $matchpassword) && ($password ne $matchpassword)) {
ThrowUserError("passwords_dont_match");
ThrowUserError("passwords_dont_match", undef, 'abort');
}
}

View File

@ -0,0 +1,28 @@
/* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Bugzilla Bug Tracking System.
*
* Contributor(s): Marc Schumann <wurblzap@gmail.com>
*/
ul.warningmessages {
background-color: white;
border-style: solid;
border-width: 1px;
border-color: yellow;
padding: 1ex 1ex 1ex 4ex;
}
p.areyoureallyreallysure {
color: red;
font-size: 120%;
font-weight: bold;
}

View File

@ -0,0 +1,52 @@
/* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Bugzilla Bug Tracking System.
*
* Contributor(s): Marc Schumann <wurblzap@gmail.com>
*/
table.main {
border-spacing: 1em;
}
table.main tr {
vertical-align: top;
border-top: solid thin black;
}
table.main th {
text-align: right;
white-space: nowrap;
}
table.main th,
table.main td {
padding: 0;
}
table.main ul {
list-style-type: none;
padding-left: 0
}
table.groups {
border-spacing: 1px;
}
table.groups tr.indirect {
background-color: #cccccc;
}
table.groups th {
text-align: left;
padding: 0 0 0 1ex;
}
table.groups td {
padding: 2px;
}
table.groups td.checkbox {
text-align: center;
white-space: nowrap;
}

View File

@ -56,7 +56,7 @@
<p><b>One or more users belong to this group. You cannot delete
this group while there are users in it.</b>
<br><a href="editusers.cgi?action=list&group=[% gid FILTER html %]">Show
<br><a href="editusers.cgi?action=list&group=[% gid FILTER html %]&grouprestrict=1">Show
me which users</a> - <input type="checkbox" name="removeusers">Remove
all users from this group for me.</p>
[% END %]

View File

@ -0,0 +1,404 @@
[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# Contributor(s): Marc Schumann <wurblzap@gmail.com>
#%]
[%# INTERFACE:
#
# listselectionvalues: selection values to recreate the current user
# list.
# editusers: is viewing user member of editusers?
# editcomponents: is viewing user member of editcomponents?
# otheruser: Bugzilla::User object of the viewed user.
# groups: array of Group names the viewed user is a member
# of.
# product_responsibilities: list of hashes, one entry per Bugzilla component.
# productname: Name of the product.
# componentname: Name of the component.
# initialowner: User ID of initial owner.
# initialqacontact: User ID of initial QA contact.
# bugs: number of bugs the viewed user has a role in
# bug_activity: number of bugs the viewed user has activity
# entries on
# cc number of bugs the viewed user is cc list member
# of
# flags.requestee: number of flags the viewed user is being asked for
# flags.setter: number of flags the viewed user has set
# longdescs: number of bug comments the viewed user has written
# namedqueries: number of named queries the user has created
# profiles_activity: number of named queries the user has created
# series: number of series the viewed user has created
# votes: number of bugs the viewed user has voted on
# watch.watched: number of users the viewed user is being watched
# by
# watch.watcher: number of users the viewed user is watching
# whine_events: number of whine events the viewed user has created
# whine_schedules: number of whine schedules the viewed user has
# created
#%]
[% PROCESS global/header.html.tmpl
title = "Confirm deletion of user $otheruser.login"
style_urls = ['skins/standard/admin.css',
'skins/standard/editusers.css']
%]
[% PROCESS admin/users/listselectvars.html.tmpl
listselectionvalues = listselectionvalues
%]
[% responsibilityterms = {
'initialowner' => 'Initial Owner',
'initialqacontact' => 'Initial QA Contact'
}
%]
<table class="main">
<tr>
<th>Login name:</th>
<td>[% otheruser.login FILTER html %]</td>
</tr>
<tr>
<th>Real name:</th>
<td>[% otheruser.name FILTER html %]</td>
</tr>
<tr>
<th>Group set:</th>
<td>
[% IF groups.size %]
<ul>
[% FOREACH group = groups %]
<li>[% group.name FILTER html %]</li>
[% END %]
</ul>
[% ELSE %]
None
[% END %]
</td>
</tr>
[% IF product_responsibilities.size %]
<tr>
<th>Product responsibilities:</th>
<td>
<ul>
[% FOREACH component = product_responsibilities %]
<li>
[% andstring = '' %]
[% FOREACH responsibility = ['initialowner', 'initialqacontact'] %]
[% IF component.$responsibility == userid %]
[% andstring %] [% responsibilityterms.$responsibility %]
[% andstring = ' and ' %]
[% END %]
[% END %]
for
[% IF editcomponents %]
<a href="editcomponents.cgi?action=edit&amp;product=
[% component.productname FILTER url_quote %]&amp;component=
[% component.componentname FILTER url_quote %]">
[% END %]
[%+ component.productname FILTER html %]:
[% component.componentname FILTER html %]
[% IF editcomponents %]
</a>
[% END %]
</li>
[% END %]
</ul>
</td>
</tr>
[% END %]
</table>
[% IF product_responsibilities.size %]
<p>
You can't delete this user at this time because
[%+ otheruser.login FILTER html %] has got responsibilities for at least
one product.
</p>
<p>
[% IF editcomponents %]
Change this by clicking the product editing links above,
[% ELSE %]
For now, you can
[% END %]
[% ELSE %]
<h2>Confirmation</h2>
[% IF bugs || bug_activity || cc || flags.requestee || flags.setter ||
longdescs || namedqueries || profiles_activity || series || votes ||
watch.watched || watch.watcher || whine_events || whine_schedules %]
<ul class="warningmessages">
[% IF bugs %]
<li>
[% otheruser.login FILTER html %]
<a href="buglist.cgi?emailassigned_to1=1&amp;emailreporter1=1&amp;emailqa_contact1=1&amp;emailtype1=exact&amp;email1=[% otheruser.login FILTER url_quote %]">is
related to
[% IF bugs == 1 %]
[%+ terms.abug %]
[% ELSE %]
[%+ bugs %] [%+ terms.bugs %]
[% END %]</a>, by having reported, being assigned to or being
the QA contact.
If you delete the user account, the [% terms.bugs %] table in the
database will be inconsistent, resulting in
[% IF bugs == 1 %]
this [% terms.bug %]
[% ELSE %]
these [% terms.bugs %]
[% END %]
not appearing in [% terms.bug %] lists any more.
</li>
[% END %]
[% IF bugs_activity %]
<li>
[% otheruser.login FILTER html %] has made
[% IF bugs_activity == 1 %]
a change on [% terms.abug %]
[% ELSE %]
changes on [% terms.bugs %]
[% END %].
If you delete the user account, the [% terms.bugs %] activity table in
the database will be inconsistent, resulting in
[% IF bugs_activity == 1 %]
this change
[% ELSE %]
these changes
[% END %]
not showing up in [% terms.bug %] activity logs any more.
</li>
[% END %]
[% IF cc %]
<li>
[% otheruser.login FILTER html %]
<a href="buglist.cgi?emailcc1=1&amp;emailtype1=exact&amp;email1=[% otheruser.login FILTER url_quote %]">is
on the CC list of
[% IF cc == 1 %]
[%+ terms.abug %]
[% ELSE %]
[%+ cc %] [%+ terms.bugs %]
[% END %]</a>.
If you delete the user account, it will be removed from these CC
lists.
</li>
[% END %]
[% IF flags.requestee %]
<li>
[% otheruser.login FILTER html %] has been
<a href="buglist.cgi?field0-0-0=requestees.login_name&amp;type0-0-0=equals&amp;value0-0-0=[% otheruser.login FILTER url_quote %]">asked
to set
[% IF flags.requestee == 1 %]
a flag
[% ELSE %]
[% flags.requestee %] flags
[% END %]</a>.
If you delete the user account,
[% IF flags.requestee == 1 %]
this flag
[% ELSE %]
these flags
[% END %]
will change to be unspecifically requested.
</li>
[% END %]
[% IF flags.setter %]
<li>
[% otheruser.login FILTER html %] has
<a href="buglist.cgi?field0-0-0=setters.login_name&amp;type0-0-0=equals&amp;value0-0-0=[% otheruser.login FILTER url_quote %]">set
or requested
[% IF flags.setter == 1 %]
a flag
[% ELSE %]
[%+ flags.setter %] flags
[% END %]</a>.
If you delete the user account, the flags table in the database
will be inconsistent, resulting in
[% IF flags.setter == 1 %]
this flag
[% ELSE %]
these flags
[% END %]
not displaying correctly any more.
</li>
[% END %]
[% IF longdescs %]
<li>
[% otheruser.login FILTER html %] has
<a href="buglist.cgi?emaillongdesc1=1&amp;emailtype1=exact&amp;email1=[% otheruser.login FILTER url_quote %]">commented
[% IF longdescs == 1 %]
once on [% terms.abug %]
[% ELSE %]
[%+ longdescs %] times on [% terms.bugs %]
[% END %]</a>.
If you delete the user account, the comments table in the database
will be inconsistent, resulting in
[% IF longdescs == 1 %]
this comment
[% ELSE %]
these comments
[% END %]
not being visible any more.
</li>
[% END %]
[% IF namedqueries %]
<li>
[% otheruser.login FILTER html %]
has
[% IF namedqueries == 1 %]
a named query
[% ELSE %]
[%+ namedqueries %] named queries
[% END %].
[% IF namedqueries == 1 %]
This named query
[% ELSE %]
These named queries
[% END %]
will be deleted along with the user account.
</li>
[% END %]
[% IF profiles_activity %]
<li>
[% otheruser.login FILTER html %] has made
[% IF bugs_activity == 1 %]
a change on a other user's profile
[% ELSE %]
changes on other users' profiles
[% END %].
If you delete the user account, the user profiles activity table in
the database will be inconsistent.
</li>
[% END %]
[% IF series %]
<li>
[% otheruser.login FILTER html %] has created
[% IF series == 1 %]
a series
[% ELSE %]
[%+ series %] series
[% END %].
[% IF series == 1 %]
This series
[% ELSE %]
These series
[% END %]
will be deleted along with the user account.
</li>
[% END %]
[% IF votes %]
<li>
[% otheruser.login FILTER html %] has voted on
[% IF votes == 1 %]
[%+ terms.abug %]
[% ELSE %]
[%+ votes %] [%+ terms.bugs %]
[% END %].
If you delete the user account,
[% IF votes == 1 %]
this vote
[% ELSE %]
these votes
[% END %]
will be deleted along with the user account.
</li>
[% END %]
[% IF watch.watched || watch.watcher %]
<li>
[% otheruser.login FILTER html %]
[% IF watch.watched %]
is being watched by
[% IF watch.watched == 1 %]
a user
[% ELSE %]
[%+ watch.watched %] users
[% END %]
[% END %]
[% IF watch.watcher %]
[%+ 'and' IF watch.watched %]
watches
[% IF watch.watcher == 1 %]
a user
[% ELSE %]
[%+ watch.watcher %] users
[% END %]
[% END %].
[% IF watch.watched + watch.watcher == 1 %]
This watching
[% ELSE %]
These watchings
[% END %]
will cease along with the deletion of the user account.
</li>
[% END %]
[% IF whine_events || whine_schedules %]
<li>
[% otheruser.login FILTER html %]
[% IF whine_events %]
has scheduled
[% IF whine_events == 1 %]
a whine
[% ELSE %]
[%+ whine_events %] whines
[% END %]
[% END %]
[% IF whine_schedules %]
[%+ 'and' IF whine_events %]
is on the receiving end of
[% IF whine_schedules == 1 %]
a whine
[% ELSE %]
[%+ whine_schedules %] whines
[% END %]
[% END %].
[% IF whine_events + whine_schedules == 1 %]
This whine
[% ELSE %]
These whines
[% END %]
will be deleted along with the user account.
</li>
[% END %]
</ul>
<p class="areyoureallyreallysure">
Please be aware of the consequences of this before continuing.
</p>
[% END %]
<p>Do you really want to delete this user account?</p>
<form method="post" action="editusers.cgi">
<p>
<input type="submit" value="Yes, delete" />
<input type="hidden" name="action" value="delete" />
<input type="hidden" name="userid" value="[% otheruser.id %]" />
[% INCLUDE listselectionhiddenfields %]
</p>
</form>
<p>If you do not want to delete the user account at this time,
[% END %]
<a href="editusers.cgi?action=edit&amp;userid=[% otheruser.id %]
[% INCLUDE listselectionurlparams %]">edit the user</a>,
go
<a href="editusers.cgi?action=list[% INCLUDE listselectionurlparams %]">back
to the user list</a>,
[% IF editusers %]
<a href="editusers.cgi?action=add[% INCLUDE listselectionurlparams %]">add
a new user</a>,
[% END %]
or <a href="editusers.cgi">find other users</a>.
</p>
[% PROCESS global/footer.html.tmpl %]

View File

@ -0,0 +1,57 @@
[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# Contributor(s): Marc Schumann <wurblzap@gmail.com>
#%]
[%# INTERFACE:
#
# listselectionvalues: selection values to recreate the current user list.
# editusers: is viewing user member of editusers?
#%]
[% PROCESS global/header.html.tmpl
title = "Add user"
style_urls = ['skins/standard/editusers.css']
onload = "document.forms['f'].login.focus()"
%]
[% PROCESS admin/users/listselectvars.html.tmpl
listselectionvalues = listselectionvalues
%]
<form name="f" method="post" action="editusers.cgi">
<table class="main">
[% PROCESS admin/users/userdata.html.tmpl
editform = 0
editusers = editusers
otheruser = []
%]
</table>
<p>
<input type="submit" value="Add" />
<input type="hidden" name="action" value="new" />
[% INCLUDE listselectionhiddenfields %]
</p>
</form>
<p>
You can also <a href="editusers.cgi">find a user</a>
[% IF listselectionvalues %],
or
<a href="editusers.cgi?action=list[% INCLUDE listselectionurlparams %]">go
back to the user list</a>
[% END %].
</p>
[% PROCESS global/footer.html.tmpl %]

View File

@ -0,0 +1,154 @@
[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# Contributor(s): Marc Schumann <wurblzap@gmail.com>
#%]
[%# INTERFACE:
#
# message: message tag specifying a global/messages.html.tmpl
# message
# listselectionvalues: selection values to recreate the current user list.
# editusers: is viewing user member of editusers?
# otheruser: Bugzilla::User object of viewed user.
# groups: array of group information (name, grant type,
# canbless) for viewed user.
#%]
[% PROCESS global/header.html.tmpl
title = "Edit user $login"
message = message
style_urls = ['skins/standard/editusers.css']
%]
[% PROCESS admin/users/listselectvars.html.tmpl
listselectionvalues = listselectionvalues
%]
<form method="post" action="editusers.cgi">
<table class="main">
[% PROCESS admin/users/userdata.html.tmpl
editform = 1
editusers = editusers
otheruser = otheruser
%]
[% IF groups.size %]
<tr>
<th>Group access:</th>
<td>
<table class="groups">
<tr>
[% IF editusers %]
<th colspan="3">
Can turn these [% terms.bits %] on for other users
</th>
[% END %]
</tr>
<tr>
[% IF editusers %]
<td style="text-align: center; font-weight: bold">|</td>
[% END %]
<th colspan="2">User is a member of these groups</th>
</tr>
[% FOREACH group = groups %]
[% perms = permissions.${group.id} %]
<tr class="[% 'in' IF perms.regexpmember || perms.derivedmember %]direct">
[% IF editusers %]
<td class="checkbox">
[% '[' IF perms.indirectbless %]
[% %]<input type="checkbox"
name="bless_[% group.id %]"
value="1"
[% ' checked="checked"' IF perms.directbless %] />
[% ']' IF perms.indirectbless %]
[% %]<input type="hidden" name="oldbless_[% group.id %]"
value="[% perms.directbless %]" /></td>
[% END %]
<td class="checkbox">
[% '[' IF perms.derivedmember %]
[% '*' IF perms.regexpmember %]
[%%]<input type="checkbox"
id="group_[% group.id %]"
name="group_[% group.id %]"
value="1"
[% ' checked="checked"' IF perms.directmember %] />
[% '*' IF perms.regexpmember %]
[% ']' IF perms.derivedmember %]
[% %]<input type="hidden" name="oldgroup_[% group.id %]"
value="[% perms.directmember %]" /></td>
<td class="groupname">
<label for="group_[% group.id %]">
<strong>[% group.name FILTER html %]:</strong>
[%+ group.description FILTER html %]
</label>
</td>
</tr>
[% END %]
</table>
</td>
</tr>
[% END %]
</table>
<p>
<input type="submit" value="Update" />
<input type="hidden" name="userid" value="[% otheruser.id %]" />
<input type="hidden" name="action" value="update" />
[% INCLUDE listselectionhiddenfields %]
</p>
</form>
<p>
User is a member of any groups shown with a check or grey bar.
A grey bar indicates indirect membership, either derived from other
groups (marked with square brackets) or via regular expression
(marked with '*').
</p>
[% IF editusers %]
<p>
Square brackets around the bless checkbox indicate the ability
to bless users (grant them membership in the group) as a result
of membership in another group.
</p>
[% END %]
[% IF Param('allowuserdeletion') && editusers %]
<form method="post" action="editusers.cgi">
<p>
<input type="submit" value="Delete User" />
<input type="hidden" name="action" value="del" />
<input type="hidden" name="userid" value="[% otheruser.id %]" />
[% INCLUDE listselectionhiddenfields %]
</p>
</form>
[% END %]
<p>
You can also
[% IF editusers %]
<a href="editusers.cgi?action=add[% INCLUDE listselectionurlparams %]">add
a new user</a>
[% IF listselectionvalues %],
[% END %]
[% END %]
[% IF listselectionvalues %]
go
<a href="editusers.cgi?action=list[% INCLUDE listselectionurlparams %]">back
to the user list</a>,
[% END %]
[% IF editusers OR listselectionvalues %]
or
[% END %]
<a href="editusers.cgi">find other users</a>.
</p>
[% PROCESS global/footer.html.tmpl %]

View File

@ -0,0 +1,98 @@
[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# Contributor(s): Marc Schumann <wurblzap@gmail.com>
#%]
[%# INTERFACE:
#
# listselectionvalues: selection values to recreate the current user list.
# editusers: is viewing user member of editusers?
# users: list of user information (id, login_name, realname,
# disabledtext).
#%]
[% PROCESS global/header.html.tmpl
title = "Select user"
style_urls = ['skins/standard/editusers.css']
%]
[% PROCESS admin/users/listselectvars.html.tmpl
listselectionvalues = listselectionvalues
%]
[% listselectionurlparams = INCLUDE listselectionurlparams %]
[% columns =
[{name => 'login_name'
heading => 'Edit user...'
contentlink => 'editusers.cgi?action=edit&amp;userid=%%userid%%' _
listselectionurlparams
allow_html_content => 1
}
{name => 'realname'
heading => 'Real name'
allow_html_content => 1
}
]
%]
[% IF Param('allowuserdeletion') && editusers %]
[% columns.push({heading => 'Action'
content => 'Delete'
contentlink => 'editusers.cgi?action=del' _
'&amp;userid=%%userid%%' _
listselectionurlparams
}
)
%]
[% END %]
[% FOREACH thisuser = users %]
[%# We FILTER html here because we need admin/table.html.tmpl to accept HTML
# for styling, so we cannot let admin/table.html.tmpl do the FILTER.
#%]
[% thisuser.login_name = BLOCK %]
[% thisuser.login_name FILTER html %]
[% END %]
[% IF thisuser.realname %]
[% thisuser.realname = BLOCK %]
[% thisuser.realname FILTER html %]
[% END %]
[% ELSE %]
[% SET thisuser.realname = '<span style="color: red">missing</span>' %]
[% END %]
[% IF thisuser.disabledtext %]
[% thisuser.login_name = "<span class=\"bz_inactive\">$thisuser.login_name</span>" %]
[% thisuser.realname = "<span class=\"bz_inactive\">$thisuser.realname</span>" %]
[% END %]
[% END %]
<p>[% users.size %] user[% "s" UNLESS users.size == 1 %] found.</p>
[% PROCESS admin/table.html.tmpl
columns = columns
data = users
%]
<p>
If you do not wish to modify a user account at this time, you can
<a href="editusers.cgi">find other users</a>
[% IF editusers %]
or
<a href="editusers.cgi?action=add[% INCLUDE listselectionurlparams %]">add
a new user</a>
[% END %].
</p>
[% PROCESS global/footer.html.tmpl %]

View File

@ -0,0 +1,34 @@
[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# Contributor(s): Marc Schumann <wurblzap@gmail.com>
#%]
[%# INTERFACE:
#
# listselectionvalues: selection values to recreate the current user list.
#%]
[% BLOCK listselectionurlparams %]
[% FOREACH field = listselectionvalues.keys %]&amp;
[% field FILTER url_quote %]=
[% listselectionvalues.$field FILTER url_quote %]
[% END %]
[% END %]
[% BLOCK listselectionhiddenfields %]
[% FOREACH field = listselectionvalues.keys %]
<input type="hidden" name="[% field FILTER html %]"
value="[% listselectionvalues.$field FILTER html %]" />
[% END %]
[% END %]

View File

@ -0,0 +1,70 @@
[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# Contributor(s): Marc Schumann <wurblzap@gmail.com>
#%]
[%# INTERFACE:
#
# editusers: is viewing user member of editusers?
# restrictablegroups: list of groups visible to the user:
# id: group id
# name: group name
#%]
[% PROCESS global/header.html.tmpl
title = "Search users"
style_urls = ['skins/standard/editusers.css']
onload = "document.forms['f'].matchstr.focus()"
%]
[% PROCESS admin/users/listselectvars.html.tmpl
listselectionvalues = listselectionvalues
%]
<form name="f" method="get" action="editusers.cgi">
<input type="hidden" name="action" value="list" />
<p><label for="matchstr">List users with login name matching</label>
<input size="32" name="matchstr" id="matchstr" />
<select name="matchtype">
<option value="substr" selected="selected">case-insensitive substring</option>
<option value="regexp">case-insensitive regexp</option>
<option value="notregexp">not (case-insensitive regexp)</option>
</select>
<input type="submit" value="Search" /></p>
[% IF restrictablegroups.size %]
<p><input type="checkbox" name="grouprestrict" value="1" id="grouprestrict" />
<label for="grouprestrict">Restrict to users belonging to group</label>
<select name="groupid"
onchange="document.forms['f'].grouprestrict.checked=true">
[% FOREACH group = restrictablegroups %]
<option value="[% group.id FILTER html %]">[% group.name FILTER html %]</option>
[% END %]
</select></p>
[% END %]
</form>
[% IF editusers %]
<p>
You can also <a href="editusers.cgi?action=add">add a new user</a>
[%- IF listselectionvalues %],
or
<a href="editusers.cgi?action=list[% INCLUDE listselectionurlparams %]">show
the user list again</a>
[%- END %].
</p>
[% END %]
[% PROCESS global/footer.html.tmpl %]

View File

@ -0,0 +1,79 @@
[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# Contributor(s): Marc Schumann <wurblzap@gmail.com>
#%]
[%# INTERFACE:
#
# editform: is this an edit form? (It's a create form otherwise)
# editusers: is viewing user member of editusers?
# otheruser: Bugzilla::User object of user to edit
#%]
<tr>
<th><label for="login">Login name:</label></th>
<td>
[% IF editusers %]
<input size="64" maxlength="255" name="login"
id="login" value="[% otheruser.login FILTER html %]" />
[% IF editform %]
<input type="hidden" name="loginold"
value="[% otheruser.login FILTER html %]" />
[% END %]
[% ELSE %]
[% otheruser.login FILTER html %]
[% END %]
</td>
</tr>
<tr>
<th><label for="name">Real name:</label></th>
<td>
[% IF editusers %]
<input size="64" maxlength="255" name="name"
id="name" value="[% otheruser.name FILTER html %]" />
[% IF editform %]
<input type="hidden" name="nameold"
value="[% otheruser.name FILTER html %]" />
[% END %]
[% ELSE %]
[% otheruser.name FILTER html %]
[% END %]
</td>
</tr>
[% IF editusers %]
<tr>
<th><label for="password">Password:</label></th>
<td>
<input type="password" size="16" maxlength="16" name="password"
id="password" value="" />
[% IF editform %]<br />
(Enter new password to change.)
[% END %]
</td>
</tr>
<tr>
<th><label for="disabledtext">Disable text:</label></th>
<td>
<textarea name="disabledtext" rows="10"
id="disabledtext"
cols="60">[% otheruser.disabledtext FILTER html %]</textarea><br />
(If non-empty, then the account will be disabled, and this text should
explain why.)
[% IF editform %]
<input type="hidden" name="disabledtextold"
value="[% otheruser.disabledtext FILTER html %]" />
[% END %]
</td>
</tr>
[% END %]

View File

@ -581,6 +581,31 @@
'deleted_bug_count'
],
'admin/users/confirm-delete.html.tmpl' => [
'andstring',
'responsibilityterms.$responsibility',
'bugs',
'cc',
'flags.requestee',
'flags.setter',
'longdescs',
'namedqueries',
'votes',
'series',
'watch.watched',
'watch.watcher',
'whine_events',
'whine_schedules',
'otheruser.id'
],
'admin/users/edit.html.tmpl' => [
'otheruser.id',
'group.id',
'perms.directbless',
'perms.directmember',
],
'admin/components/edit.html.tmpl' => [
'bug_count'
],

View File

@ -185,7 +185,11 @@
[% ELSIF error == "invalid_keyword_id" %]
The keyword ID <em>[% id FILTER html %]</em> couldn't be
found.
[% ELSIF error == "invalid_user_id" %]
[% title = "Invalid User ID" %]
There is no user account with ID <em>[% userid FILTER html %]</em>.
[% ELSIF error == "missing_bug_id" %]
No [% terms.bug %] ID was given.

View File

@ -30,7 +30,77 @@
[% message_tag = message %]
[% message = BLOCK %]
[% IF message_tag == "buglist_adding_field" %]
[% IF message_tag == "account_created" %]
[% title = "User $otheruser.login created" %]
A new user account [% otheruser.login FILTER html %] has been created
successfully.
[% IF groups.size %]
You may want to edit the group settings now, using the form below.
[% END %]
[% ELSIF message_tag == "account_updated" %]
[% IF changed_fields.size
+ groups_added_to.size + groups_removed_from.size
+ groups_granted_rights_to_bless.size + groups_denied_rights_to_bless.size %]
[% title = "User $loginold updated" %]
The following changes have been made to the user account
[%+ loginold FILTER html %]:
<ul>
[% FOREACH field = changed_fields %]
<li>
[% IF field == 'login_name' %]
The login is now [% otheruser.login FILTER html %].
[% ELSIF field == 'realname' %]
The real name has been updated.
[% ELSIF field == 'cryptpassword' %]
A new password has been set.
[% ELSIF field == 'disabledtext' %]
The disable text has been modified.
[% END %]
</li>
[% END %]
[% IF groups_added_to.size %]
<li>
The account has been added to the
[%+ groups_added_to.join(', ') FILTER html %]
group[% 's' IF groups_added_to.size > 1 %].
</li>
[% END %]
[% IF groups_removed_from.size %]
<li>
The account has been removed from the
[%+ groups_removed_from.join(', ') FILTER html %]
group[% 's' IF groups_removed_from.size > 1 %].
</li>
[% END %]
[% IF groups_granted_rights_to_bless.size %]
<li>
The account has been granted rights to bless the
[%+ groups_granted_rights_to_bless.join(', ') FILTER html %]
group[% 's' IF groups_granted_rights_to_bless.size > 1 %].
</li>
[% END %]
[% IF groups_denied_rights_to_bless.size %]
<li>
The account has been denied rights to bless the
[%+ groups_denied_rights_to_bless.join(', ') FILTER html %]
group[% 's' IF groups_denied_rights_to_bless.size > 1 %].
</li>
[% END %]
</ul>
[% ELSE %]
[% title = "User $otheruser.login not changed" %]
You didn't request any change on the user account
[%+ otheruser.login FILTER html %].
[% END %]
[%# changed_fields.join(', ') %]
[% ELSIF message_tag == "account_deleted" %]
[% title = "User $otheruser.login deleted" %]
The user account [% otheruser.login FILTER html %] has been deleted
successfully.
[% ELSIF message_tag == "buglist_adding_field" %]
[% title = "Adding field to search page..." %]
[% link = "Click here if the page does not redisplay automatically." %]

View File

@ -108,6 +108,8 @@
[% IF group %] and [% END %]
[% IF reason == "cant_bless" %]
you don't have permissions to put people in or out of any group,
[% ELSIF reason == "not_visible" %]
there are visibility restrictions on certain user groups,
[% END %]
[% END %]
@ -146,6 +148,8 @@
products
[% ELSIF object == "reports" %]
whine reports
[% ELSIF object == "user" %]
the user you specified
[% ELSIF object == "users" %]
users
[% ELSIF object == "versions" %]
@ -1046,6 +1050,16 @@
[% title = "Deletion not activated" %]
Sorry, the deletion of user accounts is not allowed.
[% ELSIF error == "user_has_responsibility" %]
[% title = "Can't Delete User Account" %]
The user you want to delete is set up for roles as initial [% terms.bug %]
owner or QA contact for at least one component.
For this reason, you cannot delete the account at this time.
[% ELSIF error == "user_login_required" %]
[% title = "Login Name Required" %]
You must enter a login name for the new user.
[% ELSIF error == "votes_must_be_nonnegative" %]
[% title = "Votes Must Be Non-negative" %]
Only use non-negative numbers for your [% terms.bug %] votes.