@@ -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 %>.
%}