From 0ae8cbf5c0b1a198b963490985b7738392ebcb97 Mon Sep 17 00:00:00 2001 From: ahriman Date: Mon, 3 Dec 2018 19:22:25 -0500 Subject: installed dokuwiki, added to navbar, updated news --- wiki/inc/Action/Logout.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 wiki/inc/Action/Logout.php (limited to 'wiki/inc/Action/Logout.php') diff --git a/wiki/inc/Action/Logout.php b/wiki/inc/Action/Logout.php new file mode 100644 index 0000000..1590904 --- /dev/null +++ b/wiki/inc/Action/Logout.php @@ -0,0 +1,50 @@ +canDo('logout')) throw new ActionDisabledException(); + } + + /** @inheritdoc */ + public function preProcess() { + global $ID; + global $INPUT; + + // when logging out during an edit session, unlock the page + $lockedby = checklock($ID); + if($lockedby == $INPUT->server->str('REMOTE_USER')) { + unlock($ID); + } + + // do the logout stuff and redirect to login + auth_logoff(); + send_redirect(wl($ID, array('do' => 'login'))); + + // should never be reached + throw new ActionException('login'); + } + +} -- cgit 1.4.1-2-gfad0