diff -r 45e887f23282 -r 7152ca0a0ce9 plugins/SpecialUserFuncs.php --- a/plugins/SpecialUserFuncs.php Mon Feb 16 16:04:54 2009 -0500 +++ b/plugins/SpecialUserFuncs.php Mon Feb 16 16:17:25 2009 -0500 @@ -513,7 +513,7 @@ $template->load_theme($session->theme, $session->style); if(isset($_POST['return_to'])) { - $name = ( isset($paths->pages[$_POST['return_to']]['name']) ) ? $paths->pages[$_POST['return_to']]['name'] : $_POST['return_to']; + $name = ( isPage($_POST['return_to']['name']) ) ? $paths->pages[$_POST['return_to']]['name'] : $_POST['return_to']; $subst = array( 'username' => $session->username, 'redir_target' => $name @@ -601,7 +601,7 @@ global $db, $session, $paths, $template, $plugins; // Common objects global $lang; - if ( $session->user_logged_in ) + if ( $session->user_level < USER_LEVEL_ADMIN && $session->user_logged_in ) { $paths->main_page(); } @@ -636,17 +636,14 @@ } $db->free_result(); } - if ( $session->user_level < USER_LEVEL_ADMIN && $session->user_logged_in ) - { - $paths->main_page(); - } if(isset($_POST['submit'])) { $_GET['coppa'] = ( isset($_POST['coppa']) ) ? $_POST['coppa'] : 'x'; $captcharesult = $session->get_captcha($_POST['captchahash']); $session->kill_captcha(); - if ( strtolower($captcharesult) != strtolower($_POST['captchacode']) ) + // bypass captcha if logged in (at this point, if logged in, we're admin) + if ( !$session->user_logged_in && strtolower($captcharesult) != strtolower($_POST['captchacode']) ) { $s = $lang->get('user_reg_err_captcha'); } @@ -656,7 +653,7 @@ { $s = 'Invalid COPPA input'; } - else if ( !empty($terms) && !isset($_POST['tou_agreed']) ) + else if ( !$session->user_logged_in && !empty($terms) && !isset($_POST['tou_agreed']) ) { $s = $lang->get('user_reg_err_accept_tou'); } @@ -752,7 +749,7 @@