Update of /cvsroot/php-blog/jBlog
In directory sc8-pr-cvs1:/tmp/cvs-serv16876
Modified Files:
jBlog-xmlrpc.php
Log Message:
pure blogger support for Sterling
Index: jBlog-xmlrpc.php
===================================================================
RCS file: /cvsroot/php-blog/jBlog/jBlog-xmlrpc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- jBlog-xmlrpc.php 10 Mar 2003 05:55:08 -0000 1.3
+++ jBlog-xmlrpc.php 10 Mar 2003 06:03:26 -0000 1.4
@@ -7,6 +7,10 @@
array('function' => 'blogger_getUsersBlogs'),
'blogger.getUserInfo' =>
array('function' => 'blogger_getUserInfo'),
+ 'blogger.newPost' =>
+ array('function' => 'blogger_newPost'),
+ 'blogger.editPost' =>
+ array('function' => 'blogger_editPost'),
'metaWeblog.newPost' =>
array('function' => 'metaWeblog_newPost'),
'metaWeblog.editPost' =>
@@ -116,6 +120,40 @@
return new XML_RPC_Response('', 4, "Authentication Failed");
}
return new XML_RPC_Response( new XML_RPC_Value(array(), 'array'));
+}
+
+function blogger_newPost($message)
+{
+ $val = $message->params[2];
+ $username = $val->getval();
+ $val = $message->params[3];
+ $password = $val->getval();
+ if(!jBlog_authenticate_author($username, $password)) {
+ return new XML_RPC_Response('', 4, "Authentication Failed");
+ }
+ $val = $message->params[4];
+ $entry['body'] = $val->getval();
+ $entry['user'] = $username;
+ $id = jBlog_updertEntry($entry);
+ return new XML_RPC_Response( new XML_RPC_Value($id, 'string'));
+}
+
+function blogger_newPost($message)
+{
+ $val = $message->params[1];
+ $entry['id'] = $val->getval();
+ $val = $message->params[2];
+ $username = $val->getval();
+ $val = $message->params[3];
+ $password = $val->getval();
+ if(!jBlog_authenticate_author($username, $password)) {
+ return new XML_RPC_Response('', 4, "Authentication Failed");
+ }
+ $val = $message->params[4];
+ $entry['body'] = $val->getval();
+ $entry['user'] = $username;
+ $id = jBlog_updertEntry($entry);
+ return new XML_RPC_Response( new XML_RPC_Value($id, 'string'));
}
function metaWeblog_newPost($message)
|