diff options
-rw-r--r-- | update/library/trunk/instadisc.php | 32 |
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 | ||
17 | function instaDisc_sendItem($id, $title, $author, $url, $semantics) | 17 | function 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 | ||
36 | function instaDisc_sendEncrypted($id, $title, $author, $url, $semantics) | 46 | function 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 | ||
88 | function instaDisc_addSubscription($username, $password, $central, $uri, $title, $category, $key = '', $enc = '') | 86 | function instaDisc_addSubscription($username, $password, $central, $uri, $title, $category, $key = '', $enc = '') |