1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<& elements/edit.html,
'name_singular' => 'RADIUS client',
'table' => 'nas',
'viewall_dir' => 'browse',
'labels' => { 'nasnum' => 'NAS',
'nasname' => 'Hostname',
'shortname' => 'Short name',
'secret' => 'Shared secret',
'type' => 'Type',
'ports' => 'Ports',
'server' => 'Virtual server',
'community' => 'Community',
'description' => 'Description',
},
'fields' => [
{ field=> 'nasname', required=>1, size=>40, maxlength=>128 },
{ field=>'shortname', size=>16, maxlength=>32 },
{ field=>'secret', size=>40, maxlength=>60, required=>1 },
{ field=>'type', type=>'select',
options=>[qw( cisco computone livingston max40xx multitech netserver
pathras patton portslave tc usrhiper other )],
},
{ field=>'ports', size=>5 },
{ field=>'server', size=>40, maxlength=>64 },
{ field=>'community', size=>40, maxlength=>50 },
{ field=>'description', size=>100, maxlength=>200 },
],
'html_bottom' => \&html_bottom,
'new_hashref_callback' => sub { +{ 'type' => 'other',
'secret' => 'secret',
'description' => 'RADIUS Client',
};
},
&>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
sub html_bottom {
my $nas = shift;
'<font color="#ff0000">*</font> '.
emt('required fields'). '<BR><BR>'.
'<FONT SIZE="+1"><B>'.emt('Export to these RADIUS servers:').
'</B></FONT><BR>'.
include('/elements/checkboxes-table.html',
'source_obj' => $nas,
'link_table' => 'export_nas',
'target_table' => 'part_export',
'hashref' => { 'exporttype' =>
{ op => 'LIKE', value => '%sqlradius%' }
},
'name_callback' => sub { $_[0]->label },
'default' => 'yes',
'target_link' => $p.'edit/part_export.cgi?',
'disable-able' => 1,
)
}
</%init>
|