From 9c7e9acc5c17acf42193efacb8e8183e28c2e402 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 13 Aug 2008 01:40:34 +0000 Subject: Central: Added encryption key support See [127]. Refs #10 --- central/trunk/instadisc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'central/trunk/instadisc.php') 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) $out .= $name . ': ' . $value . "\r\n"; } + if ($getitem3['encryptionID'] != 0) + { + $out .= 'Encryption-ID: ' . $getitem3['encryptionID'] . "\r\n"; + } + $out .= "\r\n\r\n"; fwrite($fp, $out); @@ -132,7 +137,7 @@ function instaDisc_sendDatabase($cserver) $client->send($msg); } -function instaDisc_addItem($username, $subscription, $title, $author, $url, $semantics) +function instaDisc_addItem($username, $subscription, $title, $author, $url, $semantics, $encryptionID) { $getuser = "SELECT * FROM users WHERE username = \"" . mysql_real_escape_string($username) . "\""; $getuser2 = mysql_query($getuser); @@ -143,7 +148,7 @@ function instaDisc_addItem($username, $subscription, $title, $author, $url, $sem $setuser = "UPDATE users SET nextItemID = nextItemID+1 WHERE username = \"" . mysql_real_escape_string($username) . "\""; $setuser2 = mysql_query($setuser); - $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) . "\")"; + $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 . "\")"; $insitem2 = mysql_query($insitem); instaDisc_sendItem($username, $itemID); -- cgit 1.4.1