As this is too stupid to place it in our contrib area, here it is directly. You just need to copy and paste the code for /etc/e-smith/web/functions/printers Sorry, we made some modifications too to the standard panel to show only information relevant to local printers

#!/usr/bin/perl -wT
(...)
elsif ($q->param ('state') eq "restart")
{
esmith::cgi::genHeaderNonCacheable ($q,
\%conf, 'Printer queue restart');
esmith::util::serviceControl
(
NAME => 'lpd',
ACTION => 'restart',
) || die "The service did not restart. You should restart the server.";
print $q->p ('Printer service restarted successfully.');
esmith::cgi::genFooter ($q);
}
elsif ($q->param ('state') eq "empty")
{
emptyPrinter ($q);
}
(...)
#----------------------------------------
# subroutine to display initial form
#----------------------------------------
sub showinitial ($$)
{
(...)
else
{
print $q->h4 ('Current List of printers');
print $q->table ({border => 1, cellspacing => 1, cellpadding => 4});
print $q->Tr (esmith::cgi::genSmallCell ($q, $q->b ('Name')),
esmith::cgi::genSmallCell ($q, $q->b ('Description')),
esmith::cgi::genSmallCell ($q, $q->b ('Location')),
esmith::cgi::genSmallCell ($q, $q->b ('Remote address')),
esmith::cgi::genSmallCell ($q, $q->b ('Remote Name')),
$q->td (' '),
$q->td (' '));
my $printer;
foreach $printer (sort @printerDrivers)
{
my ($type, %properties) = db_get(\%accounts, $printer);
my $address = ($properties{'Location'} eq 'remote')
? $properties{'Address'} : 'N/A';
my $remoteName = ($properties{'Location'} eq 'remote')
? $properties{'RemoteName'} : 'N/A';
unless ($remoteName)
{
$remoteName = 'raw';
}
print $q->Tr (esmith::cgi::genSmallCell ($q, $printer),
esmith::cgi::genSmallCell ($q, $properties{'Description'}),
esmith::cgi::genSmallCell ($q, $properties{'Location'}),
esmith::cgi::genSmallCell ($q, $address),
esmith::cgi::genSmallCell ($q, $remoteName),
esmith::cgi::genSmallCell ($q,
$q->a ({href => $q->url (-absolute => 1)
. "?state=delete&printer="
. $printer}, 'Remove...')),
esmith::cgi::genSmallCell ($q,
$q->a ({href => $q->url (-absolute => 1)
. "?state=empty&printer="
. $printer}, 'Flush queue...')));
}
print '';
print $q->p ($q->a ({href => $q->url (-absolute => 1) . "?state=restart"},
'Click here'),
'to restart the printer service (flushes all queues).');
}
esmith::cgi::genFooter ($q);
}
(...)
#------------------------------------------------------------
#
#------------------------------------------------------------
sub emptyPrinter ($)
{
my ($q) = @_;
#------------------------------------------------------------
# Attempt to empty printer
#------------------------------------------------------------
my $printer = $q->param ('printer');
if ($printer =~ /^([a-z][a-z0-9]*)$/)
{
$printer = $1;
}
else
{
showInitial
($q,
"Error while flushing queue \"$printer\".");
return;
}
/usr/bin/lprm -P $printer all > /dev/null 2>&1;
showInitial ($q, "Queue \"$printer\" has been flushed.");
}