1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

After Log-out Redirection

Discussion in 'Styling and Customization Questions' started by Galexrt, Oct 16, 2012.

  1. Galexrt

    Galexrt Member

    Hi
    Where can i change where a user should get to after he logged out?
    (I mean if user A logs out then he get redirected to the portal site(something like this))
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    It's not an easy thing to change.

    You would either need to write an add-on to extend the Logout controller or it requires a code edit.

    Obviously code edits aren't great as you would need to re-apply them after XenForo upgrades.

    However, this change is quite minor... if you want to do it, here's how:

    Open the following file in Notepad or other editor:

    library/XenForo/ControllerPublic/Logout.php

    Lines 12-15 read:

    PHP:
            $redirectResponse $this->responseRedirect(
                
    XenForo_ControllerResponse_Redirect::SUCCESS,
                
    $this->getDynamicRedirect(falsefalse)
            );
    Change them to:

    PHP:
            $redirectResponse $this->responseRedirect(
                
    XenForo_ControllerResponse_Redirect::SUCCESS,
                
    XenForo_Link::buildBasicLink('http://www.google.co.uk''');
            );
    Note that this is redirecting to Google, but that is just as an example. In that format, you can literally redirect to any URL you like.
     
    KiF, Galexrt and Jake Bunce like this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  4. Galexrt

    Galexrt Member

    Thanks for your help!
     

Share This Page