about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--central/trunk/instadisc.php9
-rw-r--r--central/trunk/instadisc.sql1
-rw-r--r--central/trunk/xmlrpc.php7
3 files changed, 12 insertions, 5 deletions
diff --git a/central/trunk/instadisc.php b/central/trunk/instadisc.php index 4c12a39..75a9bf1 100644 --- a/central/trunk/instadisc.php +++ b/central/trunk/instadisc.php
@@ -80,6 +80,11 @@ function instaDisc_sendItem($username, $id)
80 $out .= $name . ': ' . $value . "\r\n"; 80 $out .= $name . ': ' . $value . "\r\n";
81 } 81 }
82 82
83 if ($getitem3['encryptionID'] != 0)
84 {
85 $out .= 'Encryption-ID: ' . $getitem3['encryptionID'] . "\r\n";
86 }
87
83 $out .= "\r\n\r\n"; 88 $out .= "\r\n\r\n";
84 89
85 fwrite($fp, $out); 90 fwrite($fp, $out);
@@ -132,7 +137,7 @@ function instaDisc_sendDatabase($cserver)
132 $client->send($msg); 137 $client->send($msg);
133} 138}
134 139
135function instaDisc_addItem($username, $subscription, $title, $author, $url, $semantics) 140function instaDisc_addItem($username, $subscription, $title, $author, $url, $semantics, $encryptionID)
136{ 141{
137 $getuser = "SELECT * FROM users WHERE username = \"" . mysql_real_escape_string($username) . "\""; 142 $getuser = "SELECT * FROM users WHERE username = \"" . mysql_real_escape_string($username) . "\"";
138 $getuser2 = mysql_query($getuser); 143 $getuser2 = mysql_query($getuser);
@@ -143,7 +148,7 @@ function instaDisc_addItem($username, $subscription, $title, $author, $url, $sem
143 $setuser = "UPDATE users SET nextItemID = nextItemID+1 WHERE username = \"" . mysql_real_escape_string($username) . "\""; 148 $setuser = "UPDATE users SET nextItemID = nextItemID+1 WHERE username = \"" . mysql_real_escape_string($username) . "\"";
144 $setuser2 = mysql_query($setuser); 149 $setuser2 = mysql_query($setuser);
145 150
146 $insitem = "INSERT INTO inbox (username, itemID, subscription, title, author, url, semantics) VALUES (\"" . mysql_real_escape_string($username) . "\", " . $itemID . ", \"" . mysql_real_escape_string($subscription) . "\", \"" . mysql_real_escape_string($title) . "\", \"" . mysql_real_escape_string($author) . "\", \"" . mysql_real_escape_string($url) . "\", \"" . mysql_real_escape_string($semantics) . "\")"; 151 $insitem = "INSERT INTO inbox (username, itemID, subscription, title, author, url, semantics, encryptionID) VALUES (\"" . mysql_real_escape_string($username) . "\", " . $itemID . ", \"" . mysql_real_escape_string($subscription) . "\", \"" . mysql_real_escape_string($title) . "\", \"" . mysql_real_escape_string($author) . "\", \"" . mysql_real_escape_string($url) . "\", \"" . mysql_real_escape_string($semantics) . "\",\" . $encryptionID . "\")";
147 $insitem2 = mysql_query($insitem); 152 $insitem2 = mysql_query($insitem);
148 153
149 instaDisc_sendItem($username, $itemID); 154 instaDisc_sendItem($username, $itemID);
diff --git a/central/trunk/instadisc.sql b/central/trunk/instadisc.sql index ec42c64..2019503 100644 --- a/central/trunk/instadisc.sql +++ b/central/trunk/instadisc.sql
@@ -52,6 +52,7 @@ CREATE TABLE IF NOT EXISTS `inbox` (
52 `author` varchar(255) NOT NULL, 52 `author` varchar(255) NOT NULL,
53 `url` varchar(255) NOT NULL, 53 `url` varchar(255) NOT NULL,
54 `semantics` text NOT NULL, 54 `semantics` text NOT NULL,
55 `encryptionID` int(11) NOT NULL,
55 PRIMARY KEY (`id`) 56 PRIMARY KEY (`id`)
56) ENGINE=MyISAM DEFAULT CHARSET=latin1; 57) ENGINE=MyISAM DEFAULT CHARSET=latin1;
57 58
diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index 7dd5be7..37c3216 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php
@@ -76,7 +76,7 @@ function requestRetained($username, $verification, $verificationID)
76 return new xmlrpcresp(new xmlrpcval(1, "int")); 76 return new xmlrpcresp(new xmlrpcval(1, "int"));
77} 77}
78 78
79function sendFromUpdate($username, $verification, $verificationID, $subscription, $title, $author, $url, $semantics) 79function sendFromUpdate($username, $verification, $verificationID, $subscription, $title, $author, $url, $semantics, $encryptionID)
80{ 80{
81 if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) 81 if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password'))
82 { 82 {
@@ -106,6 +106,7 @@ function sendFromUpdate($username, $verification, $verificationID, $subscription
106 new xmlrpcval($author, 'string'), 106 new xmlrpcval($author, 'string'),
107 new xmlrpcval($url, 'string'), 107 new xmlrpcval($url, 'string'),
108 new xmlrpcval($semantics, 'string'), 108 new xmlrpcval($semantics, 'string'),
109 new xmlrpcval($encryptionID, 'int'),
109 new xmlrpcval(instaDisc_getConfig('softwareVersion'), 'int'), 110 new xmlrpcval(instaDisc_getConfig('softwareVersion'), 'int'),
110 new xmlrpcval(instaDisc_getConfig('databaseVersion'), 'int'))); 111 new xmlrpcval(instaDisc_getConfig('databaseVersion'), 'int')));
111 $client->send($msg); 112 $client->send($msg);
@@ -119,7 +120,7 @@ function sendFromUpdate($username, $verification, $verificationID, $subscription
119 return new xmlrpcresp(new xmlrpcval(1, "int")); 120 return new xmlrpcresp(new xmlrpcval(1, "int"));
120} 121}
121 122
122function sendFromCentral($cserver, $verification, $verificationID, $subscription, $title, $author, $url, $semantics, $softwareVersion, $databaseVersion) 123function sendFromCentral($cserver, $verification, $verificationID, $subscription, $title, $author, $url, $semantics, $encryptionID, $softwareVersion, $databaseVersion)
123{ 124{
124 if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'code')) 125 if (instaDisc_checkVerification($cserver, $verification, $verificationID, 'centralServers', 'url', 'code'))
125 { 126 {
@@ -168,7 +169,7 @@ function sendFromCentral($cserver, $verification, $verificationID, $subscription
168 $i=0; 169 $i=0;
169 while ($getsed3[$i] = mysql_fetch_array($getsed2)) 170 while ($getsed3[$i] = mysql_fetch_array($getsed2))
170 { 171 {
171 instaDisc_addItem($getsed3[$i]['username'], $subscription, $title, $author, $url, $semantics); 172 instaDisc_addItem($getsed3[$i]['username'], $subscription, $title, $author, $url, $semantics, $encryptionID);
172 $i++; 173 $i++;
173 } 174 }
174 175