I've been searching for a solution for a while on the forums and on Google, but haven't managed to find one. There are some threads on the forums which cover a custom "logout" method for a logged in Security Group member, but the responses given there unfortunately don't help either.
My problem is that I have created a Security Group named "Professionals" and have the logging in part functioning. After logging in, I want to provide them with a "Log out" link which is visible on every page of the website. I looked at the Forum module (and the ForumMemberProfile class to be specific) to see how it is done there, as the module also supplies a "Log out" hyperlink.
This hyperlink points towards "ForumMemberProfile/logout".
In an attempt to mimic this functionality, I set my hyperlink to "Professionals/logout", but when it is clicked on, I receive a "Page not found" error. This seems pretty logical as the page doesn't exist, but I can't seem to figure out how Forum does this? I noticed that the class has the $URLSegment variable set to "ForumMemberProfile" and tried that with my class, but that also doesn't do the trick.
Another thread on the Forums suggested putting a "logout" method in the Page_Controller class and then a hyperlink in the template pointing to "home/logout" (the same principle). So I moved my method into the Page_Controller class in Page.php and changed my hyperlink to "{$BaseHref}logout". But this also gives me a "Page not found" error.
Can anyone explain to me how exactly calling classes and their functions from the page URL works? Any help would be greatly appreciated :)