diff options
author | Andreas Gohr <gohr@cosmocode.de> | 2015-02-09 10:22:12 +0100 |
---|---|---|
committer | Andreas Gohr <gohr@cosmocode.de> | 2015-02-09 10:22:12 +0100 |
commit | bf00b3965f373b9497752ef97b25d9f29be35ca0 (patch) | |
tree | 82db08467f5ee08750b56ff0fb22f43b944b9762 /bin/dwpage.php | |
parent | d75d76b237162cf89dcc8f56703ec0607ed27fdb (diff) | |
download | rpg-bf00b3965f373b9497752ef97b25d9f29be35ca0.tar.gz rpg-bf00b3965f373b9497752ef97b25d9f29be35ca0.tar.bz2 |
fix username handling in dwpage CLI tool. closes #1019
Diffstat (limited to 'bin/dwpage.php')
-rwxr-xr-x | bin/dwpage.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/dwpage.php b/bin/dwpage.php index a777fd3e1..d7f6e9bb8 100755 --- a/bin/dwpage.php +++ b/bin/dwpage.php @@ -28,7 +28,8 @@ class PageCLI extends DokuCLI { $options->registerOption( 'user', 'work as this user. defaults to current CLI user', - 'u' + 'u', + 'username' ); $options->setHelp( 'Utility to help command line Dokuwiki page editing, allow '. @@ -239,6 +240,7 @@ class PageCLI extends DokuCLI { if($this->force) $this->deleteLock($wiki_id); $_SERVER['REMOTE_USER'] = $this->username; + if(checklock($wiki_id)) { $this->error("Page $wiki_id is already locked by another user"); exit(1); @@ -246,7 +248,6 @@ class PageCLI extends DokuCLI { lock($wiki_id); - $_SERVER['REMOTE_USER'] = '_'.$this->username.'_'; if(checklock($wiki_id) != $this->username) { $this->error("Unable to obtain lock for $wiki_id "); var_dump(checklock($wiki_id)); |