From ff65e9ee2f7145265dc9c3daacfc2d5fd0756d3f Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 28 Sep 2008 15:39:55 +0000 Subject: Central: Completed step 9 Refs #69 --- central/trunk/xmlrpc.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'central/trunk/xmlrpc.php') diff --git a/central/trunk/xmlrpc.php b/central/trunk/xmlrpc.php index 466cae3..2e3aa62 100644 --- a/central/trunk/xmlrpc.php +++ b/central/trunk/xmlrpc.php @@ -153,6 +153,29 @@ function setDownloadItemMode($username, $verification, $verificationID, $mode) return new xmlrpcresp(new xmlrpcval('1', 'int')); } +function initalizePort($username, $verification, $verificationID) +{ + if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) + { + return new xmlrpcresp(new xmlrpcval(instaDisc_initalizePort($username), 'int')); + } + + return new xmlrpcresp(new xmlrpcval('0', 'int')); +} + +function deinitalizePort($username, $verification, $verificationID) +{ + if (instaDisc_checkVerification($username, $verification, $verificationID, 'users', 'username', 'password')) + { + $setuser = "UPDATE users SET port = 0 WHERE username = \"" . mysql_real_escape_string($username) . "\""; + $setuser2 = mysql_query($setuser); + + return new xmlrpcresp(new xmlrpcval('0', 'int')); + } + + return new xmlrpcresp(new xmlrpcval('1', 'int')); +} + $s = new xmlrpc_server( array( "InstaDisc.checkRegistration" => array("function" => "checkRegistration"), "InstaDisc.deleteItem" => array("function" => "deleteItem"), "InstaDisc.resendItem" => array("function" => "resendItem"), @@ -161,7 +184,9 @@ $s = new xmlrpc_server( array( "InstaDisc.checkRegistration" => array("function" "InstaDisc.deleteSubscription" => array("function" => "deleteSubscription"), "InstaDisc.addSubscription" => array("function" => "addSubscription"), "InstaDisc.downloadItemModeTest" => array("function" => "downloadItemModeTest"), - "InstaDisc.setDownloadItemMode" => array("function" => "setDownloadItemMode") + "InstaDisc.setDownloadItemMode" => array("function" => "setDownloadItemMode"), + "InstaDisc.initalizePort" => array("function" => "initalizePort"), + "InstaDisc.deinitalizePort" => array("function" => "deinitalizePort") ),0); $s->functions_parameters_type = 'phpvals'; $s->service(); -- cgit 1.4.1