RADIUS group attributes, #15017
[freeside.git] / httemplate / edit / process / radius_group.html
1 <& elements/process.html,
2   'table'       => 'radius_group',
3   'viewall_dir' => 'browse',
4   'process_o2m' => {
5     'table'   => 'radius_attr',
6     'fields'  => [ qw( attrtype attrname op value )],
7   },
8   'precheck_callback' => $precheck_callback,
9 &>
10 <%init>
11 die "access denied"
12   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
13
14 my $precheck_callback = sub {
15   my $cgi = shift;
16   my $param = $cgi->Vars;
17   # remove rows with a blank attrname and attrnum
18   foreach my $k (grep /^attrnum\d+$/, keys %$param) {
19     if ( !length($param->{$k}) and !length($param->{$k.'_attrname'}) ) {
20       delete $param->{$k.'_'.$_} foreach qw(attrtype attrname op value);
21       delete $param->{$k};
22     }
23   }
24   '';
25 };
26
27 </%init>