Merge branch 'master' of ssh://xp-dev.com/RRRRHHHH_Code
[RRRRHHHH_Code] / ruralHouses / src / domain / Account.java
index ba7a630..ff19267 100644 (file)
@@ -1,23 +1,29 @@
 package domain;
 
+import java.io.Serializable;
 import java.util.Arrays;
 
 import businessLogic.SecurityManager;
 
-public class Account {
+public class Account implements Serializable {
 
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 1L;
        
 
        private byte[] username;
        private byte[] password;
        private byte[] salt;
 
+
        private Owner owner;
        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;
@@ -42,6 +48,7 @@ public class Account {
 
        }
 
+       
        public byte[] getUsername() {
                return username;
        }
@@ -58,6 +65,7 @@ public class Account {
                return admin;
        }
 
+       
        public void setAdmin(boolean admin) {
                this.admin = admin;
        }
@@ -80,8 +88,6 @@ public class Account {
                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;