RRRRHHHH_Code
Diff Revisions
e3043c ...
vs
b09f34 ...
for ruralHouses/src/domain/Account.java
|
@@ -2,9 +2,9 @@ |
2 |
2 |
|
|
3 |
3 |
|
import java.io.Serializable; |
4 |
4 |
|
import java.util.Arrays; |
5 |
|
- |
|
6 |
5 |
|
import businessLogic.SecurityManager; |
7 |
6 |
|
|
|
7 |
+ |
|
8 |
8 |
|
public class Account implements Serializable { |
9 |
9 |
|
|
10 |
10 |
|
/** |
|
@@ -21,7 +21,6 @@ |
21 |
21 |
|
private Owner owner; |
22 |
22 |
|
private boolean admin = false; |
23 |
23 |
|
|
24 |
|
- |
|
25 |
24 |
|
public Account(byte[] usr){ |
26 |
25 |
|
this.username = usr; |
27 |
26 |
|
this.salt =null; |
|
@@ -29,13 +28,6 @@ |
29 |
28 |
|
this.owner = null; |
30 |
29 |
|
|
31 |
30 |
|
} |
32 |
|
- |
public Account(Owner own){ |
33 |
|
- |
this.username = null; |
34 |
|
- |
this.salt =null; |
35 |
|
- |
this.password = null; |
36 |
|
- |
this.owner = own; |
37 |
|
- |
|
38 |
|
- |
} |
39 |
31 |
|
public Account(String usr, String pass, boolean isAdmin) { |
40 |
32 |
|
this.username = SecurityManager.getInstance().calculateHash(usr); |
41 |
33 |
|
this.salt = SecurityManager.getInstance().generateSalt(); |
|
@@ -55,7 +47,9 @@ |
55 |
47 |
|
|
56 |
48 |
|
} |
57 |
49 |
|
|
|
50 |
+ |
|
58 |
51 |
|
|
|
52 |
+ |
|
59 |
53 |
|
public byte[] getUsername() { |
60 |
54 |
|
return username; |
61 |
55 |
|
} |