about summary refs log tree commit diff stats
path: root/update
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-08-21 13:38:05 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-08-21 13:38:05 +0000
commitf5834cbf384bc295362f0d664195ee1726def10d (patch)
treeed10198c2da832d21be767fc817e817e01334bc7 /update
parent4b1000f89ebfa09c52726af5fe4f614f546aba6b (diff)
downloadinstadisc-f5834cbf384bc295362f0d664195ee1726def10d.tar.gz
instadisc-f5834cbf384bc295362f0d664195ee1726def10d.tar.bz2
instadisc-f5834cbf384bc295362f0d664195ee1726def10d.zip
Update: Added VerID bounce to Library
Refs #44
Diffstat (limited to 'update')
-rw-r--r--update/library/trunk/instadisc.php32
1 files changed, 15 insertions, 17 deletions
diff --git a/update/library/trunk/instadisc.php b/update/library/trunk/instadisc.php index 8a17da0..cfb6473 100644 --- a/update/library/trunk/instadisc.php +++ b/update/library/trunk/instadisc.php
@@ -14,7 +14,7 @@ $idusActivationKey = array();
14$idusEncryptionKey = array(); 14$idusEncryptionKey = array();
15$instaDisc_subCount = 0; 15$instaDisc_subCount = 0;
16 16
17function instaDisc_sendItem($id, $title, $author, $url, $semantics) 17function instaDisc_sendItem($id, $title, $author, $url, $semantics, $encryptionID = 0)
18{ 18{
19 global $idusUsername, $idusPassword, $idusCentralServer, $idusSubscriptionURI; 19 global $idusUsername, $idusPassword, $idusCentralServer, $idusSubscriptionURI;
20 20
@@ -29,13 +29,23 @@ function instaDisc_sendItem($id, $title, $author, $url, $semantics)
29 new xmlrpcval($author, 'string'), 29 new xmlrpcval($author, 'string'),
30 new xmlrpcval($url, 'string'), 30 new xmlrpcval($url, 'string'),
31 new xmlrpcval(serialize($semantics), 'string'), 31 new xmlrpcval(serialize($semantics), 'string'),
32 new xmlrpcval('0', 'int'))); 32 new xmlrpcval($encryptionID, 'int')));
33 $client->send($msg); 33 $resp = $client->send($msg);
34
35 if ($resp->value() == 2)
36 {
37 return instaDisc_sendItem($id, $title, $author, $url, $semantics, $encryptionID);
38 } else if ($resp->value() == 0)
39 {
40 return TRUE;
41 } else {
42 return FALSE;
43 }
34} 44}
35 45
36function instaDisc_sendEncrypted($id, $title, $author, $url, $semantics) 46function instaDisc_sendEncrypted($id, $title, $author, $url, $semantics)
37{ 47{
38 global $idusUsername, $idusPassword, $idusCentralServer, $idusSubscriptionURI, $idusEncryptionKey; 48 global $idusEncryptionKey;
39 49
40 $encID = 0; 50 $encID = 0;
41 while ($encID == 0) 51 while ($encID == 0)
@@ -70,19 +80,7 @@ function instaDisc_sendEncrypted($id, $title, $author, $url, $semantics)
70 80
71 mcrypt_module_close($td); 81 mcrypt_module_close($td);
72 82
73 $verID = rand(1,2147483647); 83 return instaDisc_sendItem($id, $title, $author, $url, $semantics, $encID);
74
75 $client = new xmlrpc_client($idusCentralServer[$id]);
76 $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval($idusUsername[$id], 'string'),
77 new xmlrpcval(md5($idusUsername[$id] . ":" . md5($idusPassword[$id]) . ":" . $verID), 'string'),
78 new xmlrpcval($verID, 'int'),
79 new xmlrpcval($idusSubscriptionURI[$id], 'string'),
80 new xmlrpcval($title, 'string'),
81 new xmlrpcval($author, 'string'),
82 new xmlrpcval($url, 'string'),
83 new xmlrpcval(serialize($semantics), 'string'),
84 new xmlrpcval($encID, 'int')));
85 $client->send($msg);
86} 84}
87 85
88function instaDisc_addSubscription($username, $password, $central, $uri, $title, $category, $key = '', $enc = '') 86function instaDisc_addSubscription($username, $password, $central, $uri, $title, $category, $key = '', $enc = '')