Getting there. A nuance of mason: It’s one namespace for all mason
pages. So sub definitions are…not what you want. An anon sub is
better.
Ah. I did it with a foreach instead. It seemed less clunky that creating then
calling an anonymous sub.
I’d also put the label on the optgroup inside <%loc(“”)%> so that it
gets localized.
Is that the same as <&|/l&> ?
If so, the appended should do it.
Nicholas Clark
— html/Admin/Elements/SelectNewGroupMembers~ Mon Jun 19 22:44:04 2006
+++ html/Admin/Elements/SelectNewGroupMembers Thu May 17 08:47:18 2007
@@ -46,7 +46,13 @@
% if ($Show ne ‘Groups’) {
<&|/l&>Users</&>
-%while (my $user = $users->Next) {
+
+%while (my $user = $p_users->Next) {
+%next if $SkipUsers->{$user->id};
+<%$user->Name%>
+%}
+
+%while (my $user = $u_users->Next) {
%next if $SkipUsers->{$user->id};
<%$user->Name%>
%}
@@ -64,21 +70,30 @@
% }
<%INIT>
-my $users = new RT::Users($session{‘CurrentUser’});
-$users->Limit(
+# It’s one namespace for all mason pages, so the “logical” way of doing this,
+# a subroutine definition, is not the best way. Hence the foreach to initialize
+my ($p_users, $u_users);
+foreach my $users ($p_users, $u_users) {
- $users = new RT::Users($session{‘CurrentUser’});
- $users->Limit(
FIELD => ‘id’,
VALUE => $RT::SystemUser->id,
OPERATOR => ‘!=’,
ENTRYAGGREGATOR => ‘AND’
-);
-$users->Limit(
- );
- $users->Limit(
FIELD => ‘id’,
VALUE => $RT::Nobody->id,
OPERATOR => ‘!=’,
ENTRYAGGREGATOR => ‘AND’
-);
-$users->LimitToPrivileged();
- );
+}
+$p_users->LimitToPrivileged();
+$u_users->LimitToUnprivileged();
my $groups = new RT::Groups($session{‘CurrentUser’});
— lib/RT/Users_Overlay.pm~ Tue Sep 26 15:06:31 2006
+++ lib/RT/Users_Overlay.pm Thu May 17 08:54:06 2007
@@ -226,6 +226,27 @@
}}}
+# {{{ LimitToUnprivileged
+=head2 LimitToUnprivileged
+Limits to users who can not be made members of ACLs and groups
+=cut
+sub LimitToUnprivileged {
{{{ WhoHaveRight
=head2 WhoHaveRight { Right => ‘name’, Object => $rt_object , IncludeSuperusers => undef, IncludeSubgroupMembers => undef, IncludeSystemRights => undef, EquivObjects => }