From 08eda5bc3c3fbfc539af9f9fd2f62a3c23fb7798 Mon Sep 17 00:00:00 2001 From: matthiasgrimm Date: Fri, 17 Jun 2005 14:18:38 +0200 Subject: locks must not survive logoff If a user logout during editing an article, this article will be blocked until end of timeout. This patch removes an open lock, if the user log off. darcs-hash:20050617121838-7ef76-1481946ab9c985ba006d3018fd0acfe9e4223f9e.gz --- inc/actions.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'inc') diff --git a/inc/actions.php b/inc/actions.php index 09042885e..091a477a3 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -185,12 +185,18 @@ function act_save($act){ * @author Andreas Gohr */ function act_auth($act){ + global $ID; + //already logged in? if($_SERVER['REMOTE_USER'] && $act=='login') return 'show'; //handle logout if($act=='logout'){ + $lockedby = checklock($ID); //page still locked? + if($lockedby == $_SERVER['REMOTER_USER']) + unlock($ID); //try to unlock + auth_logoff(); return 'login'; } -- cgit v1.2.3