--- 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 '<p><b>This page was deleted on ' . $r['date_string'] . '.</b> The stated reason was:</p><blockquote>' . $r['edit_summary'] . '</blockquote><p>You can probably <a href="'.makeUrl($paths->page, 'do=rollback&id='.$r['time_id']).'" onclick="ajaxRollback(\''.$r['time_id'].'\'); return false;">roll back</a> the deletion.</p>';
+ if ( $session->user_level >= USER_LEVEL_ADMIN )
+ {
+ echo '<p>Additional admin options: <a href="' . makeUrl($paths->page, 'do=detag', true) . '" title="Remove any tags on this page">detag page</a></p>';
+ }
}
$db->free_result();
}
- if ( $session->user_level >= USER_LEVEL_ADMIN )
- {
- echo '<p>Additional admin options: <a href="' . makeUrl($paths->page, 'do=detag', true) . '" title="Remove any tags on this page">detag page</a></p>';
- }
echo '<p>
HTTP Error: 404 Not Found
</p>';
--- 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, <a href="' . makeUrl(getConfig('main_page')) . '">click here</a>.');
+ $main_page = makeUrl(getConfig('main_page'));
}
else
{
- header('Location: '.makeUrl($this->pages[0]['urlname']));
- die('If you aren\'t redirected, <a href="' . makeUrl($this->pages[0]['urlname']) . '">click here</a>.');
+ $main_page = makeUrl($this->pages[0]['urlname']);
}
+ redirect($main_page, 'Redirecting...', 'Invalid request, redirecting to main page', 0);
exit;
}
--- 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 '<form action="'.makeUrl($paths->nslist['Special'].'Login').'" method="post" name="loginform" onsubmit="runEncryption();">';
$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 '<h3>An error occurred during the logout process.</h3><p>'.$l.'</p>';
$template->footer();
@@ -323,6 +331,10 @@
$s = ($session->user_level >= USER_LEVEL_ADMIN) ? '<p>Oops...it seems that you <em>are</em> the administrator...hehe...you can also <a href="'.makeUrl($paths->page, 'IWannaPlayToo', true).'">force account registration to work</a>.</p>' : '';
die_friendly('Registration disabled', '<p>The administrator has disabled new user registration on this site.</p>' . $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';