Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard

Diff Revisions 520867 ... vs 0f75b2 ... for ruralHouses/src/businessLogic/LoginManager.java

Diff revisions: vs.
  @@ -6,6 +6,7 @@
6 6 import dataAccess.DB4oManager;
7 7 import domain.Account;
8 8
9 +
9 10 public class LoginManager implements LoginManagerInterface {
10 11
11 12 DB4oManager dbMngr;
  @@ -22,12 +23,15 @@
22 23
23 24 @Override
24 25 public Account checkCredentials(String usr, String pwd) {
26 + Account ac = new Account(usr);
25 27 try {
26 - Vector<Account> account = dbMngr.getAccount(usr, pwd);
27 - if (account.isEmpty())
28 - return null;
29 - else
28 + Vector<Account> account = dbMngr.getAccount(ac);
29 + if (SecurityManager.getInstance().isExpectedPassword(pwd.toCharArray(), account
30 + .get(0).getSalt(), account.get(0).getPassword())) {
31 +
30 32 return account.get(0);
33 + }
34 + return null;
31 35
32 36 } catch (Exception e) {
33 37 // TODO Auto-generated catch block
  @@ -35,7 +39,4 @@
35 39 }
36 40 return null;
37 41 }
38 -
39 -
40 -
41 42 }