Skip Menu |

This queue is for tickets about the RTx-BecomeUser CPAN distribution.

Report information
The Basics
Id: 41251
Status: open
Priority: 0/
Queue: RTx-BecomeUser

People
Owner: Nobody in particular
Requestors: jpierce [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.0
Fixed in: (no value)



Subject: Select type of users
It would be nice if the module had the option to limit the types of users it listed, and defaulted to only privileged users... or had separate lists for privileged and non-privileged users.
@@ -52,7 +52,7 @@ Abort(loc('This feature is only available to system administrators')); } - my $users; + my($Pusers, $Uusers); if ( defined($ARGS{'UserName'}) ) { if (defined %session) { @@ -63,8 +63,12 @@ $session{'CurrentUser'}->Load($ARGS{'UserName'}); } else { - $users = RT::Users->new($RT::SystemUser); - $users->_DoSearch(); + $Pusers = RT::Users->new($RT::SystemUser); + $Pusers->LimitToPrivileged(); + $Pusers->_DoSearch(); + + $Uusers = RT::Users->new($RT::SystemUser); + $Uusers->_DoSearch(); } </%init> @@ -76,10 +80,10 @@ %if ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) { -<h2><&|/l&>Select User</&></h2> +<h2><&|/l&>Select Priveleged User</&></h2> <form name=BecomeUser action=BecomeUser.html> <select name="UserName" size="5"> -%while ( my $User = $users->Next ) { +%while ( my $User = $Pusers->Next ) { <option <% ($User->Id == $session{'CurrentUser'}->Id) ? "SELECTED" : ''%> %if ($ValueAttribute eq 'id') { value="<%$User->id%>" @@ -93,6 +97,22 @@ </form> +<h2><&|/l&>Select Unpriveleged User</&></h2> +<form name=BecomeUser action=BecomeUser.html> +<select name="UserName" size="5"> +%while ( my $User = $Uusers->Next ) { +<option <% ($User->Id == $session{'CurrentUser'}->Id) ? "SELECTED" : ''%> +%if ($ValueAttribute eq 'id') { + value="<%$User->id%>" +%} elsif ($ValueAttribute eq 'Name') { + value="<%$User->Name%>" +%} +><%$User->Name . " (" . $User->RealName . ")" %></option> +%} +</select> +<& /Elements/Submit, Label => loc("Become User")&> +</form> + %} else { Congratulations, you are now <% $session{'CurrentUser'}->Name %>. %}
From: stennie [...] cpan.org
On Wed Nov 26 16:29:05 2008, JPIERCE wrote: <br /> &gt; It would be nice if the module had the option to limit the types of <br /> &gt; users it listed, and defaulted to only privileged users... or had <br /> &gt; separate lists for privileged and non-privileged users. <br /> <br /> I added a patch on RT#41248 which also defaults to privileged users:<br /> &nbsp;http://rt.cpan.org/Public/Bug/Display.html?id=41248#txn-716099<br /> <br /> I don't see the obvious use case for testing with non-privileged users since they should all be seeing the same thing as if you logged out of RT? &nbsp;Also, most public RT instances are going to have an unwieldly list of non-privileged users.<br /> <br /> Cheers,<br /> Stephen<br type="_moz" />