3 # View an existing print job
5 require './lpadmin-lib.pl';
8 @jobs = &get_jobs($in{'name'});
10 $job = $j if ($j->{'id'} eq $in{'id'});
12 ($ju = $j->{'user'}) =~ s/\!.*$//;
13 &can_edit_jobs($in{'name'}, $ju) || &error($text{'view_ecannot'});
15 # print job exists.. dump it
16 @pf = @{$job->{'printfile'}};
17 $type = &backquote_command("file ".quotemeta($pf[0]), 1);
18 if ($type =~ /postscript/i) {
19 print "Content-type: application/postscript\n";
21 elsif ($type =~ /text/) {
22 print "Content-type: text/plain\n";
25 print "Content-type: application/octet-stream\n";
31 print "Content-length: $total\n";
35 while(<FILE>) { print; }
40 &error(&text('view_egone', $in{'id'}));