diff options
Diffstat (limited to 'inc/RemoteAPICore.php')
-rw-r--r-- | inc/RemoteAPICore.php | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/inc/RemoteAPICore.php b/inc/RemoteAPICore.php index 4c940b39e..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', @@ -88,12 +92,12 @@ class RemoteAPICore { ), 'wiki.getPageInfo' => array( 'args' => array('string'), 'return' => 'array', - 'doc' => 'Returns a struct with infos about the page.', + 'doc' => 'Returns a struct with info about the page.', 'name' => 'pageInfo' ), 'wiki.getPageInfoVersion' => array( 'args' => array('string', 'int'), 'return' => 'array', - 'doc' => 'Returns a struct with infos about the page.', + 'doc' => 'Returns a struct with info about the page.', 'name' => 'pageInfo' ), 'wiki.getPageVersions' => array( 'args' => array('string', 'int'), @@ -136,7 +140,7 @@ class RemoteAPICore { ), 'wiki.getAttachmentInfo' => array( 'args' => array('string'), 'return' => 'array', - 'doc' => 'Returns a struct with infos about the attachment.' + 'doc' => 'Returns a struct with info about the attachment.' ), 'dokuwiki.getXMLRPCAPIVersion' => array( 'args' => array(), 'name' => 'getAPIVersion', @@ -333,7 +337,6 @@ class RemoteAPICore { if (!is_array($options)) $options = array(); $options['skipacl'] = 0; // no ACL skipping for XMLRPC - if(auth_quickaclcheck($ns.':*') >= AUTH_READ) { $dir = utf8_encodeFN(str_replace(':', '/', $ns)); @@ -506,8 +509,8 @@ class RemoteAPICore { } /** - * Returns the permissions of a given wiki page - */ + * Returns the permissions of a given wiki page + */ function aclCheck($id) { $id = $this->resolvePageId($id); return auth_quickaclcheck($id); @@ -768,11 +771,22 @@ 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)) { global $conf; - $id = cleanID($conf['start']); + $id = cleanID($conf['start']); } return $id; } |