summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthiasgrimm <matthiasgrimm@users.sourceforge.net>2005-06-17 14:18:38 +0200
committermatthiasgrimm <matthiasgrimm@users.sourceforge.net>2005-06-17 14:18:38 +0200
commit08eda5bc3c3fbfc539af9f9fd2f62a3c23fb7798 (patch)
tree550965e5afeb805ce2f22277509891324b7a6693
parent396b7edb586c4adc78233b105886e9aafcffb15e (diff)
downloadrpg-08eda5bc3c3fbfc539af9f9fd2f62a3c23fb7798.tar.gz
rpg-08eda5bc3c3fbfc539af9f9fd2f62a3c23fb7798.tar.bz2
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
-rw-r--r--inc/actions.php6
1 files changed, 6 insertions, 0 deletions
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 <andi@splitbrain.org>
*/
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';
}