Merge branch 'master' of https://xp-dev.com/git/RRRRHHHH_Code
[RRRRHHHH_Code] / ruralHouses / src / domain / Account.java
index ce6bd9e..08e841c 100644 (file)
@@ -22,12 +22,19 @@ public class Account implements Serializable {
        private boolean admin = false;
 
        
-       public Account(String usr){
-               this.username = SecurityManager.getInstance().calculateHash(usr);
+       public Account(byte[] usr){
+               this.username = usr;
                this.salt =null;
                this.password = null;
                this.owner = null;
                
+       }
+       public Account(Owner own){
+               this.username = null;
+               this.salt =null;
+               this.password = null;
+               this.owner = own;
+               
        }
        public Account(String usr, String pass, boolean isAdmin) {
                this.username = SecurityManager.getInstance().calculateHash(usr);
@@ -48,6 +55,7 @@ public class Account implements Serializable {
 
        }
 
+       
        public byte[] getUsername() {
                return username;
        }
@@ -87,8 +95,6 @@ public class Account implements Serializable {
                if (getClass() != obj.getClass())
                        return false;
                Account other = (Account) obj;
-               if (!Arrays.equals(password, other.password))
-                       return false;
                if (!Arrays.equals(username, other.username))
                        return false;
                return true;