2 'name' => 'RADIUS Group',
3 'table' => 'radius_group',
6 'groupname' => 'RADIUS Group',
7 'description' => 'Description',
8 'attrnum' => 'Attribute',
9 'priority' => 'Priority',
10 'speed_down' => 'Download speed',
11 'speed_up' => 'Upload speed',
13 'viewall_dir' => 'browse',
14 'menubar' => \@menubar,
15 'edit_callback' => $edit_callback,
16 'error_callback' => $edit_callback,
18 { 'field' => 'groupname',
21 'colspan' => 6, # just to not interfere with radius_attr columns
23 { 'field' => 'description',
28 { 'field' => 'priority',
31 'colspan' => 6, # just to not interfere with radius_attr columns
33 { 'field' => 'speed_down',
38 { 'field' => 'speed_up',
45 'type' => 'radius_attr',
46 'o2m_table' => 'radius_attr',
47 'm2_label' => 'Attribute',
48 'm2_error_callback' => $m2_error_callback,
56 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
58 my @menubar = ('View all RADIUS Groups' => $p.'browse/radius_group.html');
60 my $edit_callback = sub {
61 my ($cgi, $object) = @_;
62 if ( $object->groupnum ) {
63 my $link = $p.'misc/delete-radius_group.html?'.$object->groupnum;
64 push @menubar, 'Delete this Group', $link;
68 my $m2_error_callback = sub { # reconstruct the list
69 my ($cgi, $object) = @_;
71 my @fields = qw(attrname attrtype op value);
74 next if !length($cgi->param($k.'_attrname'));
76 'groupnum' => $object->groupnum,
77 'attrnum' => scalar( $cgi->param($k) ),
78 map { $_ => scalar( $cgi->param($k.'_'.$_) ) } @fields,
80 } grep /^attrnum\d+$/, ($cgi->param);