diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php index 723d44de7d51179a68c1a0bfa31b7ae234f0c890..9cfdb5c3bcaa3c6f938b5a0c78179e29dd55ba59 100644 --- a/conf/dokuwiki.php +++ b/conf/dokuwiki.php @@ -118,6 +118,7 @@ $conf['recent_days'] = 7; //How many days of recent changes to ke $conf['rss_show_summary'] = 1; //Add revision summary to title? 0|1 $conf['broken_iua'] = 0; //Platform with broken ignore_user_abort (IIS+CGI) 0|1 $conf['xsendfile'] = 0; //Use X-Sendfile (1 = lighttpd, 2 = standard) +$conf['xmlrpc'] = 0; //Enable/disable XML-RPC interface //Set target to use when creating links - leave empty for same window $conf['target']['wiki'] = ''; diff --git a/lib/exe/xmlrpc.php b/lib/exe/xmlrpc.php index b0ec1df02027651c83e2c90985f9ebfb2e07078a..e43394e5017549b10005c61e67f6d58fd12b4b7e 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 79413841ecfdd7d19ce10913453f08c03387ff32..28aefaa59b4fb7f2e57b972eb295256af554f767 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&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 099848b94fdd48354b4cbdb3f28b91fd423a0bc1..1d235d45e712f0f166722dcf085b0190ac818fd7 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');