about summary refs log tree commit diff stats
path: root/central/trunk/xmlrpc.php
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-09-06 22:22:05 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-09-06 22:22:05 +0000
commit2c33a04e24aefdb75d35841f976875c693893973 (patch)
tree99ff78c788cf00be5ef17b22c7687d7d872d6413 /central/trunk/xmlrpc.php
parentff9420cbde416fa022b6726b643bbad3c2d38659 (diff)
downloadinstadisc-2c33a04e24aefdb75d35841f976875c693893973.tar.gz
instadisc-2c33a04e24aefdb75d35841f976875c693893973.tar.bz2
instadisc-2c33a04e24aefdb75d35841f976875c693893973.zip
Central: Moved to Series
Refs #28
Diffstat (limited to 'central/trunk/xmlrpc.php')
-rw-r--r--central/trunk/xmlrpc.php57
1 files changed, 30 insertions, 27 deletions
diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index 64dc4f7..48f1e5e 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php
@@ -79,36 +79,39 @@ function sendFromUpdate($username, $verification, $verificationID, $subscription
79{ 79{
80 if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) 80 if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password'))
81 { 81 {
82 $cserver = $_SERVER['SERVER_NAME']; 82 if (instaDisc_resolveSubscription($subscriptionSeriesURL, $subscriptionID) != 'false')
83 $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_real_escape_string($cserver) . "\"";
84 $getuk2 = mysql_query($getuk);
85 $getuk3 = mysql_fetch_array($getuk2);
86
87 $getcs = "SELECT * FROM centralServers";
88 $getcs2 = mysql_query($getcs);
89 $i=0;
90 while ($getcs3[$i] = mysql_fetch_array($getcs2))
91 { 83 {
92 $verID = rand(1,2147483647); 84 $cserver = $_SERVER['SERVER_NAME'];
85 $getuk = "SELECT * FROM centralServers WHERE url = \"" . mysql_real_escape_string($cserver) . "\"";
86 $getuk2 = mysql_query($getuk);
87 $getuk3 = mysql_fetch_array($getuk2);
93 88
94 $client = new xmlrpc_client($getcs3[$i]['xmlrpc']); 89 $getcs = "SELECT * FROM centralServers";
95 $msg = new xmlrpcmsg("InstaDisc.sendFromCentral", array( new xmlrpcval($cserver, 'string'), 90 $getcs2 = mysql_query($getcs);
96 new xmlrpcval(md5($cserver . ":" . $getuk3['code'] . ":" . $verID), 'string'), 91 $i=0;
97 new xmlrpcval($verID, 'int'), 92 while ($getcs3[$i] = mysql_fetch_array($getcs2))
98 new xmlrpcval($subscriptionSeriesURL, 'string'), 93 {
99 new xmlrpcval($subscriptionID, 'string'), 94 $verID = rand(1,2147483647);
100 new xmlrpcval($title, 'string'), 95
101 new xmlrpcval($author, 'string'), 96 $client = new xmlrpc_client($getcs3[$i]['xmlrpc']);
102 new xmlrpcval($url, 'string'), 97 $msg = new xmlrpcmsg("InstaDisc.sendFromCentral", array( new xmlrpcval($cserver, 'string'),
103 new xmlrpcval($semantics, 'string'), 98 new xmlrpcval(md5($cserver . ":" . $getuk3['code'] . ":" . $verID), 'string'),
104 new xmlrpcval($encryptionID, 'int'), 99 new xmlrpcval($verID, 'int'),
105 new xmlrpcval(instaDisc_getConfig('softwareVersion'), 'int'), 100 new xmlrpcval($subscriptionSeriesURL, 'string'),
106 new xmlrpcval(instaDisc_getConfig('databaseVersion'), 'int'))); 101 new xmlrpcval($subscriptionID, 'string'),
107 $client->send($msg); 102 new xmlrpcval($title, 'string'),
108 $i++; 103 new xmlrpcval($author, 'string'),
109 } 104 new xmlrpcval($url, 'string'),
105 new xmlrpcval($semantics, 'string'),
106 new xmlrpcval($encryptionID, 'int'),
107 new xmlrpcval(instaDisc_getConfig('softwareVersion'), 'int'),
108 new xmlrpcval(instaDisc_getConfig('databaseVersion'), 'int')));
109 $client->send($msg);
110 $i++;
111 }
110 112
111 return new xmlrpcresp(new xmlrpcval(0, "int")); 113 return new xmlrpcresp(new xmlrpcval(0, "int"));
114 }
112 } else { 115 } else {
113 return new xmlrpcresp(new xmlrpcval(2, "int")); 116 return new xmlrpcresp(new xmlrpcval(2, "int"));
114 } 117 }