This repository has been archived by the owner on Sep 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathedit_atalk.cgi
78 lines (67 loc) · 2.56 KB
/
edit_atalk.cgi
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/perl
# Display a form for editing AppleTalk interface settings
# Netatalk Webmin Module
# Copyright (C) 2024 Daniel Markstedt <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
require 'netatalk-lib.pl';
&ReadParse();
my $page_title;
my @atalk;
if ($in{action} =~ /create/) {
$page_title = $text{'edit_atalk_new_title'};
}
elsif ($in{action} =~ /edit/) {
@atalk = getAtalkIfs();
$page_title = $text{'edit_atalk_title'};
}
else {
die("Unknown action type. Are you trying something naughty?");
}
&ui_print_header(undef, $page_title, "", "atalk", 1);
print &ui_form_start('save_atalk.cgi', 'POST');
print &ui_table_start($text{'edit_atalk_table_heading'}, 'width="100%"', 2);
print &ui_table_row($text{'edit_atalk_iface'},
&ui_textbox('atalk_iface', @atalk ? $atalk[$in{index}]{atalk_iface} : '', undef, undef, undef, 'required')
."<br /><a href=\"/net/list_ifcs.cgi\" target=\"_blank\">$text{'edit_atalk_iface_help'}</a>"
);
print &ui_table_row($text{'edit_atalk_addr'},
&ui_textbox('atalk_addr', @atalk ? $atalk[$in{index}]{atalk_addr} : '')
." ".$text{'edit_atalk_addr_help'}
);
print &ui_table_row($text{'edit_atalk_net'},
&ui_textbox('atalk_net', @atalk ? $atalk[$in{index}]{atalk_net} : '')
." ".$text{'edit_atalk_net_help'}
);
print &ui_table_row($text{'edit_atalk_routing'},
&ui_select('atalk_routing', @atalk ? $atalk[$in{index}]{atalk_routing} : '', [
[''],
['-route', $text{edit_atalk_routing_route}],
['-seed', $text{edit_atalk_routing_seed}],
['-dontroute', $text{edit_atalk_routing_dontroute}]
])
);
print &ui_table_row($text{'edit_atalk_phase'},
&ui_select('atalk_phase', @atalk ? $atalk[$in{index}]{atalk_phase} : '', [
[''],
['1'],
['2']
])
);
print &ui_table_row($text{'edit_atalk_zone'},
&ui_textbox('atalk_zone', @atalk ? $atalk[$in{index}]{atalk_zone} : '')
);
print &ui_table_end();
if ($in{action} =~ /edit/) {
print &ui_hidden('old_iface', $atalk[$in{index}]{atalk_iface});
}
print &ui_form_end([[undef, $text{'save_button_title'}]]);
&ui_print_footer("show_atalk.cgi", $text{'index_atalk'});