#9 additional options to lpadmin

open
nobody
None
5
2014-08-08
2002-05-17
Anonymous
No

While looking a this product, I found that the attached
changes provide for more flexability to more tightly
control printer configuration options. Particularly
removing printers and changing the default printer.

*** edit_printer.cgi-old Wed Apr 3 15:03:16 2002
--- edit_printer.cgi Wed Apr 3 15:26:46 2002
***************
*** 99,105 ****
}
else { print "<tr>\n"; }

! if (&printer_support('default')) {
print "<td
align=right><b>$text{'edit_default'}</b></td> <td>\n";
if (!$prn{'default'}) {
printf "<input type=radio name=default
value=1 %s> $text{'yes'}\ n", $prn{'default'} ? "checked" : "";
--- 99,106 ----
}
else { print "<tr>\n"; }

! # Limit who can change the default printer.
! if ($access{'default'} && &printer_support('default')) {
print "<td
align=right><b>$text{'edit_default'}</b></td> <td>\n";
if (!$prn{'default'}) {
printf "<input type=radio name=default
value=1 %s> $text{'yes'}\ n", $prn{'default'} ? "checked" : "";
***************
*** 277,286 ****
else {
print "<table width=100%>\n";
print "<tr> <td><input type=submit
value=\"$text{'save'}\"></td>\n";
! print "</form><form
action=\"delete_printer.cgi\">\n";
! print "<input type=hidden name=name
value=\"$in{'name'}\">\n";
! print "<td align=right><input type=submit ",
! "value=\"$text{'delete'}\"></td> </tr>\n";
print "</form></table><p>\n";
}
print $after;
--- 278,291 ----
else {
print "<table width=100%>\n";
print "<tr> <td><input type=submit
value=\"$text{'save'}\"></td>\n";
! # Just like adding, deleting should be restricted.
! if ($access{'delete'}) {
! print "</form><form
action=\"delete_printer.cgi\">\n";
! print "<input type=hidden name=name
value=\"$in{'name'}\">\n";
! print "<td align=right><input
type=submit ",
! "value=\"$text{'delete'}\"></td>";
! }
! print " </tr>\n";
print "</form></table><p>\n";
}
print $after;

Discussion