summaryrefslogtreecommitdiff
path: root/lib/exe
diff options
context:
space:
mode:
authorMichael Klier <chi@chimeric.de>2008-02-27 22:30:50 +0100
committerMichael Klier <chi@chimeric.de>2008-02-27 22:30:50 +0100
commitfdd2e9d64295969d5945f11cb7d457aa599a028f (patch)
tree595de618f0c6c33a2fbec138c821bd65cd0e6519 /lib/exe
parent2e7e0c29470f3fa18c7ae16df80c17da12fde5ed (diff)
downloadrpg-fdd2e9d64295969d5945f11cb7d457aa599a028f.tar.gz
rpg-fdd2e9d64295969d5945f11cb7d457aa599a028f.tar.bz2
added config option to enable/disable the XML-RPC interface
darcs-hash:20080227213050-23886-e55353ab04f9d23675ec11a9e97ba6affec719fc.gz
Diffstat (limited to 'lib/exe')
-rw-r--r--lib/exe/xmlrpc.php21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/exe/xmlrpc.php b/lib/exe/xmlrpc.php
index b0ec1df02..e43394e50 100644
--- a/lib/exe/xmlrpc.php
+++ b/lib/exe/xmlrpc.php
@@ -5,10 +5,12 @@ if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../');
if(isset($HTTP_RAW_POST_DATA)) $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA);
-//EXPERIMENTAL CODE
-die('remove me to get it work');
-
require_once(DOKU_INC.'inc/init.php');
+
+if(!$conf['xmlrpc']) {
+ die('XML-RPC server not enabled.');
+}
+
require_once(DOKU_INC.'inc/common.php');
require_once(DOKU_INC.'inc/auth.php');
session_write_close(); //close session
@@ -33,7 +35,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
'dokuwiki.getVersion',
'getVersion',
array('string'),
- 'Returns the running DokuWiki version'
+ 'Returns the running DokuWiki version.'
);
/* Wiki API v2 http://www.jspwiki.org/wiki/WikiRPCInterface2 */
@@ -41,7 +43,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
'wiki.getRPCVersionSupported',
'this:wiki_RPCVersion',
array('int'),
- 'Returns 2 with the supported RPC API version'
+ 'Returns 2 with the supported RPC API version.'
);
$this->addCallback(
'wiki.getPage',
@@ -95,13 +97,13 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
'wiki.putPage',
'this:putPage',
array('int', 'string', 'string', 'struct'),
- 'Saves a wiki page'
+ 'Saves a wiki page.'
);
$this->addCallback(
'wiki.listLinks',
'this:listLinks',
array('struct','string'),
- 'Lists all links contained in a wiki page'
+ 'Lists all links contained in a wiki page.'
);
$this->addCallback(
'wiki.getRecentChanges',
@@ -188,7 +190,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
$minor = $params['minor'];
if(empty($id))
- return new IXR_Error(1, 'Empty Page ID');
+ return new IXR_Error(1, 'Empty page ID');
if(auth_quickaclcheck($id) < AUTH_WRITE)
return new IXR_Error(1, 'You are not allowed to edit this page');
@@ -198,7 +200,7 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
return new IXR_Error(1, 'The page is currently locked');
if(empty($TEXT))
- return new IXR_Error(1, 'No Text supplied');
+ return new IXR_Error(1, 'No text supplied');
//spam check
if(checkwordblock())
@@ -337,7 +339,6 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer {
function wiki_RPCVersion(){
return 2;
}
-
}
$server = new dokuwiki_xmlrpc_server();