RRRRHHHH_Code
Diff Revisions
1cf395 ...
vs
08aaf3 ...
for ruralHouses/src/domain/Account.java
|
@@ -2,6 +2,7 @@ |
2 |
2 |
|
|
3 |
3 |
|
import java.io.Serializable; |
4 |
4 |
|
import java.util.Arrays; |
|
5 |
+ |
|
5 |
6 |
|
import businessLogic.SecurityManager; |
6 |
7 |
|
|
7 |
8 |
|
|
|
@@ -16,17 +17,15 @@ |
16 |
17 |
|
private byte[] username; |
17 |
18 |
|
private byte[] password; |
18 |
19 |
|
private byte[] salt; |
19 |
|
- |
|
20 |
|
- |
|
21 |
20 |
|
private Owner owner; |
22 |
21 |
|
private boolean admin = false; |
23 |
22 |
|
|
|
23 |
+ |
|
24 |
24 |
|
public Account(byte[] usr){ |
25 |
25 |
|
this.username = usr; |
26 |
26 |
|
this.salt =null; |
27 |
27 |
|
this.password = null; |
28 |
28 |
|
this.owner = null; |
29 |
|
- |
|
30 |
29 |
|
} |
31 |
30 |
|
public Account(String usr, String pass, boolean isAdmin) { |
32 |
31 |
|
this.username = SecurityManager.getInstance().calculateHash(usr); |
|
@@ -34,7 +33,13 @@ |
34 |
33 |
|
this.password = SecurityManager.getInstance().calculateSaltedHash(pass.toCharArray(), this.salt); |
35 |
34 |
|
this.owner = null; |
36 |
35 |
|
this.admin = isAdmin; |
37 |
|
- |
|
|
36 |
+ |
} |
|
37 |
+ |
|
|
38 |
+ |
public Account(Owner own){ |
|
39 |
+ |
this.username = null; |
|
40 |
+ |
this.salt =null; |
|
41 |
+ |
this.password = null; |
|
42 |
+ |
this.owner = own; |
38 |
43 |
|
} |
39 |
44 |
|
|
40 |
45 |
|
public Account(String usr, String pass, Owner ow) { |