From c63d16452935332d3389db45f1ec3f5ab940a0c5 Mon Sep 17 00:00:00 2001 From: Gina Haeussge Date: Sat, 23 Aug 2008 19:31:52 +0200 Subject: XMLRPC: Cleanup in callback registrations darcs-hash:20080823173152-2b4f5-8aaed82a8122f0901878326fc17a889c22bc1b79.gz --- lib/exe/xmlrpc.php | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/lib/exe/xmlrpc.php b/lib/exe/xmlrpc.php index f02c7e107..491660c97 100644 --- a/lib/exe/xmlrpc.php +++ b/lib/exe/xmlrpc.php @@ -79,7 +79,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { $this->addCallback( 'wiki.getAttachments', 'this:listAttachments', - array('string', 'struct'), + array('struct', 'string', 'struct'), 'Returns a list of all media files.' ); $this->addCallback( @@ -125,28 +125,28 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { 'Returns a strukt about all recent changes since given timestamp.' ); $this->addCallback( - 'wiki.aclCheck', - 'this:aclCheck', - array('struct', 'string'), - 'Returns the permissions of a given wiki page.' + 'wiki.aclCheck', + 'this:aclCheck', + array('int', 'string'), + 'Returns the permissions of a given wiki page.' ); $this->addCallback( - 'wiki.putAttachment', - 'this:putAttachment', - array('struct', 'string', 'base64', 'struct'), - 'Upload a file to the wiki.' + 'wiki.putAttachment', + 'this:putAttachment', + array('struct', 'string', 'base64', 'struct'), + 'Upload a file to the wiki.' ); $this->addCallback( - 'wiki.getAttachment', - 'this:getAttachment', - array('string'), - 'Download a file from the wiki.' + 'wiki.getAttachment', + 'this:getAttachment', + array('base64', 'string'), + 'Download a file from the wiki.' ); $this->addCallback( - 'wiki.getAttachmentInfo', - 'this:getAttachmentInfo', - array('string'), - 'Returns a struct with infos about the attachment.' + 'wiki.getAttachmentInfo', + 'this:getAttachmentInfo', + array('struct', 'string'), + 'Returns a struct with infos about the attachment.' ); $this->serve(); @@ -170,8 +170,11 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { /** * Return a media file encoded in base64 + * + * @author Gina Haeussge */ function getAttachment($id){ + $id = cleanID($id); if (auth_quickaclcheck(getNS($id).':*') < AUTH_READ) return new IXR_Error(1, 'You are not allowed to read this file'); -- cgit v1.2.3