summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/remote.php3
-rw-r--r--lib/exe/xmlrpc.php13
2 files changed, 7 insertions, 9 deletions
diff --git a/inc/remote.php b/inc/remote.php
index 6f48d2015..14f6614f1 100644
--- a/inc/remote.php
+++ b/inc/remote.php
@@ -130,4 +130,5 @@ class RemoteAPI {
}
-class RemoteException extends Exception {} \ No newline at end of file
+class RemoteException extends Exception {}
+class RemoteAccessDenied extends RemoteException {} \ No newline at end of file
diff --git a/lib/exe/xmlrpc.php b/lib/exe/xmlrpc.php
index e5e3298ae..cb8dbf42d 100644
--- a/lib/exe/xmlrpc.php
+++ b/lib/exe/xmlrpc.php
@@ -21,6 +21,7 @@ if(!$conf['xmlrpc']) die('XML-RPC server not enabled.');
class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
var $methods = array();
var $public_methods = array();
+ var $remote;
/**
* Checks if the current user is allowed to execute non anonymous methods
@@ -67,6 +68,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
* Constructor. Register methods and run Server
*/
function dokuwiki_xmlrpc_server(){
+ $this->remote = new RemoteAPI();
$this->IXR_IntrospectionServer();
/* DokuWiki's own methods */
@@ -284,16 +286,11 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
* Return a raw wiki page
*/
function rawPage($id,$rev=''){
- $id = cleanID($id);
- if(auth_quickaclcheck($id) < AUTH_READ){
+ try {
+ return $this->remote->rawPage($id, $rev);
+ } catch(RemoteAccessDenied $e) {
return new IXR_Error(1, 'You are not allowed to read this page');
}
- $text = rawWiki($id,$rev);
- if(!$text) {
- return pageTemplate($id);
- } else {
- return $text;
- }
}
/**