From 2d998db45226ca7efd39ec6e04b9891ccf129d4f Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 16 Aug 2008 17:52:30 +0000 Subject: General: Upgraded Verification ID generation Verification IDs in Central and Update can now be between 0 and 2147483647. Closes #37 --- central/trunk/includes/instadisc.php | 8 ++++---- central/trunk/xmlrpc.php | 6 +++--- update/library/trunk/instadisc.php | 6 +++--- update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php | 4 ++-- update/plugin/wordpress/trunk/instadisc/instadisc.php | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/central/trunk/includes/instadisc.php b/central/trunk/includes/instadisc.php index 225814e..08394e1 100644 --- a/central/trunk/includes/instadisc.php +++ b/central/trunk/includes/instadisc.php @@ -61,7 +61,7 @@ function instaDisc_sendItem($username, $id) $fp = @fsockopen($getuser3['ip'], 1204, $errno, $errstr); if ($fp) { - $verID = rand(1,65536); + $verID = rand(1,2147483647); $title = str_replace(': ', '__INSTADISC__', $getitem3['title']); @@ -126,7 +126,7 @@ function instaDisc_sendDatabase($cserver) $getuk2 = mysql_query($getuk); $getuk3 = mysql_fetch_array($getuk2); - $verID = rand(1,65536); + $verID = rand(1,2147483647); $client = new xmlrpc_client($cserver); $msg = new xmlrpcmsg("InstaDisc.sendDatabase", array( new xmlrpcval($cserver2, 'string'), @@ -176,7 +176,7 @@ function instaDisc_phpMailer() function instaDisc_sendActivationEmail($username, $password, $email) { - $penKey = md5(rand(1,65536)); + $penKey = md5(rand(1,2147483647)); $inspending = "INSERT INTO pending (username, password, email, code) VALUES (\"" . mysql_real_escape_string($username) . "\", \"" . mysql_real_escape_string(md5($password)) . "\", \"" . mysql_real_escape_string($email) . "\", \"" . mysql_real_escape_string($penKey) . "\")"; $inspending2 = mysql_query($inspending); @@ -358,7 +358,7 @@ function instaDisc_generateSubscriptionActivation($username, $url) $getuser3 = mysql_fetch_array($getuser2); if ($getuser3['username'] == $username) { - $key = md5(rand(1,65536)); + $key = md5(rand(1,2147483647)); $inspending = "INSERT INTO pending2 (username, url, code) VALUES (\"" . mysql_real_escape_string($username) . "\", \"" . mysql_real_escape_string($url) . "\", \"" . mysql_real_escape_string($key) . "\")"; $inspending2 = mysql_query($inspending); diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index 88fff7f..53b947e 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php @@ -94,7 +94,7 @@ function sendFromUpdate($username, $verification, $verificationID, $subscription $i=0; while ($getcs3[$i] = mysql_fetch_array($getcs2)) { - $verID = rand(1,65536); + $verID = rand(1,2147483647); $client = new xmlrpc_client($getcs3[$i]['xmlrpc']); $msg = new xmlrpcmsg("InstaDisc.sendFromCentral", array( new xmlrpcval($cserver, 'string'), @@ -133,7 +133,7 @@ function sendFromCentral($cserver, $verification, $verificationID, $subscription $getuk2 = mysql_query($getuk); $getuk3 = mysql_fetch_array($getuk2); - $verID = rand(1,65536); + $verID = rand(1,2147483647); $client = new xmlrpc_client($cserver); $msg = new xmlrpcmsg("InstaDisc.sendUpdateNotice", array( new xmlrpcval($cserver2, 'string'), @@ -150,7 +150,7 @@ function sendFromCentral($cserver, $verification, $verificationID, $subscription $getuk2 = mysql_query($getuk); $getuk3 = mysql_fetch_array($getuk2); - $verID = rand(1,65536); + $verID = rand(1,2147483647); $client = new xmlrpc_client($cserver); $msg = new xmlrpcmsg("InstaDisc.askForDatabase", array( new xmlrpcval($cserver2, 'string'), diff --git a/update/library/trunk/instadisc.php b/update/library/trunk/instadisc.php index bfc1101..8a17da0 100644 --- a/update/library/trunk/instadisc.php +++ b/update/library/trunk/instadisc.php @@ -18,7 +18,7 @@ function instaDisc_sendItem($id, $title, $author, $url, $semantics) { global $idusUsername, $idusPassword, $idusCentralServer, $idusSubscriptionURI; - $verID = rand(1,65536); + $verID = rand(1,2147483647); $client = new xmlrpc_client($idusCentralServer[$id]); $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval($idusUsername[$id], 'string'), @@ -40,7 +40,7 @@ function instaDisc_sendEncrypted($id, $title, $author, $url, $semantics) $encID = 0; while ($encID == 0) { - $encID = rand(1,65536); + $encID = rand(1,2147483647); } $cipher = "rijndael-128"; @@ -70,7 +70,7 @@ function instaDisc_sendEncrypted($id, $title, $author, $url, $semantics) mcrypt_module_close($td); - $verID = rand(1,65536); + $verID = rand(1,2147483647); $client = new xmlrpc_client($idusCentralServer[$id]); $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval($idusUsername[$id], 'string'), diff --git a/update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php b/update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php index df7c203..95d1956 100644 --- a/update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php +++ b/update/plugin/phpBB3/trunk/root/includes/functions_instadisc.php @@ -24,7 +24,7 @@ include($phpbb_root_path . 'includes/xmlrpc/xmlrpc.inc'); function sendItem($title, $userID, $url, $fourm) { global $config, $db, $phpbb_root_path; - $verID = rand(1,65536); + $verID = rand(1,2147483647); $da = array('user_id' => $userID); $getuser = "SELECT * FROM " . USERS_TABLE . " WHERE " . $db->sql_build_array('SELECT', $da); @@ -33,7 +33,7 @@ function sendItem($title, $userID, $url, $fourm) $db->sql_freeresult($getuser2); $author = $getuser3['username']; - $url = html_entity_decode(str_replace($phpbb_root_path, generate_board_url() . '/', $url)); + $url = str_replace($phpbb_root_path, generate_board_url() . '/', $url); $da = array('forum_id' => $fourm); $getfourm = "SELECT * FROM " . FORUMS_TABLE . " WHERE " . $db->sql_build_array('SELECT', $da); diff --git a/update/plugin/wordpress/trunk/instadisc/instadisc.php b/update/plugin/wordpress/trunk/instadisc/instadisc.php index b8ed9d1..c1d82ad 100644 --- a/update/plugin/wordpress/trunk/instadisc/instadisc.php +++ b/update/plugin/wordpress/trunk/instadisc/instadisc.php @@ -146,7 +146,7 @@ function sendPost($id) $authorName = $author->display_name; $url = get_permalink($id); - $verID = rand(1,65536); + $verID = rand(1,2147483647); $client = new xmlrpc_client(get_option('instaDisc_blogPost_centralServer')); $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval(get_option('instaDisc_blogPost_centralServer_username'), 'string'), @@ -170,7 +170,7 @@ function sendComment($id) $author = $comment->comment_author; $url = get_permalink($comment->comment_post_ID) . "#comments"; - $verID = rand(1,65536); + $verID = rand(1,2147483647); $client = new xmlrpc_client(get_option('instaDisc_comment_centralServer')); $msg = new xmlrpcmsg("InstaDisc.sendFromUpdate", array( new xmlrpcval(get_option('instaDisc_comment_centralServer_username'), 'string'), -- cgit 1.4.1