diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-12-15 12:28:06 -0800 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-12-15 12:28:06 -0800 |
commit | 9c7b45ec8532e0a08119d979af8572be61349af2 (patch) | |
tree | f228379d81f2556dd2588a39384ff84ac1f782cb | |
parent | 4c3720251253f492b760ad0891c0707da09d9f5d (diff) | |
parent | b053d671002dff76c61d0d1cb8280d59c6e5dbef (diff) | |
download | rpg-9c7b45ec8532e0a08119d979af8572be61349af2.tar.gz rpg-9c7b45ec8532e0a08119d979af8572be61349af2.tar.bz2 |
Merge pull request #436 from rotdrop/master
Provide an XMLRPC logoff method.
-rw-r--r-- | inc/RemoteAPICore.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/inc/RemoteAPICore.php b/inc/RemoteAPICore.php index 2eb8ea403..a26c2d0de 100644 --- a/inc/RemoteAPICore.php +++ b/inc/RemoteAPICore.php @@ -3,7 +3,7 @@ /** * Increased whenever the API is changed */ -define('DOKU_API_VERSION', 8); +define('DOKU_API_VERSION', 9); class RemoteAPICore { @@ -24,6 +24,10 @@ class RemoteAPICore { 'return' => 'int', 'doc' => 'Tries to login with the given credentials and sets auth cookies.', 'public' => '1' + ), 'dokuwiki.logoff' => array( + 'args' => array(), + 'return' => 'int', + 'doc' => 'Tries to logoff by expiring auth cookies and the associated PHP session.' ), 'dokuwiki.getPagelist' => array( 'args' => array('string', 'array'), 'return' => 'array', @@ -767,6 +771,17 @@ class RemoteAPICore { return $ok; } + function logoff(){ + global $conf; + global $auth; + if(!$conf['useacl']) return 0; + if(!$auth) return 0; + + auth_logoff(); + + return 1; + } + private function resolvePageId($id) { $id = cleanID($id); if(empty($id)) { |