Handle hostnames with upper-case letters
[webmin.git] / lilo / edit_other.cgi
1 #!/usr/local/bin/perl
2 # edit_other.cgi
3 # Edit or create a boot partition
4
5 require './lilo-lib.pl';
6 &foreign_require("fdisk", "fdisk-lib.pl");
7
8 &ReadParse();
9 if ($in{'new'}) {
10         &ui_print_header(undef, $text{'other_title1'}, "");
11         $members = [ ];
12         }
13 else {
14         &ui_print_header(undef, $text{'other_title2'}, "");
15         $conf = &get_lilo_conf();
16         $other = $conf->[$in{'idx'}];
17         $members = $other->{'members'};
18         }
19
20 print "<form action=save_other.cgi>\n";
21 print "<input type=hidden name=idx value='$in{'idx'}'>\n";
22 print "<input type=hidden name=new value='$in{'new'}'>\n";
23 print "<table border width=100%>\n";
24 print "<tr $tb> <td><b>$text{'other_details'}</b></td> </tr>\n";
25 print "<tr $cb> <td><table width=100%>\n";
26
27 print "<tr> <td><b>$text{'other_name'}</b></td>\n";
28 printf "<td valign=top><input name=label size=15 value='%s'></td>\n",
29         &find_value("label", $members);
30
31 print "<td><b>$text{'other_part'}</b></td> <td>\n";
32 print &foreign_call("fdisk", "partition_select", "other", $other->{'value'}, 0);
33 print "</td> </tr>\n";
34
35 $table = &find_value("table", $members);
36 print "<tr> <td><b>$text{'other_pass'}</b></td> <td colspan=3>\n";
37 printf "<input type=radio name=tablemode value=0 %s> $text{'no'}\n",
38         $table ? "" : "checked";
39 printf "<input type=radio name=tablemode value=1 %s> $text{'other_yes'}\n",
40         $table ? "checked" : "";
41 print &foreign_call("fdisk", "partition_select", "table", $table, 1);
42 print "</td> </tr>\n";
43
44 $password = &find_value("password", $members);
45 print "<tr> <td><b>$text{'other_password'}</b></td> <td colspan=3>\n";
46 printf "<input type=radio name=passmode value=0 %s> $text{'other_none'}\n",
47         $password ? "" : "checked";
48 printf "<input type=radio name=passmode value=1 %s>\n",
49         $password ? "checked" : "";
50 print "<input name=password size=25 value=\"$password\"></td> </tr>\n";
51
52 print "</table></td></tr></table>\n";
53
54 print "<table width=100%><tr>\n";
55 print "<td align=left><input type=submit value=\"$text{'save'}\"></td>\n";
56 if (!$in{'new'}) {
57         print "<td align=right>",
58               "<input type=submit name=delete value=\"$text{'delete'}\"></td>\n";
59         }
60 print "</tr></table></form>\n";
61
62 &ui_print_footer("", $text{'index_return'});
63