Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard

Diff Revisions 25898b ... vs 998673 ... for ruralHouses/src/domain/Account.java

Diff revisions: vs.
  @@ -22,8 +22,8 @@
22 22 private boolean admin = false;
23 23
24 24
25 - public Account(byte[] usr){
26 - this.username = usr;
25 + public Account(String usr){
26 + this.username = SecurityManager.getInstance().calculateHash(usr);
27 27 this.salt =null;
28 28 this.password = null;
29 29 this.owner = null;
  @@ -48,7 +48,6 @@
48 48
49 49 }
50 50
51 -
52 51 public byte[] getUsername() {
53 52 return username;
54 53 }
  @@ -65,6 +64,7 @@
65 64 return admin;
66 65 }
67 66
67 +
68 68 public void setAdmin(boolean admin) {
69 69 this.admin = admin;
70 70 }
  @@ -87,6 +87,8 @@
87 87 if (getClass() != obj.getClass())
88 88 return false;
89 89 Account other = (Account) obj;
90 + if (!Arrays.equals(password, other.password))
91 + return false;
90 92 if (!Arrays.equals(username, other.username))
91 93 return false;
92 94 return true;