summaryrefslogtreecommitdiff
path: root/inc/actions.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/actions.php')
-rw-r--r--inc/actions.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/inc/actions.php b/inc/actions.php
index fa11bb7f1..ecf09036f 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -190,6 +190,7 @@ function act_sendheaders($headers) {
function act_clean($act){
global $lang;
global $conf;
+ global $INFO;
// check if the action was given as array key
if(is_array($act)){
@@ -219,6 +220,9 @@ function act_clean($act){
return 'show';
}
+ //is there really a draft?
+ if($act == 'draft' && !file_exists($INFO['draft'])) return 'edit';
+
if(!in_array($act,array('login','logout','register','save','cancel','edit','draft',
'preview','search','show','check','index','revisions',
'diff','recent','backlink','admin','subscribe','revert',
@@ -505,10 +509,14 @@ function act_edit($act){
if(!$DATE) $DATE = $INFO['meta']['date']['modified'];
//check if locked by anyone - if not lock for my self
- $lockedby = checklock($ID);
- if($lockedby) return 'locked';
+ //do not lock when the user can't edit anyway
+ if ($INFO['writable']) {
+ $lockedby = checklock($ID);
+ if($lockedby) return 'locked';
+
+ lock($ID);
+ }
- lock($ID);
return $act;
}