Handle hostnames with upper-case letters
[webmin.git] / grub / edit_global.cgi
1 #!/usr/local/bin/perl
2 # edit_global.cgi
3 # Edit global GRUB options
4
5 require './grub-lib.pl';
6 &foreign_require("fdisk", "fdisk-lib.pl");
7 $conf = &get_menu_config();
8 &ui_print_header(undef, $text{'global_title'}, "");
9
10 print &ui_form_start("save_global.cgi");
11 print &ui_table_start($text{'global_header'}, "width=100%", 4);
12
13 # Default kernel to boot
14 $default = &find_value("default", $conf);
15 @titles = &find_value("title", $conf);
16 print &ui_table_row($text{'global_default'},
17         &ui_select("default", $default,
18                    [ [ '', $text{'global_first'} ],
19                      map { [ $_, $titles[$_] ] } (0..$#titles) ]));
20
21 # Fallback kernel
22 $fallback = &find_value("fallback", $conf);
23 print &ui_table_row($text{'global_fallback'},
24         &ui_select("fallback", $fallback,
25                    [ [ '', $text{'global_first'} ],
26                      map { [ $_, $titles[$_] ] } (0..$#titles) ]));
27
28 # Boot timeout
29 $timeout = &find_value("timeout", $conf);
30 print &ui_table_row($text{'global_timeout'},
31         &ui_opt_textbox("timeout", $timeout,  5, $text{'global_forever'}).
32         " ".$text{'global_secs'}, 3);
33
34 # Boot-time password
35 $password = &find("password", $conf);
36 @pv = split(/\s+/, $password->{'value'}) if ($password);
37 print &ui_table_row($text{'global_password'},
38         &ui_opt_textbox("password", $password, 30, $text{'global_none'})."<br>".
39         &ui_checkbox("password_file", 1, $text{'global_password_file'}, $pv[1]).
40         " ".&ui_textbox("password_filename", $pv[1], 30), 3);
41
42 # Partition to install on
43 $r = $config{'install'};
44 $dev = &bios_to_linux($r);
45 $sel = &foreign_call("fdisk", "partition_select", "install", $dev, 2, \$found);
46 print &ui_table_row($text{'global_install'},
47         &ui_radio("install_mode", $found ? 1 : 0,
48                   [ [ 1, $text{'global_sel'}." ".$sel."<br>" ],
49                     [ 0, $text{'global_other'}." ".
50                          &ui_textbox("other", $found ? "" : $r, 30) ] ]), 3);
51
52 print &ui_table_end();
53 print &ui_form_end([ [ undef, $text{'save'} ] ]);
54
55 &ui_print_footer("", $text{'index_return'});
56