diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-15 19:24:50 +0000 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2008-08-15 19:24:50 +0000 |
commit | 1e935eea66bb0ad46e5599619e77d995f538cdb6 (patch) | |
tree | 899879abb53c220f0fa514f7d9eef00cada3bfa0 /client/trunk/src | |
parent | 9aec4d669f8d9efb74372e3755131e042c62761f (diff) | |
download | instadisc-1e935eea66bb0ad46e5599619e77d995f538cdb6.tar.gz instadisc-1e935eea66bb0ad46e5599619e77d995f538cdb6.tar.bz2 instadisc-1e935eea66bb0ad46e5599619e77d995f538cdb6.zip |
Client: Added change password
Closes #35
Diffstat (limited to 'client/trunk/src')
7 files changed, 421 insertions, 3 deletions
diff --git a/client/trunk/src/com/fourisland/instadisc/ChangePasswordForm.form b/client/trunk/src/com/fourisland/instadisc/ChangePasswordForm.form new file mode 100644 index 0000000..93681ac --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/ChangePasswordForm.form | |||
@@ -0,0 +1,171 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8" ?> | ||
2 | |||
3 | <Form version="1.5" maxVersion="1.5" type="org.netbeans.modules.form.forminfo.JDialogFormInfo"> | ||
4 | <Properties> | ||
5 | <Property name="defaultCloseOperation" type="int" value="2"/> | ||
6 | <Property name="name" type="java.lang.String" value="Form" noResource="true"/> | ||
7 | </Properties> | ||
8 | <SyntheticProperties> | ||
9 | <SyntheticProperty name="formSizePolicy" type="int" value="1"/> | ||
10 | </SyntheticProperties> | ||
11 | <AuxValues> | ||
12 | <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/> | ||
13 | <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/> | ||
14 | <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> | ||
15 | <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> | ||
16 | <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> | ||
17 | <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> | ||
18 | <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> | ||
19 | <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> | ||
20 | </AuxValues> | ||
21 | |||
22 | <Layout> | ||
23 | <DimensionLayout dim="0"> | ||
24 | <Group type="103" groupAlignment="0" attributes="0"> | ||
25 | <Group type="102" attributes="0"> | ||
26 | <EmptySpace max="-2" attributes="0"/> | ||
27 | <Group type="103" groupAlignment="0" attributes="0"> | ||
28 | <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> | ||
29 | <Group type="102" alignment="0" attributes="0"> | ||
30 | <EmptySpace min="12" pref="12" max="12" attributes="0"/> | ||
31 | <Group type="103" groupAlignment="0" attributes="0"> | ||
32 | <Group type="102" alignment="1" attributes="0"> | ||
33 | <Component id="jLabel6" pref="270" max="32767" attributes="0"/> | ||
34 | <EmptySpace max="-2" attributes="0"/> | ||
35 | <Component id="jButton2" min="-2" max="-2" attributes="0"/> | ||
36 | <EmptySpace max="-2" attributes="0"/> | ||
37 | <Component id="jButton1" min="-2" max="-2" attributes="0"/> | ||
38 | </Group> | ||
39 | <Group type="102" attributes="0"> | ||
40 | <Component id="jLabel5" min="-2" max="-2" attributes="0"/> | ||
41 | <EmptySpace max="-2" attributes="0"/> | ||
42 | <Component id="jPasswordField3" pref="203" max="32767" attributes="0"/> | ||
43 | </Group> | ||
44 | <Group type="102" alignment="0" attributes="0"> | ||
45 | <Group type="103" groupAlignment="0" attributes="0"> | ||
46 | <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/> | ||
47 | <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/> | ||
48 | </Group> | ||
49 | <EmptySpace max="-2" attributes="0"/> | ||
50 | <Group type="103" groupAlignment="1" attributes="0"> | ||
51 | <Component id="jPasswordField2" pref="257" max="32767" attributes="0"/> | ||
52 | <Component id="jPasswordField1" alignment="0" pref="257" max="32767" attributes="0"/> | ||
53 | </Group> | ||
54 | </Group> | ||
55 | <Component id="jLabel2" alignment="0" pref="364" max="32767" attributes="0"/> | ||
56 | </Group> | ||
57 | </Group> | ||
58 | </Group> | ||
59 | <EmptySpace max="-2" attributes="0"/> | ||
60 | </Group> | ||
61 | </Group> | ||
62 | </DimensionLayout> | ||
63 | <DimensionLayout dim="1"> | ||
64 | <Group type="103" groupAlignment="0" attributes="0"> | ||
65 | <Group type="102" alignment="0" attributes="0"> | ||
66 | <EmptySpace min="-2" max="-2" attributes="0"/> | ||
67 | <Component id="jLabel1" min="-2" max="-2" attributes="0"/> | ||
68 | <EmptySpace max="-2" attributes="0"/> | ||
69 | <Component id="jLabel2" pref="51" max="32767" attributes="0"/> | ||
70 | <EmptySpace max="-2" attributes="0"/> | ||
71 | <Group type="103" groupAlignment="3" attributes="0"> | ||
72 | <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> | ||
73 | <Component id="jPasswordField1" alignment="3" min="-2" max="-2" attributes="0"/> | ||
74 | </Group> | ||
75 | <EmptySpace min="-2" max="-2" attributes="0"/> | ||
76 | <Group type="103" groupAlignment="3" attributes="0"> | ||
77 | <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> | ||
78 | <Component id="jPasswordField2" alignment="3" min="-2" max="-2" attributes="0"/> | ||
79 | </Group> | ||
80 | <EmptySpace min="-2" max="-2" attributes="0"/> | ||
81 | <Group type="103" groupAlignment="3" attributes="0"> | ||
82 | <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> | ||
83 | <Component id="jPasswordField3" alignment="3" min="-2" max="-2" attributes="0"/> | ||
84 | </Group> | ||
85 | <EmptySpace min="-2" max="-2" attributes="0"/> | ||
86 | <Group type="103" groupAlignment="3" attributes="0"> | ||
87 | <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> | ||
88 | <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> | ||
89 | <Component id="jLabel6" alignment="3" min="-2" pref="26" max="-2" attributes="0"/> | ||
90 | </Group> | ||
91 | <EmptySpace min="-2" max="-2" attributes="0"/> | ||
92 | </Group> | ||
93 | </Group> | ||
94 | </DimensionLayout> | ||
95 | </Layout> | ||
96 | <SubComponents> | ||
97 | <Component class="javax.swing.JLabel" name="jLabel1"> | ||
98 | <Properties> | ||
99 | <Property name="font" type="java.awt.Font" resourceKey="jLabel1.font"/> | ||
100 | <Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/> | ||
101 | <Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/> | ||
102 | </Properties> | ||
103 | </Component> | ||
104 | <Component class="javax.swing.JLabel" name="jLabel2"> | ||
105 | <Properties> | ||
106 | <Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/> | ||
107 | <Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/> | ||
108 | </Properties> | ||
109 | </Component> | ||
110 | <Component class="javax.swing.JLabel" name="jLabel3"> | ||
111 | <Properties> | ||
112 | <Property name="text" type="java.lang.String" resourceKey="jLabel3.text"/> | ||
113 | <Property name="name" type="java.lang.String" value="jLabel3" noResource="true"/> | ||
114 | </Properties> | ||
115 | </Component> | ||
116 | <Component class="javax.swing.JLabel" name="jLabel4"> | ||
117 | <Properties> | ||
118 | <Property name="text" type="java.lang.String" resourceKey="jLabel4.text"/> | ||
119 | <Property name="name" type="java.lang.String" value="jLabel4" noResource="true"/> | ||
120 | </Properties> | ||
121 | </Component> | ||
122 | <Component class="javax.swing.JLabel" name="jLabel5"> | ||
123 | <Properties> | ||
124 | <Property name="text" type="java.lang.String" resourceKey="jLabel5.text"/> | ||
125 | <Property name="name" type="java.lang.String" value="jLabel5" noResource="true"/> | ||
126 | </Properties> | ||
127 | </Component> | ||
128 | <Component class="javax.swing.JPasswordField" name="jPasswordField1"> | ||
129 | <Properties> | ||
130 | <Property name="text" type="java.lang.String" resourceKey="jPasswordField1.text"/> | ||
131 | <Property name="name" type="java.lang.String" value="jPasswordField1" noResource="true"/> | ||
132 | </Properties> | ||
133 | </Component> | ||
134 | <Component class="javax.swing.JPasswordField" name="jPasswordField2"> | ||
135 | <Properties> | ||
136 | <Property name="text" type="java.lang.String" resourceKey="jPasswordField2.text"/> | ||
137 | <Property name="name" type="java.lang.String" value="jPasswordField2" noResource="true"/> | ||
138 | </Properties> | ||
139 | </Component> | ||
140 | <Component class="javax.swing.JPasswordField" name="jPasswordField3"> | ||
141 | <Properties> | ||
142 | <Property name="text" type="java.lang.String" resourceKey="jPasswordField3.text"/> | ||
143 | <Property name="name" type="java.lang.String" value="jPasswordField3" noResource="true"/> | ||
144 | </Properties> | ||
145 | </Component> | ||
146 | <Component class="javax.swing.JButton" name="jButton1"> | ||
147 | <Properties> | ||
148 | <Property name="text" type="java.lang.String" resourceKey="jButton1.text"/> | ||
149 | <Property name="name" type="java.lang.String" value="jButton1" noResource="true"/> | ||
150 | </Properties> | ||
151 | <Events> | ||
152 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> | ||
153 | </Events> | ||
154 | </Component> | ||
155 | <Component class="javax.swing.JButton" name="jButton2"> | ||
156 | <Properties> | ||
157 | <Property name="text" type="java.lang.String" resourceKey="jButton2.text"/> | ||
158 | <Property name="name" type="java.lang.String" value="jButton2" noResource="true"/> | ||
159 | </Properties> | ||
160 | <Events> | ||
161 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> | ||
162 | </Events> | ||
163 | </Component> | ||
164 | <Component class="javax.swing.JLabel" name="jLabel6"> | ||
165 | <Properties> | ||
166 | <Property name="text" type="java.lang.String" resourceKey="jLabel6.text"/> | ||
167 | <Property name="name" type="java.lang.String" value="jLabel6" noResource="true"/> | ||
168 | </Properties> | ||
169 | </Component> | ||
170 | </SubComponents> | ||
171 | </Form> | ||
diff --git a/client/trunk/src/com/fourisland/instadisc/ChangePasswordForm.java b/client/trunk/src/com/fourisland/instadisc/ChangePasswordForm.java new file mode 100644 index 0000000..8af46ff --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/ChangePasswordForm.java | |||
@@ -0,0 +1,207 @@ | |||
1 | /* | ||
2 | * ChangePasswordForm.java | ||
3 | * | ||
4 | * Created on August 15, 2008, 2:56 PM | ||
5 | */ | ||
6 | |||
7 | package com.fourisland.instadisc; | ||
8 | |||
9 | import com.fourisland.instadisc.Database.Wrapper; | ||
10 | import com.fourisland.instadisc.Item.MD5; | ||
11 | |||
12 | /** | ||
13 | * | ||
14 | * @author hatkirby | ||
15 | */ | ||
16 | public class ChangePasswordForm extends javax.swing.JDialog { | ||
17 | |||
18 | /** Creates new form ChangePasswordForm */ | ||
19 | public ChangePasswordForm(java.awt.Frame parent, boolean modal) { | ||
20 | super(parent, modal); | ||
21 | initComponents(); | ||
22 | } | ||
23 | |||
24 | /** This method is called from within the constructor to | ||
25 | * initialize the form. | ||
26 | * WARNING: Do NOT modify this code. The content of this method is | ||
27 | * always regenerated by the Form Editor. | ||
28 | */ | ||
29 | // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents | ||
30 | private void initComponents() { | ||
31 | |||
32 | jLabel1 = new javax.swing.JLabel(); | ||
33 | jLabel2 = new javax.swing.JLabel(); | ||
34 | jLabel3 = new javax.swing.JLabel(); | ||
35 | jLabel4 = new javax.swing.JLabel(); | ||
36 | jLabel5 = new javax.swing.JLabel(); | ||
37 | jPasswordField1 = new javax.swing.JPasswordField(); | ||
38 | jPasswordField2 = new javax.swing.JPasswordField(); | ||
39 | jPasswordField3 = new javax.swing.JPasswordField(); | ||
40 | jButton1 = new javax.swing.JButton(); | ||
41 | jButton2 = new javax.swing.JButton(); | ||
42 | jLabel6 = new javax.swing.JLabel(); | ||
43 | |||
44 | setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); | ||
45 | setName("Form"); // NOI18N | ||
46 | |||
47 | org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(com.fourisland.instadisc.InstaDiscApp.class).getContext().getResourceMap(ChangePasswordForm.class); | ||
48 | jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N | ||
49 | jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N | ||
50 | jLabel1.setName("jLabel1"); // NOI18N | ||
51 | |||
52 | jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N | ||
53 | jLabel2.setName("jLabel2"); // NOI18N | ||
54 | |||
55 | jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N | ||
56 | jLabel3.setName("jLabel3"); // NOI18N | ||
57 | |||
58 | jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N | ||
59 | jLabel4.setName("jLabel4"); // NOI18N | ||
60 | |||
61 | jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N | ||
62 | jLabel5.setName("jLabel5"); // NOI18N | ||
63 | |||
64 | jPasswordField1.setText(resourceMap.getString("jPasswordField1.text")); // NOI18N | ||
65 | jPasswordField1.setName("jPasswordField1"); // NOI18N | ||
66 | |||
67 | jPasswordField2.setText(resourceMap.getString("jPasswordField2.text")); // NOI18N | ||
68 | jPasswordField2.setName("jPasswordField2"); // NOI18N | ||
69 | |||
70 | jPasswordField3.setText(resourceMap.getString("jPasswordField3.text")); // NOI18N | ||
71 | jPasswordField3.setName("jPasswordField3"); // NOI18N | ||
72 | |||
73 | jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N | ||
74 | jButton1.setName("jButton1"); // NOI18N | ||
75 | jButton1.addActionListener(new java.awt.event.ActionListener() { | ||
76 | public void actionPerformed(java.awt.event.ActionEvent evt) { | ||
77 | jButton1ActionPerformed(evt); | ||
78 | } | ||
79 | }); | ||
80 | |||
81 | jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N | ||
82 | jButton2.setName("jButton2"); // NOI18N | ||
83 | jButton2.addActionListener(new java.awt.event.ActionListener() { | ||
84 | public void actionPerformed(java.awt.event.ActionEvent evt) { | ||
85 | jButton2ActionPerformed(evt); | ||
86 | } | ||
87 | }); | ||
88 | |||
89 | jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N | ||
90 | jLabel6.setName("jLabel6"); // NOI18N | ||
91 | |||
92 | javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); | ||
93 | getContentPane().setLayout(layout); | ||
94 | layout.setHorizontalGroup( | ||
95 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
96 | .addGroup(layout.createSequentialGroup() | ||
97 | .addContainerGap() | ||
98 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
99 | .addComponent(jLabel1) | ||
100 | .addGroup(layout.createSequentialGroup() | ||
101 | .addGap(12, 12, 12) | ||
102 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
103 | .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() | ||
104 | .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE) | ||
105 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | ||
106 | .addComponent(jButton2) | ||
107 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | ||
108 | .addComponent(jButton1)) | ||
109 | .addGroup(layout.createSequentialGroup() | ||
110 | .addComponent(jLabel5) | ||
111 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | ||
112 | .addComponent(jPasswordField3, javax.swing.GroupLayout.DEFAULT_SIZE, 203, Short.MAX_VALUE)) | ||
113 | .addGroup(layout.createSequentialGroup() | ||
114 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
115 | .addComponent(jLabel3) | ||
116 | .addComponent(jLabel4)) | ||
117 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | ||
118 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) | ||
119 | .addComponent(jPasswordField2, javax.swing.GroupLayout.DEFAULT_SIZE, 257, Short.MAX_VALUE) | ||
120 | .addComponent(jPasswordField1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 257, Short.MAX_VALUE))) | ||
121 | .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE)))) | ||
122 | .addContainerGap()) | ||
123 | ); | ||
124 | layout.setVerticalGroup( | ||
125 | layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
126 | .addGroup(layout.createSequentialGroup() | ||
127 | .addContainerGap() | ||
128 | .addComponent(jLabel1) | ||
129 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | ||
130 | .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE) | ||
131 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | ||
132 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) | ||
133 | .addComponent(jLabel3) | ||
134 | .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) | ||
135 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | ||
136 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) | ||
137 | .addComponent(jLabel4) | ||
138 | .addComponent(jPasswordField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) | ||
139 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | ||
140 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) | ||
141 | .addComponent(jLabel5) | ||
142 | .addComponent(jPasswordField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) | ||
143 | .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) | ||
144 | .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) | ||
145 | .addComponent(jButton1) | ||
146 | .addComponent(jButton2) | ||
147 | .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)) | ||
148 | .addContainerGap()) | ||
149 | ); | ||
150 | |||
151 | pack(); | ||
152 | }// </editor-fold>//GEN-END:initComponents | ||
153 | |||
154 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed | ||
155 | setVisible(false); | ||
156 | }//GEN-LAST:event_jButton1ActionPerformed | ||
157 | |||
158 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed | ||
159 | MD5 old = new MD5(new String(jPasswordField1.getPassword())); | ||
160 | MD5 newP = new MD5(new String(jPasswordField2.getPassword())); | ||
161 | |||
162 | if (Wrapper.getConfig("password").equals(old.hash())) | ||
163 | { | ||
164 | if (new String(jPasswordField2.getPassword()).equals(new String(jPasswordField3.getPassword()))) | ||
165 | { | ||
166 | Wrapper.setConfig("password",newP.hash()); | ||
167 | jLabel6.setText("Password changed"); | ||
168 | } else { | ||
169 | jLabel6.setText("Error: Passwords do not match"); | ||
170 | } | ||
171 | } else { | ||
172 | jLabel6.setText("Error: Old password is not correct"); | ||
173 | } | ||
174 | }//GEN-LAST:event_jButton2ActionPerformed | ||
175 | |||
176 | /** | ||
177 | * @param args the command line arguments | ||
178 | */ | ||
179 | public static void main(String args[]) { | ||
180 | java.awt.EventQueue.invokeLater(new Runnable() { | ||
181 | public void run() { | ||
182 | ChangePasswordForm dialog = new ChangePasswordForm(new javax.swing.JFrame(), true); | ||
183 | dialog.addWindowListener(new java.awt.event.WindowAdapter() { | ||
184 | public void windowClosing(java.awt.event.WindowEvent e) { | ||
185 | System.exit(0); | ||
186 | } | ||
187 | }); | ||
188 | dialog.setVisible(true); | ||
189 | } | ||
190 | }); | ||
191 | } | ||
192 | |||
193 | // Variables declaration - do not modify//GEN-BEGIN:variables | ||
194 | private javax.swing.JButton jButton1; | ||
195 | private javax.swing.JButton jButton2; | ||
196 | private javax.swing.JLabel jLabel1; | ||
197 | private javax.swing.JLabel jLabel2; | ||
198 | private javax.swing.JLabel jLabel3; | ||
199 | private javax.swing.JLabel jLabel4; | ||
200 | private javax.swing.JLabel jLabel5; | ||
201 | private javax.swing.JLabel jLabel6; | ||
202 | private javax.swing.JPasswordField jPasswordField1; | ||
203 | private javax.swing.JPasswordField jPasswordField2; | ||
204 | private javax.swing.JPasswordField jPasswordField3; | ||
205 | // End of variables declaration//GEN-END:variables | ||
206 | |||
207 | } | ||
diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java index 01a3c02..0a8287b 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java | |||
@@ -150,7 +150,7 @@ public class Step2 extends javax.swing.JDialog { | |||
150 | jLabel5.setText("Error: You forgot to enter a Central Server URL"); | 150 | jLabel5.setText("Error: You forgot to enter a Central Server URL"); |
151 | } else { | 151 | } else { |
152 | try { | 152 | try { |
153 | URL url = new URL(jTextField3.getText()); | 153 | new URL(jTextField3.getText()); |
154 | 154 | ||
155 | MD5 md5 = new MD5(jPasswordField1.getPassword()); | 155 | MD5 md5 = new MD5(jPasswordField1.getPassword()); |
156 | String password = md5.hash(); | 156 | String password = md5.hash(); |
diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.form b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.form index 5050377..5ca439a 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.form +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.form | |||
@@ -109,6 +109,15 @@ | |||
109 | <Property name="name" type="java.lang.String" value="jMenu1" noResource="true"/> | 109 | <Property name="name" type="java.lang.String" value="jMenu1" noResource="true"/> |
110 | </Properties> | 110 | </Properties> |
111 | <SubComponents> | 111 | <SubComponents> |
112 | <MenuItem class="javax.swing.JMenuItem" name="jMenuItem7"> | ||
113 | <Properties> | ||
114 | <Property name="text" type="java.lang.String" resourceKey="jMenuItem7.text"/> | ||
115 | <Property name="name" type="java.lang.String" value="jMenuItem7" noResource="true"/> | ||
116 | </Properties> | ||
117 | <Events> | ||
118 | <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem7ActionPerformed"/> | ||
119 | </Events> | ||
120 | </MenuItem> | ||
112 | <MenuItem class="javax.swing.JMenuItem" name="jMenuItem3"> | 121 | <MenuItem class="javax.swing.JMenuItem" name="jMenuItem3"> |
113 | <Properties> | 122 | <Properties> |
114 | <Property name="text" type="java.lang.String" resourceKey="jMenuItem3.text"/> | 123 | <Property name="text" type="java.lang.String" resourceKey="jMenuItem3.text"/> |
diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java index b03ce07..a1d2b5e 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java | |||
@@ -147,6 +147,7 @@ public class InstaDiscView extends FrameView { | |||
147 | jSeparator1 = new javax.swing.JSeparator(); | 147 | jSeparator1 = new javax.swing.JSeparator(); |
148 | javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem(); | 148 | javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem(); |
149 | jMenu1 = new javax.swing.JMenu(); | 149 | jMenu1 = new javax.swing.JMenu(); |
150 | jMenuItem7 = new javax.swing.JMenuItem(); | ||
150 | jMenuItem3 = new javax.swing.JMenuItem(); | 151 | jMenuItem3 = new javax.swing.JMenuItem(); |
151 | jMenuItem4 = new javax.swing.JMenuItem(); | 152 | jMenuItem4 = new javax.swing.JMenuItem(); |
152 | jMenuItem5 = new javax.swing.JMenuItem(); | 153 | jMenuItem5 = new javax.swing.JMenuItem(); |
@@ -225,6 +226,15 @@ public class InstaDiscView extends FrameView { | |||
225 | jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N | 226 | jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N |
226 | jMenu1.setName("jMenu1"); // NOI18N | 227 | jMenu1.setName("jMenu1"); // NOI18N |
227 | 228 | ||
229 | jMenuItem7.setText(resourceMap.getString("jMenuItem7.text")); // NOI18N | ||
230 | jMenuItem7.setName("jMenuItem7"); // NOI18N | ||
231 | jMenuItem7.addActionListener(new java.awt.event.ActionListener() { | ||
232 | public void actionPerformed(java.awt.event.ActionEvent evt) { | ||
233 | jMenuItem7ActionPerformed(evt); | ||
234 | } | ||
235 | }); | ||
236 | jMenu1.add(jMenuItem7); | ||
237 | |||
228 | jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N | 238 | jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N |
229 | jMenuItem3.setName("jMenuItem3"); // NOI18N | 239 | jMenuItem3.setName("jMenuItem3"); // NOI18N |
230 | jMenuItem3.addActionListener(new java.awt.event.ActionListener() { | 240 | jMenuItem3.addActionListener(new java.awt.event.ActionListener() { |
@@ -363,7 +373,7 @@ public class InstaDiscView extends FrameView { | |||
363 | 373 | ||
364 | private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed | 374 | private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed |
365 | try | 375 | try |
366 | {//GEN-LAST:event_jMenuItem6ActionPerformed | 376 | { |
367 | if (java.awt.Desktop.isDesktopSupported()) | 377 | if (java.awt.Desktop.isDesktopSupported()) |
368 | { | 378 | { |
369 | java.awt.Desktop.getDesktop().browse(new URI("http://fourisland.com/projects/instadisc/")); | 379 | java.awt.Desktop.getDesktop().browse(new URI("http://fourisland.com/projects/instadisc/")); |
@@ -377,7 +387,12 @@ public class InstaDiscView extends FrameView { | |||
377 | { | 387 | { |
378 | Logger.getLogger(InstaDiscView.class.getName()).log(Level.SEVERE, null, ex); | 388 | Logger.getLogger(InstaDiscView.class.getName()).log(Level.SEVERE, null, ex); |
379 | } | 389 | } |
380 | } | 390 | }//GEN-LAST:event_jMenuItem6ActionPerformed |
391 | |||
392 | private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed | ||
393 | ChangePasswordForm cpf = new ChangePasswordForm(new JFrame(), true); | ||
394 | cpf.setVisible(true); | ||
395 | }//GEN-LAST:event_jMenuItem7ActionPerformed | ||
381 | 396 | ||
382 | // Variables declaration - do not modify//GEN-BEGIN:variables | 397 | // Variables declaration - do not modify//GEN-BEGIN:variables |
383 | private javax.swing.JList jList1; | 398 | private javax.swing.JList jList1; |
@@ -388,6 +403,7 @@ public class InstaDiscView extends FrameView { | |||
388 | private javax.swing.JMenuItem jMenuItem4; | 403 | private javax.swing.JMenuItem jMenuItem4; |
389 | private javax.swing.JMenuItem jMenuItem5; | 404 | private javax.swing.JMenuItem jMenuItem5; |
390 | private javax.swing.JMenuItem jMenuItem6; | 405 | private javax.swing.JMenuItem jMenuItem6; |
406 | private javax.swing.JMenuItem jMenuItem7; | ||
391 | private javax.swing.JScrollPane jScrollPane1; | 407 | private javax.swing.JScrollPane jScrollPane1; |
392 | private javax.swing.JSeparator jSeparator1; | 408 | private javax.swing.JSeparator jSeparator1; |
393 | private javax.swing.JPanel mainPanel; | 409 | private javax.swing.JPanel mainPanel; |
diff --git a/client/trunk/src/com/fourisland/instadisc/resources/ChangePasswordForm.properties b/client/trunk/src/com/fourisland/instadisc/resources/ChangePasswordForm.properties new file mode 100644 index 0000000..f02a2c8 --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/resources/ChangePasswordForm.properties | |||
@@ -0,0 +1,14 @@ | |||
1 | |||
2 | jLabel1.text=Change Password | ||
3 | #NOI18N | ||
4 | jLabel1.font=DejaVu Sans-Plain-18 | ||
5 | jLabel2.text=<HTML>If you wish to change your password, you can do so here. Remember, if you change your password, you must change it both here and at your Central Server. | ||
6 | jLabel3.text=Old Password: | ||
7 | jLabel4.text=New Password: | ||
8 | jLabel5.text=Confirm New Password: | ||
9 | jPasswordField1.text= | ||
10 | jPasswordField2.text= | ||
11 | jPasswordField3.text= | ||
12 | jButton1.text=Done | ||
13 | jButton2.text=OK | ||
14 | jLabel6.text= | ||
diff --git a/client/trunk/src/com/fourisland/instadisc/resources/InstaDiscView.properties b/client/trunk/src/com/fourisland/instadisc/resources/InstaDiscView.properties index 6908fcb..d7bcf10 100644 --- a/client/trunk/src/com/fourisland/instadisc/resources/InstaDiscView.properties +++ b/client/trunk/src/com/fourisland/instadisc/resources/InstaDiscView.properties | |||
@@ -37,3 +37,4 @@ jMenuItem3.text=Manage Filters | |||
37 | jMenuItem4.text=Request Retained Items | 37 | jMenuItem4.text=Request Retained Items |
38 | jMenuItem5.text=Advanced Settings | 38 | jMenuItem5.text=Advanced Settings |
39 | jMenuItem6.text=InstaDisc Website | 39 | jMenuItem6.text=InstaDisc Website |
40 | jMenuItem7.text=Change Password | ||