[Rt-commit] [svn] r1283 - in rt/branches/3.2-RELEASE: . etc html/NoAuth/images

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Fri Jul 23 17:23:11 EDT 2004


Author: jesse
Date: Fri Jul 23 17:23:10 2004
New Revision: 1283

Added:
   rt/branches/3.2-RELEASE/html/NoAuth/images/autohandler
Modified:
   rt/branches/3.2-RELEASE/   (props changed)
   rt/branches/3.2-RELEASE/etc/RT_Config.pm.in
Log:
 ----------------------------------------------------------------------
 r8292 at tinbook:  jesse | 2004-07-23T21:23:16.884303Z
 
 RT now goes out of its way to display images, like the logo... even when users fail to configure their webserver correctly
 ----------------------------------------------------------------------


Modified: rt/branches/3.2-RELEASE/etc/RT_Config.pm.in
==============================================================================
--- rt/branches/3.2-RELEASE/etc/RT_Config.pm.in	(original)
+++ rt/branches/3.2-RELEASE/etc/RT_Config.pm.in	Fri Jul 23 17:23:10 2004
@@ -282,7 +282,7 @@
 
 # $WebImagesURL points to the base URL where RT can find its images.
 
-Set($WebImagesURL , $WebURL . "NoAuth/images/");
+Set($WebImagesURL , $WebPath . "/NoAuth/images/");
 
 # $RTLogoURL points to the URL of the RT logo displayed in the web UI
 

Added: rt/branches/3.2-RELEASE/html/NoAuth/images/autohandler
==============================================================================
--- (empty file)
+++ rt/branches/3.2-RELEASE/html/NoAuth/images/autohandler	Fri Jul 23 17:23:10 2004
@@ -0,0 +1,21 @@
+<%init>
+
+# This autohandler will spit out RT's images if the user hasn't 
+# properly configured their webserver to stop RT from passing 
+# images through the mason handler.
+
+my $file = $m->base_comp->source_file;
+my $type = "application/octet-stream";
+
+if ($file =~ /\.(gif|png|jpe?g)$/i) {
+    $type = "image/$1";
+    $type =~ s/jpg/jpeg/gi;
+}
+
+die unless (-f $file && -r $file);
+$r->content_type($type);
+open (FILE, "<$file") || die;
+$m->out($_) while (<FILE>);
+close(FILE);
+$m->abort;
+</%init>


More information about the Rt-commit mailing list