diff --git a/Order Processor/.classpath b/Order Processor/.classpath index a729aa8..8588d28 100644 --- a/Order Processor/.classpath +++ b/Order Processor/.classpath @@ -8,5 +8,6 @@ + diff --git a/Order Processor/.settings.propertys b/Order Processor/.settings.propertys index d0d0457..38b31c4 100644 --- a/Order Processor/.settings.propertys +++ b/Order Processor/.settings.propertys @@ -1,7 +1,7 @@ #---No Comment--- -#Sat Jan 22 21:42:25 EST 2011 -server_parrword=S35-2n6t -use_remote_server=true +#Wed Jan 26 13:29:05 EST 2011 +server_parrword=kwz5vDLcNnKG6agAnGSm8nwzSncF2SK5 server_location=tcdevsvn1 +use_remote_server=true server_port_number=3306 server_user_name=ricky.barrette diff --git a/Order Processor/lib/jasypt-1.7.jar b/Order Processor/lib/jasypt-1.7.jar new file mode 100644 index 0000000..2b888a8 Binary files /dev/null and b/Order Processor/lib/jasypt-1.7.jar differ diff --git a/Order Processor/src/com/TwentyCodes/java/OrderProcessor/DB/OrderDB.java b/Order Processor/src/com/TwentyCodes/java/OrderProcessor/DB/OrderDB.java index d93e99a..90c1dc3 100644 --- a/Order Processor/src/com/TwentyCodes/java/OrderProcessor/DB/OrderDB.java +++ b/Order Processor/src/com/TwentyCodes/java/OrderProcessor/DB/OrderDB.java @@ -25,6 +25,8 @@ import java.util.Collections; import java.util.Locale; import java.util.Properties; +import org.jasypt.util.text.BasicTextEncryptor; + import com.Ostermiller.util.CSVParser; import com.TwentyCodes.java.OrderProcessor.Date; import com.TwentyCodes.java.OrderProcessor.InvalidDateFormatException; @@ -41,6 +43,7 @@ import com.TwentyCodes.java.OrderProcessor.UI.SettingsPanel; */ public class OrderDB { + public final static String PASSWORD = "askjdhfui2ywpordhewpfiy2390uriyfu230rhuiyhew8fu293hro9yqewrfup9u34bh0yf3-eqwjf9834-fjud9i-he9-fhuj830uewfh"; private final String CREATE_TABLE = "CREATE TABLE Orders (id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, item blob);"; private final String CREATE_TABLE_LOCAL = "CREATE TABLE Orders (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'item' blob);"; private final String INSERT = "insert into Orders (item) values (?);"; @@ -209,6 +212,8 @@ public class OrderDB { */ private Connection getConnection() throws SQLException, SocketException{ Properties props = getProperties(); + BasicTextEncryptor passwordEncryptor = new BasicTextEncryptor(); + passwordEncryptor.setPassword(PASSWORD); if(isUsingRemoteDatabase){ String url = "jdbc:mysql://"+props.getProperty(SettingsPanel.SERVER_LOCATION)+":"+props.getProperty(SettingsPanel.SERVER_PORT_NUMBER, "3306")+"/Orders"; @@ -217,7 +222,7 @@ public class OrderDB { url += "?user="+ props.getProperty(SettingsPanel.SERVER_USERNAME); if(props.getProperty(SettingsPanel.SERVER_PASSWORD).length() > 0) - url += "&password="+ props.getProperty(SettingsPanel.SERVER_PASSWORD); + url += "&password="+ passwordEncryptor.decrypt(props.getProperty(SettingsPanel.SERVER_PASSWORD)); return DriverManager.getConnection(url); diff --git a/Order Processor/src/com/TwentyCodes/java/OrderProcessor/UI/OrderPane.java b/Order Processor/src/com/TwentyCodes/java/OrderProcessor/UI/OrderPane.java index d7567e3..a8bdbdf 100644 --- a/Order Processor/src/com/TwentyCodes/java/OrderProcessor/UI/OrderPane.java +++ b/Order Processor/src/com/TwentyCodes/java/OrderProcessor/UI/OrderPane.java @@ -86,10 +86,9 @@ public class OrderPane extends JScrollPane { } updateTextPane(list, styles); - updateTextPane("\nPossible sold:" + list.size() + updateTextPane("\nPossible sold: " + list.size() +"\nPossible sales: $" + possible.setScale(2, BigDecimal.ROUND_DOWN) - + "\n\nTotal new sales: "+ newOrders - + "\nPossible new sales: $"+ possibleNew.setScale(2, BigDecimal.ROUND_DOWN) + + ( (newOrders > 0) ? "\n\nTotal new sales: "+ newOrders + "\nPossible new sales: $"+ possibleNew.setScale(2, BigDecimal.ROUND_DOWN) : "") + "\n\nTotal sold: " + total + "\nActual sales: $" + actual.setScale(2, BigDecimal.ROUND_DOWN) , TextStyle.BOLD); } diff --git a/Order Processor/src/com/TwentyCodes/java/OrderProcessor/UI/SettingsPanel.java b/Order Processor/src/com/TwentyCodes/java/OrderProcessor/UI/SettingsPanel.java index 5a87d3c..d235b08 100644 --- a/Order Processor/src/com/TwentyCodes/java/OrderProcessor/UI/SettingsPanel.java +++ b/Order Processor/src/com/TwentyCodes/java/OrderProcessor/UI/SettingsPanel.java @@ -24,6 +24,10 @@ import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.LayoutStyle.ComponentPlacement; +import org.jasypt.util.text.BasicTextEncryptor; + +import com.TwentyCodes.java.OrderProcessor.DB.OrderDB; + /** * this panel will be used to display and handle application settings * @author ricky barrette @@ -178,10 +182,12 @@ public class SettingsPanel extends JPanel implements ActionListener { //save button if(e.getSource() == mSaveButton){ + BasicTextEncryptor passwordEncryptor = new BasicTextEncryptor(); + passwordEncryptor.setPassword(OrderDB.PASSWORD); mProps.put(SERVER_LOCATION, mServerLocation.getText()); mProps.put(SERVER_PORT_NUMBER, mPortNumber.getText()); mProps.put(SERVER_USERNAME, mUserName.getText()); - mProps.put(SERVER_PASSWORD, new String(mUserPassword.getPassword())); + mProps.put(SERVER_PASSWORD, new String(passwordEncryptor.encrypt(new String(mUserPassword.getPassword())))); try { FileOutputStream out = new FileOutputStream(".settings.propertys"); mProps.store(out, "---No Comment---"); diff --git a/Order Processor/version infomation/changelog b/Order Processor/version infomation/changelog index 853db48..63fa1a1 100644 --- a/Order Processor/version infomation/changelog +++ b/Order Processor/version infomation/changelog @@ -37,4 +37,9 @@ MainWinod.java, reorganized the constructor so the progress bar will be indeterm 1.1.2 b 47 added clear button to the ShowAllPanel.java fixed the export save dialog to automatically handle extensions -added new order stats to the order pane \ No newline at end of file +added new order stats to the order pane + +1.1.3 b 48 +fixed processed order stats to only display new order stats when theres new orders +added password encryption using jasypt + diff --git a/Order Processor/version infomation/version b/Order Processor/version infomation/version index fca16a3..f0c0f80 100644 --- a/Order Processor/version infomation/version +++ b/Order Processor/version infomation/version @@ -1 +1 @@ -1.1.2 b 47 \ No newline at end of file +1.1.3 b 48 \ No newline at end of file