summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-radius_group.html
blob: eeaf5ac55c494e77f83d8e9cc8591eee35b483f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<SELECT MULTIPLE NAME = "<% $opt{'element_name'} || $opt{'field'} || 'usergroup' %>"
        <% $opt{'element_etc'} %>
>
% foreach my $selopt ( keys %groups ) {
%  my $selected = (grep{ $_ eq $selopt } @sel_groups) ? 'SELECTED' : '';
    <OPTION VALUE="<%$selopt%>" <% $selected %>><% $groups{$selopt} %></OPTION>
% }
</SELECT>
<%init>

my %opt = @_;

my %groups = map { $_->groupnum => $_->description . " (" . $_->groupname . ")" }
                                                    qsearch('radius_group', {});
my @sel_groups = split(/,/,$opt{'curr_value'});

</%init>