DokuWiki: Redirect users on logout to front/start page

21 Dec

I have a DokuWiki site for some documentation, and I needed to have it so that users who are logging off and then logging back in are always redirected to the home page. (DokuWiki, by default, redirects them to the page that they were on when the logged out.)

I was able to find the code to handle this in actions.php in the root of my Dokuwiki install. In that file, there is a function called function act_auth($act). In that function, look for this piece of code:

  //handle logout
  if($act=='logout'){

That’s the one that handles the action when users log out.

The last line of that control sequence is:

    act_redirect($ID,'login');

You just need to replace $ID with “”, and that redirects all users who are logging off to the front/home page. So when they log back in, they are on the start page.

New code:

    act_redirect("",'login');
Advertisements

2 Responses to “DokuWiki: Redirect users on logout to front/start page”

  1. Gordon July 25, 2011 at 6:32 pm #

    Brilliant. Works a treat. Thanks for documenting this.

    • sumanrs July 29, 2011 at 11:20 am #

      Thanks! Glad you found it useful!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: