Closed
Bug 730794
Opened 13 years ago
Closed 13 years ago
Need new hook edituser page
Categories
(Bugzilla :: Administration, task)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.2
People
(Reporter: fdonalisio, Assigned: fdonalisio)
Details
Attachments
(1 file, 2 obsolete files)
2.03 KB,
patch
|
dkl
:
review+
|
Details | Diff | Splinter Review |
A new hook in the edituser admin page, would allow new actions for the administrator in the page.
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #600889 -
Flags: review?(dkl)
Comment 2•13 years ago
|
||
Comment on attachment 600889 [details] [diff] [review]
Creates the new hook
Review of attachment 600889 [details] [diff] [review]:
-----------------------------------------------------------------
Rename hook to admin_editusers_action to further describe that the hook is for and to put all admin related hooks in it's
own admin_* namespace. Plus using user_ makes it seem like it should be in User.pm. Also use _action instead of _actions.
Thanks for the patch!
::: Bugzilla/Hook.pm
@@ +1341,5 @@
>
> +=head2 user_actions
> +
> +This hook allows you to add additional actions the admin Users page,
> +See the C<Example> extension to see how
This hook allows you to to add additional actions to the editusers.cgi admin page.
@@ +1342,5 @@
> +=head2 user_actions
> +
> +This hook allows you to add additional actions the admin Users page,
> +See the C<Example> extension to see how
> +things work.
No need to mention the Example extension as it is mentioned in the top of the perldocs that the Example extension has example code for all hooks.
::: editusers.cgi
@@ +55,5 @@
> + { 'vars' => $vars,
> + 'user' => $user,
> + 'action' => $action
> + }
> +);
Nit:
Bugzilla::Hook::process('admin_editusers_action',
{ vars => $vars, user => $user, action => $action });
Attachment #600889 -
Flags: review?(dkl) → review-
Assignee | ||
Comment 3•13 years ago
|
||
Assignee: administration → francsd
Attachment #600889 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #603361 -
Flags: review?(dkl)
Comment 4•13 years ago
|
||
Comment on attachment 603361 [details] [diff] [review]
Creates the new hook
Review of attachment 603361 [details] [diff] [review]:
-----------------------------------------------------------------
Looks better but a few more small changes.
::: Bugzilla/Hook.pm
@@ +1368,5 @@
> +It will be passed to the template.
> +
> +=item C<action>
> +
> +A text which indicates the different behaviors that edit_users.cgi will have.
s/edit_users/editusers/
::: extensions/Example/Extension.pm
@@ +811,5 @@
> + my ($self, $args) = @_;
> + my ($vars, $action, $user) = @$args{qw(vars action user)};
> + my $template = Bugzilla->template;
> +
> + if ($action eq 'search') {
After looking at this some more, let's come up with some different example code for this hook. Something that would be harmless if the admin mistakenly enabled the Example extension. Right now if they did enable, this would replace some actual functionality in editusers.cgi and they may not get what they expect or later or upstream changes editusers.cgi in some way which would be masked by this extension.
@@ +816,5 @@
> + # Allow to restrict the search to any group the user is allowed to bless.
> + $vars->{'restrictablegroups'} = $user->bless_groups();
> + $template->process('admin/users/search.html.tmpl', $vars)
> + || ThrowTemplateError($template->error());
> + exit;
Fix indention of exit;
Attachment #603361 -
Flags: review?(dkl) → review-
Assignee | ||
Comment 5•13 years ago
|
||
Attachment #603361 -
Attachment is obsolete: true
Attachment #604013 -
Flags: review?(dkl)
Comment 6•13 years ago
|
||
Comment on attachment 604013 [details] [diff] [review]
Creates the new hook
Review of attachment 604013 [details] [diff] [review]:
-----------------------------------------------------------------
Everything looks fine to me. The documentation change can be made at checkin.
dkl
::: Bugzilla/Hook.pm
@@ +1368,5 @@
> +It will be passed to the template.
> +
> +=item C<action>
> +
> +A text which indicates the different behaviors that edit_users.cgi will have.
Replace edit_users.cgi with editusers.cgi.
Attachment #604013 -
Flags: review?(dkl) → review+
Updated•13 years ago
|
Flags: approval?
Flags: approval4.2?
Comment 7•13 years ago
|
||
Comment on attachment 604013 [details] [diff] [review]
Creates the new hook
>=== modified file 'Bugzilla/Hook.pm'
>+This hook allows you to add additional actions to the admin Users page,
The sentence must end with a period, not a comma.
Updated•13 years ago
|
Flags: approval?
Flags: approval4.2?
Flags: approval4.2+
Flags: approval+
Target Milestone: --- → Bugzilla 4.2
Comment 8•13 years ago
|
||
Thanks for the work. Checking in.
trunk:
Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bugzilla/trunk
modified extensions/Example/Extension.pm
modified editusers.cgi
modified Bugzilla/Hook.pm
Committed revision 8151.
4.2:
Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bugzilla/4.2
modified extensions/Example/Extension.pm
modified editusers.cgi
modified Bugzilla/Hook.pm
Committed revision 8048.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•