diff options
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 | ?> |
