[Rt-commit] r3502 - in rt/branches/3.5-TESTING: . html

kevinr at bestpractical.com kevinr at bestpractical.com
Mon Jul 18 15:56:34 EDT 2005


Author: kevinr
Date: Mon Jul 18 15:56:33 2005
New Revision: 3502

Modified:
   rt/branches/3.5-TESTING/   (props changed)
   rt/branches/3.5-TESTING/html/autohandler
Log:
 r6429 at SAD-GIRL-IN-SNOW:  kevinr | 2005-07-18 15:33:39 -0400
 * Rolled the functionality from RT::Extension::RedirectUnprivilegedUsers in
 -- this sends unprivileged users who request Ticket/Display.html addresses to
 the equivalent SelfService/Display.html address instead.


Modified: rt/branches/3.5-TESTING/html/autohandler
==============================================================================
--- rt/branches/3.5-TESTING/html/autohandler	(original)
+++ rt/branches/3.5-TESTING/html/autohandler	Mon Jul 18 15:56:33 2005
@@ -224,10 +224,25 @@
     $m->comp('/Elements/Callback', %ARGS);
 
     # If the user isn't privileged, they can only see SelfService
-    if ((! $session{'CurrentUser'}->Privileged) and
-	($m->base_comp->path !~ '^(/+)SelfService/') ) {
-	$m->comp('/SelfService/index.html');
-	$m->abort();
+    if (! $session{'CurrentUser'}->Privileged) {
+
+        # if the user is trying to access a ticket, redirect them
+        if ( ($m->request_comp->path =~ '^(/+)Ticket/Display.html') and
+             ($ARGS{'id'}) ) {
+            $m->comp("/SelfService/Display.html", %ARGS);
+            $m->comp("/Elements/Footer", %ARGS);
+            $m->abort();
+        }
+
+        # otherwise, drop the user at the SelfService default page
+	elsif ($m->base_comp->path !~ '^(/+)SelfService/') {
+	    $m->comp('/SelfService/index.html');
+	    $m->abort();
+        }
+
+        else {
+	    $m->call_next(%ARGS);
+        }
     }
     else {
 	$m->call_next(%ARGS);


More information about the Rt-commit mailing list