127 lines
3.9 KiB
Diff
127 lines
3.9 KiB
Diff
|
Index: .htaccess
|
||
|
===================================================================
|
||
|
RCS file: /cvs/drupal/drupal/.htaccess,v
|
||
|
retrieving revision 1.90.2.3
|
||
|
diff -u -p -r1.90.2.3 .htaccess
|
||
|
--- .htaccess 10 Dec 2008 20:04:08 -0000 1.90.2.3
|
||
|
+++ .htaccess 3 Aug 2009 22:38:00 -0000
|
||
|
@@ -100,10 +100,13 @@ DirectoryIndex index.php
|
||
|
# uncomment the following line:
|
||
|
# RewriteBase /
|
||
|
|
||
|
+ RewriteRule ^xmlrpc/([0-9]+)/?$ xmlrpc.php?version=$1 [L]
|
||
|
+
|
||
|
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
|
||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||
|
RewriteCond %{REQUEST_URI} !=/favicon.ico
|
||
|
+ RewriteCond %{REQUEST_URI} !=/xmlrpc(.*)
|
||
|
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
|
||
|
</IfModule>
|
||
|
|
||
|
Index: xmlrpc.php
|
||
|
===================================================================
|
||
|
RCS file: /cvs/drupal/drupal/xmlrpc.php,v
|
||
|
retrieving revision 1.15
|
||
|
diff -u -p -r1.15 xmlrpc.php
|
||
|
--- xmlrpc.php 10 Dec 2005 19:26:47 -0000 1.15
|
||
|
+++ xmlrpc.php 3 Aug 2009 22:38:00 -0000
|
||
|
@@ -6,9 +6,77 @@
|
||
|
* PHP page for handling incoming XML-RPC requests from clients.
|
||
|
*/
|
||
|
|
||
|
+// define xmlrpc method location
|
||
|
+define('XMLRPC_PATH', 'sites/all/modules');
|
||
|
+define('XMLRPC_MODULE', 'logger');
|
||
|
+define('XMLRPC_FILE', 'xmlrpc');
|
||
|
+
|
||
|
+// defined xmlrpc endpoints
|
||
|
+$xmlrpc_versions = array('', 1);
|
||
|
+
|
||
|
+// any common.inc or other core functions that xmlrpc processing relies upon
|
||
|
+function t($string, $args = array(), $langcode = NULL) {
|
||
|
+ if (empty($args)) {
|
||
|
+ return $string;
|
||
|
+ }
|
||
|
+ else {
|
||
|
+ // Transform arguments before inserting them.
|
||
|
+ foreach ($args as $key => $value) {
|
||
|
+ switch ($key[0]) {
|
||
|
+ case '@':
|
||
|
+ case '%':
|
||
|
+ default:
|
||
|
+ // Escaped only.
|
||
|
+ $args[$key] = check_plain($value);
|
||
|
+ break;
|
||
|
+
|
||
|
+ case '!':
|
||
|
+ // Pass-through.
|
||
|
+ }
|
||
|
+ }
|
||
|
+ return strtr($string, $args);
|
||
|
+ }
|
||
|
+}
|
||
|
+
|
||
|
+function watchdog_xmlrpc($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) {
|
||
|
+ global $base_root;
|
||
|
+
|
||
|
+ $current_db = db_set_active();
|
||
|
+
|
||
|
+ db_query("INSERT INTO {watchdog}
|
||
|
+ (type, message, variables, severity, link, location, referer, hostname, timestamp)
|
||
|
+ VALUES
|
||
|
+ ('%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', %d)",
|
||
|
+ $type,
|
||
|
+ $message,
|
||
|
+ serialize($variables),
|
||
|
+ $severity,
|
||
|
+ $link,
|
||
|
+ $base_root . request_uri(),
|
||
|
+ referer_uri(),
|
||
|
+ ip_address(),
|
||
|
+ time());
|
||
|
+
|
||
|
+ if ($current_db) {
|
||
|
+ db_set_active($current_db);
|
||
|
+ }
|
||
|
+}
|
||
|
+
|
||
|
+
|
||
|
include_once './includes/bootstrap.inc';
|
||
|
-drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
|
||
|
+drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
|
||
|
include_once './includes/xmlrpc.inc';
|
||
|
include_once './includes/xmlrpcs.inc';
|
||
|
|
||
|
-xmlrpc_server(module_invoke_all('xmlrpc'));
|
||
|
+if (in_array($_REQUEST['version'], $xmlrpc_versions)) {
|
||
|
+ require_once XMLRPC_PATH . '/' . XMLRPC_MODULE . '/' . XMLRPC_FILE . $_REQUEST['version'] . '.inc';
|
||
|
+
|
||
|
+ //debugging watchdog_xmlrpc('xmlrpc', 'xmlrpc api called with version %version', array('%version' => $_REQUEST['version']), WATCHDOG_DEBUG);
|
||
|
+
|
||
|
+ $function = XMLRPC_MODULE . '_xmlrpc';
|
||
|
+ $callbacks = $function();
|
||
|
+ xmlrpc_server($callbacks);
|
||
|
+}
|
||
|
+else {
|
||
|
+ xmlrpc_server_error(-32601, t('Server error. Requested method version (@version) not specified.', array("@version" => $_REQUEST['version'])));
|
||
|
+}
|
||
|
Index: includes/menu.inc
|
||
|
===================================================================
|
||
|
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
|
||
|
retrieving revision 1.255.2.31
|
||
|
diff -u -p -r1.255.2.31 menu.inc
|
||
|
--- includes/menu.inc 27 Apr 2009 12:50:13 -0000 1.255.2.31
|
||
|
+++ includes/menu.inc 3 Aug 2009 22:38:02 -0000
|
||
|
@@ -1422,8 +1422,8 @@ function menu_local_tasks($level = 0, $r
|
||
|
return $root_path;
|
||
|
}
|
||
|
else {
|
||
|
- // We do not display single tabs.
|
||
|
- return (isset($tabs[$level]) && $tabs[$level]['count'] > 1) ? $tabs[$level]['output'] : '';
|
||
|
+ // We do not display single tabs: BVDM yes we do for flukso!
|
||
|
+ return (isset($tabs[$level])) ? $tabs[$level]['output'] : '';
|
||
|
}
|
||
|
}
|
||
|
|