G Galexrt Member Oct 16, 2012 #1 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))
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))
Chris D XenForo developer Staff member Oct 16, 2012 #2 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(false, false) ); 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. Upvote 0 Downvote
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(false, false) ); 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.
Jake Bunce Well-known member Oct 17, 2012 #3 http://xenforo.com/community/threads/redirect-to-specified-url-on-logout.28439/#post-336951 Upvote 0 Downvote