Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard
 
ccac9974c8183f7f0d30e8cabd84ee0386e8cd97
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package domain;

import java.io.Serializable;
import java.util.Arrays;
import businessLogic.SecurityManager;


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(byte[] usr){
		this.username = usr;
		this.salt =null;
		this.password = null;
		this.owner = null;
		
	}
	public Account(String usr, String pass, boolean isAdmin) {
		this.username = SecurityManager.getInstance().calculateHash(usr);
		this.salt = SecurityManager.getInstance().generateSalt();
		this.password = SecurityManager.getInstance().calculateSaltedHash(pass.toCharArray(), this.salt);
		this.owner = null;
		this.admin = isAdmin;

	}

	public Account(String usr, String pass, Owner ow) {
		this.username = SecurityManager.getInstance().calculateHash(usr);
		this.salt = SecurityManager.getInstance().generateSalt();
		this.password = SecurityManager.getInstance().calculateSaltedHash(pass.toCharArray(),
				this.salt);
		this.owner = ow;
		this.admin = false;

	}


	

	public byte[] getUsername() {
		return username;
	}

	public byte[] getPassword() {
		return password;
	}

	public Owner getOwner() {
		return owner;
	}

	public boolean getAdmin() {
		return admin;
	}

	
	public void setAdmin(boolean admin) {
		this.admin = admin;
	}

	public byte[] getSalt() {
		return salt;
	}

	public void setSalt(byte[] salt) {
		this.salt = salt;
	}
	

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Account other = (Account) obj;
		if (!Arrays.equals(username, other.username))
			return false;
		return true;
	}

}

Commits for RRRRHHHH_CoderuralHouses/src/domain/Account.java

Diff revisions: vs.
Revision Author Commited Message
ccac99 ... Diff Diff pinene picture pinene Wed 20 May, 2015 16:42:17 +0000

Merge branch ‘master’ of ssh://xp-dev.com/RRRRHHHH_Code

Conflicts:
ruralHouses client/src/domain/Owner.java
ruralHouses client/src/domain/RuralHouse.java
ruralHouses client/src/gui/BookRuralHouseConfirmationWindow.java
ruralHouses client/src/gui/ModifyOfferGUI.java
ruralHouses/src/dataAccess/DB4oManager.java
ruralHouses/src/domain/Booking.java

4bc36b ... Diff Diff camjan Tue 19 May, 2015 23:23:13 +0000

Merge branch ‘master’ of https://xp-dev.com/git/RRRRHHHH_Code

Conflicts:
ruralHouses client/src/gui/HouseFeaturesGUI.java
ruralHouses client/src/gui/ModifyOfferGUI.java
ruralHouses/src/domain/RuralHouse.java

c92b61 ... Diff Diff pinene picture pinene Tue 19 May, 2015 19:44:47 +0000

Merge branch ‘master’ of ssh://xp-dev.com/RRRRHHHH_Code

Conflicts:
ruralHouses client/src/gui/ModifyOfferGUI.java
ruralHouses/src/dataAccess/DB4oManager.java

998673 ... Diff Diff pinene picture pinene Tue 19 May, 2015 19:42:25 +0000

fast com

e90cb4 ... Diff Diff camjan Tue 19 May, 2015 19:39:31 +0000

Owner deletion added

25898b ... Diff Diff camjan Mon 18 May, 2015 15:26:01 +0000

Account adding and deleting fixed

4f8bcc ... Diff Diff epinzolas001 Mon 18 May, 2015 09:49:54 +0000

Merge conflicts solutioned

7bf57b ... Diff Diff camjan Sun 17 May, 2015 11:59:22 +0000

Possibility of registering new owners added

0f75b2 ... Diff Diff camjan Sat 16 May, 2015 14:34:49 +0000

Username is saved hashed and password hashed and salted

2ac167 ... Eneko Pinzolas Murua Wed 15 Apr, 2015 13:53:44 +0000

admin completed