Handle hostnames with upper-case letters
[webmin.git] / net / edit_range.cgi
1 #!/usr/local/bin/perl
2 # edit_range.cgi
3 # Edit or create an IP range bootup interface
4
5 require './net-lib.pl';
6 $access{'ifcs'} == 2 || $access{'ifcs'} == 3 || &error($text{'ifcs_ecannot'});
7 &ReadParse();
8 if ($in{'new'}) {
9         &ui_print_header(undef, $text{'range_create'}, "");
10         }
11 else {
12         @boot = &boot_interfaces();
13         $b = $boot[$in{'idx'}];
14
15         if ($access{'ifcs'} == 3) {
16                 map { $can_interfaces{$_}++ } split(/\s+/, $access{'interfaces'});
17                 if (! $can_interfaces{$b->{'fullname'}}) {
18                         &error($text{'ifcs_ecannot_this'});
19                         }
20                 }
21         
22         &ui_print_header(undef, $text{'range_edit'}, "");
23         }
24
25 # Form start
26 print &ui_form_start("save_range.cgi");
27 print &ui_hidden("new", $in{'new'});
28 print &ui_hidden("idx", $in{'idx'});
29 print &ui_table_start($text{'range_header'}, undef, 2);
30
31 # OS-specific range input
32 &range_input($b);
33
34 # End and buttons
35 print &ui_table_end();
36 if ($in{'new'}) {
37         print &ui_form_end([ [ undef, $text{'create'} ],
38                              [ 'activate', $text{'bifc_capply'} ] ]);
39         }
40 else {
41         print &ui_form_end([
42                 !$always_apply_ifcs ? ( [ undef, $text{'save'} ] ) : ( ),
43                 defined(&apply_interface) ?
44                         ( [ 'activate', $text{'bifc_apply'} ] ) : ( ),
45                 defined(&unapply_interface) ?
46                         ( [ 'unapply', $text{'bifc_dapply'} ] ) : ( ),
47                 !$noos_support_delete_ifcs ?
48                         ( [ 'delete', $text{'delete'} ] ) : ( ),
49                 ]);
50         }
51
52 &ui_print_footer("list_ifcs.cgi?mode=boot", $text{'ifcs_return'});
53