plugins/SpecialAdmin.php
changeset 1067 4058c844ee38
parent 1055 15ef8d2147c2
child 1081 745200a9cc2a
--- a/plugins/SpecialAdmin.php	Fri Jul 17 20:23:48 2009 -0400
+++ b/plugins/SpecialAdmin.php	Fri Jul 17 20:28:24 2009 -0400
@@ -2055,7 +2055,12 @@
   
   if ( $session->auth_level < USER_LEVEL_ADMIN )
   {
-    redirect(makeUrlNS('Special', 'Login/'.$paths->page, 'level='.USER_LEVEL_ADMIN), 'Not authorized', 'You need an authorization level of '.USER_LEVEL_ADMIN.' to use this page, your auth level is: ' . $session->auth_level, 0);
+    $query_string = 'level=' . USER_LEVEL_ADMIN;
+    if ( !empty($_SERVER['QUERY_STRING']) )
+    {
+      $query_string .= '&' . trim(preg_replace('/(?:&|^)title=.+?(?:&|$)/', '&', $_SERVER['QUERY_STRING']), '&');
+    }
+    redirect(makeUrlNS('Special', 'Login/'.$paths->page, $query_string), 'Not authorized', 'You need an authorization level of '.USER_LEVEL_ADMIN.' to use this page, your auth level is: ' . $session->auth_level, 0);
     exit;
   }
   else