938 Posts in 271 Topics by 291 members
Forum Module
SilverStripe Forums » Forum Module » Changing logout page on Forum
Discuss the Forum Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 2127 Views |
-
Changing logout page on Forum

1 October 2009 at 9:12pm
I want the browser to go to a non-standard login page after a user has logged out but I am not sure how to get this to work. The logout function
function logout() {
if($member = Member::currentUser())
$member->logOut();
$returnTo = DataObject::get_one("ForumHolder");
if($returnTo)
return Director::redirect(Director::absoluteBaseURL().$returnTo->URLSegment);
else {
return Director::redirectBack();
}
}Uses a $returnTo Variable, where do I change this?
Thanks
MM
-
Re: Changing logout page on Forum

3 October 2009 at 4:24am
You can do this easily, Extend your Page class and create a new page type; So lets say this page type is LoggedOutPage.
Now what you have to do is that to rewrite the logout function.
function logout() {
if($member = Member::currentUser())
$member->logOut();
$returnTo = DataObject::get_one("LoggedOutPage");
if($returnTo)
return Director::redirect(Director::absoluteBaseURL().$returnTo->URLSegment);
else {
return Director::redirectBack();
}
}this way you can redirect the users to any page. but make sure you prevent editing the core codes. otherwise when updating the modules, cms or the framework you will miss the cstomizations you did.
-
Re: Changing logout page on Forum

4 October 2009 at 1:28pm
Feeling kind of stupid. I just did not see that line. Thanks
MM
| 2127 Views | ||
|
Page:
1
|
Go to Top |

