about summary refs log tree commit diff stats
path: root/central
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
parentff9420cbde416fa022b6726b643bbad3c2d38659 (diff)
downloadinstadisc-2c33a04e24aefdb75d35841f976875c693893973.tar.gz
instadisc-2c33a04e24aefdb75d35841f976875c693893973.tar.bz2
instadisc-2c33a04e24aefdb75d35841f976875c693893973.zip
Central: Moved to Series
Refs #28
Diffstat (limited to 'central')
-rw-r--r--central/trunk/includes/instadisc.php15
-rw-r--r--central/trunk/theme/userpanel.tpl6
-rw-r--r--central/trunk/xmlrpc.php57
3 files changed, 45 insertions, 33 deletions
diff --git a/central/trunk/includes/instadisc.php b/central/trunk/includes/instadisc.php index 3f3922a..f35d021 100644 --- a/central/trunk/includes/instadisc.php +++ b/central/trunk/includes/instadisc.php
@@ -277,4 +277,19 @@ function instaDisc_changePassword($username, $password)
277 $setpass2 = mysql_query($setpass); 277 $setpass2 = mysql_query($setpass);
278} 278}
279 279
280function instaDisc_resolveSubscription($seriesURL, $id)
281{
282 $client = new xmlrpc_client($seriesURL);
283 $msg = new xmlrpcmsg('InstaDisc.subscriptionInfo', array( new xmlrpcval($id, 'string')));
284 $resp = $client->send($msg);
285 $val = $resp->value()->scalarVal();
286
287 if ($val == 'false')
288 {
289 return 'false';
290 } else {
291 return unserialize($val);
292 }
293}
294
280?> 295?>
diff --git a/central/trunk/theme/userpanel.tpl b/central/trunk/theme/userpanel.tpl index 37d5ec0..cde93d4 100644 --- a/central/trunk/theme/userpanel.tpl +++ b/central/trunk/theme/userpanel.tpl
@@ -14,12 +14,6 @@
14 <LI><A HREF="logout.php">Log out</A></LI> 14 <LI><A HREF="logout.php">Log out</A></LI>
15 </UL> 15 </UL>
16 16
17 <P>If you own a subscription and wish to have this Central Server sponser it, you can use the option below:
18
19 <UL>
20 <LI><A HREF="setSeries.php">Set Series Control URL</A></LI>
21 </UL>
22
23 <!--BEGIN ADMIN--> 17 <!--BEGIN ADMIN-->
24 <P>Since you are the almighty admin of this Central Server, you can edit configurational values! 18 <P>Since you are the almighty admin of this Central Server, you can edit configurational values!
25 19
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 }