Login: if return-to specified and already logged in, jump to return-to instead of main page.
authorDan
Sun, 20 Sep 2009 03:59:36 -0400
changeset 1117 4d8ffe107a0d
parent 1116 220428d80925
child 1118 e26e74d80c15
Login: if return-to specified and already logged in, jump to return-to instead of main page.
plugins/SpecialUserFuncs.php
--- a/plugins/SpecialUserFuncs.php	Sun Sep 20 02:52:24 2009 -0400
+++ b/plugins/SpecialUserFuncs.php	Sun Sep 20 03:59:36 2009 -0400
@@ -144,7 +144,14 @@
     $level = USER_LEVEL_MEMBER;
   }
   if ( $level <= USER_LEVEL_MEMBER && $session->user_logged_in )
+  {
+    if ( $target = $paths->getAllParams() )
+    {
+      redirect(makeUrl($target), '', '', 0);
+    }
     $paths->main_page();
+  }
+  
   $template->header();
   echo '<form action="'.makeUrl($paths->nslist['Special'].'Login').'" method="post" name="loginform" onsubmit="try{runEncryption();}catch(e){};">';
   $header = ( $level > USER_LEVEL_MEMBER ) ? $lang->get('user_login_message_short_elev') : $lang->get('user_login_message_short');