summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/exe/xmlrpc.php21
-rw-r--r--lib/plugins/config/lang/en/lang.php1
-rw-r--r--lib/plugins/config/settings/config.metadata.php1
3 files changed, 13 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();
diff --git a/lib/plugins/config/lang/en/lang.php b/lib/plugins/config/lang/en/lang.php
index 79413841e..28aefaa59 100644
--- a/lib/plugins/config/lang/en/lang.php
+++ b/lib/plugins/config/lang/en/lang.php
@@ -125,6 +125,7 @@ $lang['send404'] = 'Send "HTTP 404/Page Not Found" for non existing pages';
$lang['sitemap'] = 'Generate Google sitemap (days)';
$lang['broken_iua'] = 'Is the ignore_user_abort function broken on your system? This could cause a non working search index. IIS+PHP/CGI is known to be broken. See <a href="http://bugs.splitbrain.org/?do=details&amp;task_id=852">Bug 852</a> for more info.';
$lang['xsendfile'] = 'Use the X-Sendfile header to let the webserver deliver static files? Your webserver needs to support this.';
+$lang['xmlrpc'] = 'Enable/disable XML-RPC interface.';
$lang['rss_type'] = 'XML feed type';
$lang['rss_linkto'] = 'XML feed links to';
diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php
index 099848b94..1d235d45e 100644
--- a/lib/plugins/config/settings/config.metadata.php
+++ b/lib/plugins/config/settings/config.metadata.php
@@ -172,6 +172,7 @@ $meta['recent_days'] = array('numeric');
$meta['rss_show_summary'] = array('onoff');
$meta['broken_iua'] = array('onoff');
$meta['xsendfile'] = array('multichoice','_choices' => array(0,1,2));
+$meta['xmlrpc'] = array('onoff');
$meta['_network'] = array('fieldset');
$meta['proxy____host'] = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');