From 2c6e3e362bf614a2e67dba5ec3e1c0d247834b69 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 29 Sep 2008 01:22:47 +0000 Subject: Client: Fixed a few bugs with registration Also changed XML-RPC URL constant. Fixes #63 and refs #64 --- .../src/com/fourisland/instadisc/FirstRun/Step2A.java | 9 ++++++--- .../instadisc/FirstRun/resources/Step2A.properties | 10 ++++++++++ .../instadisc/FirstRun/resources/Step2A_1.properties | 11 +++++++++++ client/trunk/src/com/fourisland/instadisc/XmlRpc.java | 16 ++-------------- 4 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2A.properties create mode 100644 client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2A_1.properties (limited to 'client/trunk/src/com/fourisland') diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2A.java b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2A.java index c027ef6..e4e1b2d 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2A.java +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2A.java @@ -138,12 +138,15 @@ public class Step2A extends javax.swing.JDialog { MD5 md5 = new MD5(jPasswordField1.getPassword()); String password = md5.hash(); - XmlRpc xmlrpc = new XmlRpc("createUser", jTextField1.getText(), password); + XmlRpc xmlrpc = new XmlRpc("createUser", "", ""); + xmlrpc.resetParams(); + xmlrpc.addParam(jTextField1.getText()); + xmlrpc.addParam(password); String usr = (String) xmlrpc.execute(); if (!usr.equals(jTextField1.getText())) { - jLabel2.setText("Error: The specified username is already taken. Why don't you try: " + usr); + jLabel2.setText("Error: The specified username is already taken.
Why don't you try: " + usr); } else { Wrapper.setConfig("username", jTextField1.getText()); Wrapper.setConfig("password", password); @@ -167,7 +170,7 @@ public class Step2A extends javax.swing.JDialog { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { - Step2 dialog = new Step2(new javax.swing.JFrame(), true); + Step2A dialog = new Step2A(new javax.swing.JFrame(), true); dialog.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2A.properties b/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2A.properties new file mode 100644 index 0000000..9eae847 --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2A.properties @@ -0,0 +1,10 @@ +jLabel1.text=Central Server Details +#NOI18N +jLabel1.font=DejaVu Sans-Plain-18 +jLabel3.text=Username: +jTextField1.text= +jLabel4.text=Password: +jButton1.text=Next +jLabel2.text=If you don't have an InstaDisc account, you can make one here. If you do, though, go back and click "I have an account" +jPasswordField1.text= +jButton2.text=Back \ No newline at end of file diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2A_1.properties b/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2A_1.properties new file mode 100644 index 0000000..65a8a60 --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/resources/Step2A_1.properties @@ -0,0 +1,11 @@ + +jLabel1.text=Central Server Details +#NOI18N +jLabel1.font=DejaVu Sans-Plain-18 +jLabel2.text=If you don't have an InstaDisc account yet, you can make one here. If you do, though, go back and click "I have an account" +jLabel3.text=Username: +jLabel4.text=Password: +jTextField1.text= +jPasswordField1.text= +jButton1.text=Next +jButton2.text=Back diff --git a/client/trunk/src/com/fourisland/instadisc/XmlRpc.java b/client/trunk/src/com/fourisland/instadisc/XmlRpc.java index 86bff6f..e8b2d94 100644 --- a/client/trunk/src/com/fourisland/instadisc/XmlRpc.java +++ b/client/trunk/src/com/fourisland/instadisc/XmlRpc.java @@ -23,22 +23,9 @@ public class XmlRpc { private String function; private Object[] params; private int step = 3; - private String url; public XmlRpc(String function) { this.function = function; - this.url = "http://central.fourisland.com/xmlrpc.php"; - - Verification ver = new Verification(); - params = new Object[3]; - params[0] = ver.getUsername(); - params[1] = ver.getHash(); - params[2] = ver.getID(); - } - - public XmlRpc(String url, String function) { - this.function = function; - this.url = url; Verification ver = new Verification(); params = new Object[3]; @@ -76,7 +63,7 @@ public class XmlRpc { Object result = null; try { XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); - config.setServerURL(new URL("http://central.fourisland.com/xmlrpc.php")); + config.setServerURL(new URL("http://rpc.instadisc.org/")); XmlRpcClient client = new XmlRpcClient(); client.setConfig(config); @@ -92,5 +79,6 @@ public class XmlRpc { public void resetParams() { params = new Object[] {}; + step = 0; } } -- cgit 1.4.1