Skip to content

Commit

Permalink
Merge pull request #681 from emanuele45/admin_session
Browse files Browse the repository at this point in the history
Send back to the referer?
  • Loading branch information
norv committed Jul 18, 2013
2 parents 168c419 + 35d6c46 commit ff5a75d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sources/Subs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3119,7 +3119,7 @@ function template_header()
}
}
if (in_array($layer, array('body', 'main')) && allowedTo('admin_forum') && !$user_info['is_guest'] && (isset($_SESSION['admin_time']) && $_SESSION['admin_time'] + ($modSettings['admin_session_lifetime'] * 60) > mktime()))
echo '<div class="noticebox">', sprintf($txt['admin_session_active'], ($scripturl . '?action=admin;area=adminlogoff;' . $context['session_var'] . '=' . $context['session_id'])), '</div>';
echo '<div class="noticebox">', sprintf($txt['admin_session_active'], ($scripturl . '?action=admin;area=adminlogoff;redir;' . $context['session_var'] . '=' . $context['session_id'])), '</div>';

// If the user is banned from posting inform them of it.
elseif (in_array($layer, array('main', 'body')) && isset($_SESSION['ban']['cannot_post']) && !$showed_banned)
Expand Down
5 changes: 4 additions & 1 deletion sources/admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,9 @@ public function action_endsession()
if (strpos($key, '-admin') !== false)
unset($_SESSION['token'][$key]);

redirectexit('action=admin');
if (isset($_GET['redir']) && isset($_SERVER['HTTP_REFERER']))
redirectexit($_SERVER['HTTP_REFERER']);
else
redirectexit();
}
}

0 comments on commit ff5a75d

Please sign in to comment.