# HG changeset patch # User Dan # Date 1187310949 14400 # Node ID 95c4d91bd954544d9ce017829f964448f701b4b1 # Parent aa8ffe41d1c40f9b5eea251528a1a10b6047dcf7 Redirections to the main page use the redirect() function now diff -r aa8ffe41d1c4 -r 95c4d91bd954 includes/pageprocess.php --- a/includes/pageprocess.php Tue Aug 14 20:48:29 2007 -0400 +++ b/includes/pageprocess.php Thu Aug 16 20:35:49 2007 -0400 @@ -1084,13 +1084,13 @@ { $r = $db->fetchrow(); echo '

This page was deleted on ' . $r['date_string'] . '. The stated reason was:

' . $r['edit_summary'] . '

You can probably roll back the deletion.

'; + if ( $session->user_level >= USER_LEVEL_ADMIN ) + { + echo '

Additional admin options: detag page

'; + } } $db->free_result(); } - if ( $session->user_level >= USER_LEVEL_ADMIN ) - { - echo '

Additional admin options: detag page

'; - } echo '

HTTP Error: 404 Not Found

'; diff -r aa8ffe41d1c4 -r 95c4d91bd954 includes/paths.php --- a/includes/paths.php Tue Aug 14 20:48:29 2007 -0400 +++ b/includes/paths.php Thu Aug 16 20:35:49 2007 -0400 @@ -384,14 +384,13 @@ { if( is_string(getConfig('main_page')) ) { - header('Location: '.makeUrl(getConfig('main_page'))); - die('If you aren\'t redirected, click here.'); + $main_page = makeUrl(getConfig('main_page')); } else { - header('Location: '.makeUrl($this->pages[0]['urlname'])); - die('If you aren\'t redirected, click here.'); + $main_page = makeUrl($this->pages[0]['urlname']); } + redirect($main_page, 'Redirecting...', 'Invalid request, redirecting to main page', 0); exit; } diff -r aa8ffe41d1c4 -r 95c4d91bd954 plugins/SpecialUserFuncs.php --- a/plugins/SpecialUserFuncs.php Tue Aug 14 20:48:29 2007 -0400 +++ b/plugins/SpecialUserFuncs.php Thu Aug 16 20:35:49 2007 -0400 @@ -124,6 +124,8 @@ { $level = USER_LEVEL_MEMBER; } + if ( $level <= USER_LEVEL_MEMBER && $session->user_logged_in ) + $paths->main_page(); $template->header(); echo '
'; $header = ( $level > USER_LEVEL_MEMBER ) ? 'Please re-enter your login details' : 'Please enter your username and password to log in.'; @@ -274,11 +276,11 @@ if(isset($_POST['return_to'])) { $name = ( isset($paths->pages[$_POST['return_to']]['name']) ) ? $paths->pages[$_POST['return_to']]['name'] : $_POST['return_to']; - redirect( makeUrl($_POST['return_to']), 'Login successful', 'You have successfully logged into the '.getConfig('site_name').' site as "'.$session->username.'". Redirecting to ' . $name . '...' ); + redirect( makeUrl($_POST['return_to'], false, true), 'Login successful', 'You have successfully logged into the '.getConfig('site_name').' site as "'.$session->username.'". Redirecting to ' . $name . '...' ); } else { - $paths->main_page(); + redirect( makeUrl(getConfig('main_page'), false, true), 'Login successful', 'You have successfully logged into the '.getConfig('site_name').' site as "'.$session->username.'". Redirecting to the main page...' ); } } else @@ -308,8 +310,14 @@ function page_Special_Logout() { global $db, $session, $paths, $template, $plugins; // Common objects + if ( !$session->user_logged_in ) + $paths->main_page(); + $l = $session->logout(); - if($l == 'success') $paths->main_page(); + if ( $l == 'success' ) + { + redirect(makeUrl(getConfig('main_page'), false, true), 'Logged out', 'You have been successfully logged out, and all cookies have been cleared. You will now be transferred to the main page.', 4); + } $template->header(); echo '

An error occurred during the logout process.

'.$l.'

'; $template->footer(); @@ -323,6 +331,10 @@ $s = ($session->user_level >= USER_LEVEL_ADMIN) ? '

Oops...it seems that you are the administrator...hehe...you can also force account registration to work.

' : ''; die_friendly('Registration disabled', '

The administrator has disabled new user registration on this site.

' . $s); } + 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';