diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-07 01:50:18 +0000 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-07 01:50:18 +0000 |
commit | adfe0d98928de9f4a1acf119c2d76062209b199d (patch) | |
tree | b9200ffb0c7f92eb410384ae072e65bf01fae73b /update | |
parent | e57a566e03c32010f84474cadfd5162df8e5b23e (diff) | |
download | instadisc-adfe0d98928de9f4a1acf119c2d76062209b199d.tar.gz instadisc-adfe0d98928de9f4a1acf119c2d76062209b199d.tar.bz2 instadisc-adfe0d98928de9f4a1acf119c2d76062209b199d.zip |
Update: Added password-protection support to the library
Using the new instaDisc_sendEncrypted() function and the $idusEncryptionPassword variable, you can now feed password-protected subscriptions. However, a Subscription File will have to be automatically generated to support the password-protection. Refs #10
Diffstat (limited to 'update')
-rw-r--r-- | update/library/trunk/instadisc.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/update/library/trunk/instadisc.php b/update/library/trunk/instadisc.php index 3bef5e4..f256fb2 100644 --- a/update/library/trunk/instadisc.php +++ b/update/library/trunk/instadisc.php | |||
@@ -8,6 +8,7 @@ $idusUsername = ''; // Set this to the username you've registered | |||
8 | $idusPassword = ''; // Set this to the password you've registered | 8 | $idusPassword = ''; // Set this to the password you've registered |
9 | $idusCentralServer = ''; // Set this to the Central Server you've signed up with | 9 | $idusCentralServer = ''; // Set this to the Central Server you've signed up with |
10 | $idusSubscriptionURI = ''; // Set this to your unique URI | 10 | $idusSubscriptionURI = ''; // Set this to your unique URI |
11 | $idusEncryptionPassword = ''; // If creating a password-protected subscription, enter your password here | ||
11 | 12 | ||
12 | function instaDisc_sendItem($title, $author, $url, $semantics) | 13 | function instaDisc_sendItem($title, $author, $url, $semantics) |
13 | { | 14 | { |
@@ -26,4 +27,26 @@ function instaDisc_sendItem($title, $author, $url, $semantics) | |||
26 | $client->send($msg); | 27 | $client->send($msg); |
27 | } | 28 | } |
28 | 29 | ||
30 | function instaDisc_sendEncrypted($title, $author, $url, $semantics) | ||
31 | { | ||
32 | $cipher = "rijndael-128"; | ||
33 | $mode = "cbc"; | ||
34 | $iv = "fedcba9876543210"; | ||
35 | |||
36 | $td = mcrypt_module_open($cipher, "", $mode, $iv); | ||
37 | mcrypt_generic_init($td, $idusEncryptionPassword, $iv); | ||
38 | $title = bin2hex(mcrypt_generic($td, $title)); | ||
39 | $author = bin2hex(mcrypt_generic($td, $author)); | ||
40 | $url = bin2hex(mcrypt_generic($td, $url)); | ||
41 | foreach ($semantics as $name => $value) | ||
42 | { | ||
43 | $semantics[$name] = bin2hex(mcrypt_generic($td, $value)); | ||
44 | } | ||
45 | |||
46 | mcrypt_generic_deinit($td); | ||
47 | mcrypt_module_close($td); | ||
48 | |||
49 | instaDisc_sendItem($title, $author, $url, $semantics); | ||
50 | } | ||
51 | |||
29 | ?> | 52 | ?> |