Handle hostnames with upper-case letters
[webmin.git] / samba / edit_popts.cgi
1 #!/usr/local/bin/perl
2 # edit_popts.cgi
3 # Edit print-share specific options
4
5 require './samba-lib.pl';
6 &ReadParse();
7 # check acls
8
9 &error_setup("<blink><font color=red>$text{'eacl_aviol'}</font></blink>");
10 &error("$text{'eacl_np'} $text{'eacl_pvpopt'}")
11         unless &can('ro', \%access, $in{'share'});
12 # display
13 $s = $in{'share'};
14 if ($s eq "global") {
15         &ui_print_header(undef, $text{'print_title1'}, "");
16         }
17 else {
18         &ui_print_header(undef, $text{'print_title2'}, "");
19         }
20 &get_share($s);
21
22 print "<form action=save_popts.cgi>\n";
23 print "<input type=hidden name=old_name value=\"$s\">\n";
24
25 # Printer options
26 print "<table border width=100%>\n";
27 print "<tr $tb> <td><b>$text{'print_option'}</b></td> </tr>\n";
28 print "<tr $cb> <td><table>\n";
29
30 print "<tr> <td><b>$text{'print_minspace'}</b></td>\n";
31 printf "<td><input name=min_print_space size=5 value=\"%d\"></td>\n",
32         &getval("min print space");
33
34 print "<td><b>$text{'print_postscript'}</b></td>\n";
35 print "<td>",&yesno_input("postscript"),"</td> </tr>\n";
36
37 print "<tr> <td><b>$text{'print_command'}</b></td>\n";
38 printf "<td colspan=3>\n";
39 printf "<input type=radio name=print_command_def value=1 %s> $text{'default'}\n",
40         &getval("print command") eq "" ? "checked" : "";
41 printf "&nbsp;&nbsp;<input type=radio name=print_command_def value=0 %s>\n",
42         &getval("print command") ne "" ? "checked" : "";
43 printf "<input name=print_command size=30 value=\"%s\"></td> </tr>\n",
44         &getval("print command");
45
46 print "<tr> <td><b>$text{'print_queue'}</b></td>\n";
47 printf "<td colspan=3>\n";
48 printf "<input type=radio name=lpq_command_def value=1 %s> $text{'default'}\n",
49         &getval("lpq command") eq "" ? "checked" : "";
50 printf "&nbsp;&nbsp;<input type=radio name=lpq_command_def value=0 %s>\n",
51         &getval("lpq command") ne "" ? "checked" : "";
52 printf "<input name=lpq_command size=30 value=\"%s\"></td> </tr>\n",
53         &getval("lpq command");
54
55 print "<tr> <td><b>$text{'print_delete'}</b></td>\n";
56 printf "<td colspan=3>\n";
57 printf "<input type=radio name=lprm_command_def value=1 %s> $text{'default'}\n",
58         &getval("lprm command") eq "" ? "checked" : "";
59 printf "&nbsp;&nbsp;<input type=radio name=lprm_command_def value=0 %s>\n",
60         &getval("lprm command") ne "" ? "checked" : "";
61 printf "<input name=lprm_command size=30 value=\"%s\"></td> </tr>\n",
62         &getval("lprm command");
63
64 print "<tr> <td><b>$text{'print_pause'}</b></td>\n";
65 printf "<td colspan=3>\n";
66 printf "<input type=radio name=lppause_command_def value=1 %s> $text{'config_none'}\n",
67         &getval("lppause command") eq "" ? "checked" : "";
68 printf "&nbsp;&nbsp;<input type=radio name=lppause_command_def value=0 %s>\n",
69         &getval("lppause command") ne "" ? "checked" : "";
70 printf "<input name=lppause_command size=30 value=\"%s\"></td> </tr>\n",
71         &getval("lppause command");
72
73 print "<tr> <td><b>$text{'print_unresume'}</b></td>\n";
74 printf "<td colspan=3>\n";
75 printf "<input type=radio name=lpresume_command_def value=1 %s> $text{'config_none'}\n",
76         &getval("lpresume command") eq "" ? "checked" : "";
77 printf "&nbsp;&nbsp;<input type=radio name=lpresume_command_def value=0 %s>\n",
78         &getval("lpresume command") ne "" ? "checked" : "";
79 printf "<input name=lpresume_command size=30 value=\"%s\"></td> </tr>\n",
80         &getval("lpresume command");
81
82 print "<tr> <td><b>$text{'print_driver'}</b></td>\n"; 
83 print "<td colspan=3>\n";
84 printf "<input type=radio name=printer_driver_def value=1 %s> $text{'config_none'}\n",
85         &getval("printer driver") eq "" ? "checked" : "";
86 printf "&nbsp;&nbsp;<input type=radio name=printer_driver_def value=0 %s>\n",
87         &getval("printer driver") ne "" ? "checked" : "";
88 printf "<input name=printer_driver size=30 value=\"%s\"></td> </tr>\n",
89         &getval("printer driver");
90
91 print "</table> </td></tr></table><p>\n";
92 print "<input type=submit value=$text{'save'}>"
93         if &can('wO', \%access, $in{'share'}); 
94 print "</form><p>\n";
95
96 &ui_print_footer("edit_pshare.cgi?share=".&urlize($s), $text{'index_printershare'},
97         "", $text{'index_sharelist'});
98