# HG changeset patch # User Dan # Date 1247876904 14400 # Node ID 4058c844ee38573b8685b3ff9901b1058c51ec3e # Parent bead71f28f633564421f5b8cd4301924f8757ffd Admin: query string is now preserved on redirect to login diff -r bead71f28f63 -r 4058c844ee38 plugins/SpecialAdmin.php --- 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