Skip to content
Snippets Groups Projects
Commit fdd2e9d6 authored by Michael Klier's avatar Michael Klier
Browse files

added config option to enable/disable the XML-RPC interface

darcs-hash:20080227213050-23886-e55353ab04f9d23675ec11a9e97ba6affec719fc.gz
parent 2e7e0c29
No related branches found
No related tags found
No related merge requests found
......@@ -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'] = '';
......
......@@ -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();
......
......@@ -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';
......
......@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment