about summary refs log tree commit diff stats
path: root/series/trunk
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-09-13 13:33:19 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-09-13 13:33:19 +0000
commit970ec85cad2cc833f0ba4c9e9488952b9aa33575 (patch)
tree51ef2401ee57f1ab447b86d14814ff359d4be5c4 /series/trunk
parentd8bcb026d87ebd56ea57e25ba27170c8aa7fb5d1 (diff)
downloadinstadisc-970ec85cad2cc833f0ba4c9e9488952b9aa33575.tar.gz
instadisc-970ec85cad2cc833f0ba4c9e9488952b9aa33575.tar.bz2
instadisc-970ec85cad2cc833f0ba4c9e9488952b9aa33575.zip
Series: Integrated Update
Refs #55
Diffstat (limited to 'series/trunk')
-rw-r--r--series/trunk/instadisc.sql20
-rw-r--r--series/trunk/xmlrpc.php29
2 files changed, 46 insertions, 3 deletions
diff --git a/series/trunk/instadisc.sql b/series/trunk/instadisc.sql index 8954446..4c9a816 100644 --- a/series/trunk/instadisc.sql +++ b/series/trunk/instadisc.sql
@@ -3,7 +3,7 @@
3-- http://www.phpmyadmin.net 3-- http://www.phpmyadmin.net
4-- 4--
5-- Host: localhost 5-- Host: localhost
6-- Generation Time: Sep 06, 2008 at 05:38 PM 6-- Generation Time: Sep 13, 2008 at 09:16 AM
7-- Server version: 5.0.51 7-- Server version: 5.0.51
8-- PHP Version: 5.2.4-2ubuntu5.3 8-- PHP Version: 5.2.4-2ubuntu5.3
9-- 9--
@@ -38,7 +38,23 @@ CREATE TABLE `subscriptions` (
38 `category` varchar(255) NOT NULL, 38 `category` varchar(255) NOT NULL,
39 `password` varchar(255) NOT NULL, 39 `password` varchar(255) NOT NULL,
40 `personal` varchar(5) NOT NULL, 40 `personal` varchar(5) NOT NULL,
41 `username` varchar(255) NOT NULL,
42 `lastUpdated` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
41 PRIMARY KEY (`id`), 43 PRIMARY KEY (`id`),
42 UNIQUE KEY `identity` (`identity`,`url`) 44 UNIQUE KEY `identity` (`identity`,`url`)
43) ENGINE=MyISAM DEFAULT CHARSET=latin1; 45) ENGINE=MyISAM DEFAULT CHARSET=latin1;
46
47-- --------------------------------------------------------
48
49--
50-- Table structure for table `users`
51--
52
53DROP TABLE IF EXISTS `users`;
54CREATE TABLE `users` (
55 `id` int(11) NOT NULL auto_increment,
56 `username` varchar(255) NOT NULL,
57 `password` varchar(255) NOT NULL,
58 PRIMARY KEY (`id`)
59) ENGINE=MyISAM DEFAULT CHARSET=latin1;
44 60
diff --git a/series/trunk/xmlrpc.php b/series/trunk/xmlrpc.php index 9024ae2..7bb7f10 100644 --- a/series/trunk/xmlrpc.php +++ b/series/trunk/xmlrpc.php
@@ -39,7 +39,34 @@ function sendFromUpdate($username, $verification, $verificationID, $seriesURL, $
39{ 39{
40 if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) 40 if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password'))
41 { 41 {
42 42 $getsub = "SELECT * FROM subscriptions WHERE identity = \"" . mysql_real_escape_string($seriesID) . "\"";
43 $getsub2 = mysql_query($getsub);
44 $getsub3 = mysql_fetch_array($getsub2);
45 if ($getsub3['identity'] == $seriesID)
46 {
47 if ($getsub3['username'] != $username)
48 {
49 return new xmlrpcresp(new xmlrpcval('1', 'int'));
50 }
51
52 $setsub = "UPDATE subscriptions SET title = \"" . mysql_real_escape_string($subscriptionTitle) . "\", url = \"" . mysql_real_escape_string($subscriptionURL) . "\", category = \"" . mysql_real_escape_string($subscriptionCategory) . "\", personal = \"" . mysql_real_escape_string($subscriptionPersonal) . "\"";
53 $setsub2 = mysql_query($setsub);
54 } else {
55 $inssub = "INSERT INTO subscriptions (identity, title, url, category, personal, username) VALUES (\"" . mysql_real_escape_string($seriesID) . "\",\"" . mysql_real_escape_string($subscriptionTitle) . "\",\"" . mysql_real_escape_string($subscriptionURL) . "\",\"" . mysql_real_escape_string($subscriptionCategory) . "\",\"" . mysql_real_escape_string($subscriptionPersonal) . "\",\"" . mysql_real_escape_string($username) . "\")";
56 $inssub2 = mysql_query($inssub);
57 }
58
59 $client = xmlrpc_client('http://central.fourisland.com/xmlrpc.php');
60 $msg = new xmlrpcmsg("InstaDisc.sendFromSeries", array( new xmlrpcval($seriesURL, 'string'),
61 new xmlrpcval($seriesID, 'string'),
62 new xmlrpcval($title, 'string'),
63 new xmlrpcval($author, 'string'),
64 new xmlrpcval($url, 'string'),
65 new xmlrpcval($semantics, 'string'),
66 new xmlrpcval($encryptionID, 'int')));
67 $client->send($msg);
68
69 return new xmlrpcresp(new xmlrpcval('0', 'int'));
43 } else { 70 } else {
44 return new xmlrpcresp(new xmlrpcval('2', 'int')); 71 return new xmlrpcresp(new xmlrpcval('2', 'int'));
45 } 72 }