summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
authormark <mark>2011-11-23 18:42:50 +0000
committermark <mark>2011-11-23 18:42:50 +0000
commitd838063ab25f047e88c3e5ae16f77fc4f3481ce9 (patch)
treee4f533d73a30b62522c4e50df9c142a10737e5d2 /httemplate/edit/process
parentd0008add75bbb6e2ec49e6d40f28965eac0bcfb6 (diff)
RADIUS group attributes, #15017
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r--httemplate/edit/process/radius_group.html23
1 files changed, 20 insertions, 3 deletions
diff --git a/httemplate/edit/process/radius_group.html b/httemplate/edit/process/radius_group.html
index 706813f..8846946 100644
--- a/httemplate/edit/process/radius_group.html
+++ b/httemplate/edit/process/radius_group.html
@@ -1,10 +1,27 @@
<& elements/process.html,
- 'table' => 'radius_group',
- 'viewall_dir' => 'browse',
+ 'table' => 'radius_group',
+ 'viewall_dir' => 'browse',
+ 'process_o2m' => {
+ 'table' => 'radius_attr',
+ 'fields' => [ qw( attrtype attrname op value )],
+ },
+ 'precheck_callback' => $precheck_callback,
&>
<%init>
-
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+my $precheck_callback = sub {
+ my $cgi = shift;
+ my $param = $cgi->Vars;
+ # remove rows with a blank attrname and attrnum
+ foreach my $k (grep /^attrnum\d+$/, keys %$param) {
+ if ( !length($param->{$k}) and !length($param->{$k.'_attrname'}) ) {
+ delete $param->{$k.'_'.$_} foreach qw(attrtype attrname op value);
+ delete $param->{$k};
+ }
+ }
+ '';
+};
+
</%init>