Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

Login Logout

Summary: How to log out after logging in
Version: 1.0
Prerequisites:
Status: Q&A
Maintainer:

Questions answered by this recipe

If a user logs into a pmwiki, how does he log out?

Logging in and out

To log out use the site page action logout.

To enable this action add a link to the page, sidebar,

[[{$FullName}?action=logout|log out]]

log out

or add this action to the Site.Page Actions.

(:if enabled AuthPW :)
* %item rel=nofollow class=logout    accesskey='$[ak_logout]'%   
[[{*$FullName}?action=logout | $[Logout] ]]
(:ifend:)

Change the conditional markup as appropriate for the access authorisation level you logged in at.

Notes

Release Notes

Comments

To make this a little prettier, I created a page Main/LogOut which contains only:

(:redirect HomePage:)

then added this to local/config.php:

if (@$_GET['from']) {
  $page = PageVar($_GET['from'], '$FullName');
  if ($page == 'Main.LogOut') $PageRedirectFmt = '<h5><i>You have logged out.</i></h5>';
}

then placed this link in the sidebar:

(:if authid:)
[[Main/LogOut?action=logout | Log Out]]
(:ifend:)

Clicking on the link will then log you out, take you back to the homepage, and place the message "You have logged out." at the top of the page. And the "Log Out" link will only show when you're logged in.

Cheers.

~Joseph

See Also

Contributors

User notes +4: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Edit - History - Print - Recent Changes - Search
Page last modified on October 26, 2011, at 04:06 AM