#!/usr/bin/perl -w use strict; # ... CONFIGURAR ... my $imgok="/etc/apache2/PAPI/image_ok.png"; my $papiloc="/sympa/sso_login/listillo/"; my $sympahost="listillo.uv.es"; # ... my $debug=0; my $imgoksize= (stat $imgok)[7]; if (not defined $imgoksize or $imgoksize == 0) { $debug=1; $imgoksize="***CANT READ FILE: $imgok"; } if ($debug) { print "Content-type: text/html\n"; print "Pragma: no-cache\n"; print "Cache-control: no-cache\n\n"; print "
\n"; print "\n"; } print "Accept-Ranges: bytes\n"; print "Connection: close\n"; print "Pragma: no-cache\n"; print "Cache-control: no-cache\n"; print "Set-Cookie: sympa_session=D; host=$sympahost; path=/; \n"; print "Set-Cookie: Lcook=D; domain=.$sympahost; path=$papiloc; \n"; print "Content-Length: $imgoksize\n"; print "Content-Type: image/png\n"; print "\n"; my $img; open (FIOK,"<$imgok") or die; sysread FIOK,$img,$imgoksize; close FIOK; if ($debug) { print "\n"; } else { binmode STDOUT; syswrite STDOUT,$img,$imgoksize+1; }