Update of /cvsroot/php-blog/jBlog
In directory sc8-pr-cvs1:/tmp/cvs-serv10495
Modified Files:
jBlog-xmlrpc.php
Log Message:
added support for metaweblog.newMediaObject
Index: jBlog-xmlrpc.php
===================================================================
RCS file: /cvsroot/php-blog/jBlog/jBlog-xmlrpc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- jBlog-xmlrpc.php 13 Mar 2003 03:35:59 -0000 1.6
+++ jBlog-xmlrpc.php 13 Mar 2003 05:50:12 -0000 1.7
@@ -25,6 +25,8 @@
array('function' => 'metaWeblog_setPostCategories'),
'metaWeblog.getPostCategories' =>
array('function' => 'metaWeblog_getPostCategories'),
+ 'metaWeblog.newMediaObject' =>
+ array('function' => 'metaWeblog_newMediaObject'),
'mt.supportedTextFilters' =>
array('function' => 'mt_supportedTextFilters'));
@@ -272,6 +274,27 @@
return new XML_RPC_Response('', 4, "Authentication Failed");
}
return new XML_RPC_Response( new XML_RPC_Value(array(), 'array'));
+}
+
+function metaWeblog_newMediaObject($message)
+{
+ global $jBlog;
+ $val = $message->params[0];
+ $postid = $val->getval();
+ $val = $message->params[1];
+ $username = $val->getval();
+ $val = $message->params[2];
+ $password = $val->getval();
+ $val = $message->params[3];
+ $struct = $val->getval();
+ if(!jBlog_authenticate_author($username, $password)) {
+ return new XML_RPC_Response('', 4, "Authentication Failed");
+ }
+ $fp = fopen($struct['name'], "w");
+ fwrite($fp, $struct['bits']);
+ fclose($fp);
+ $path = $jBlog["baseURL"].$struct['name'];
+ return new XML_RPC_Response( new XML_RPC_Value(array('url' => new XML_RPC_Value($path, 'string')), 'struct'));
}
/*
$fp = fopen("/tmp/kung-log", "a");
|