Interface DataController added
[staff/due1/sed-hs15-srs-purple.git] / src / main / java / ch / bfh / ti / srs / core / UserController.java
1 /*
2 * Copyright (c) 2015 Berner Fachhochschule, Switzerland.
3 *
4 * Project Smart Reservation System.
5 *
6 * Distributable under GPL license. See terms of license at gnu.org.
7 */
8 package ch.bfh.ti.srs.core;
9
10 public class UserController {
11 User LoggedUser;
12 DataController dc;
13
14 public UserController() {
15 dc = new ExcelController("test.xls");
16 }
17
18 public boolean logIn(String userName, String password) throws Exception{
19 User tempUser = dc.findUser(userName);
20 if(tempUser == null) return false;
21 if(tempUser.checkPassword(password)){
22 LoggedUser = tempUser;
23 return true;
24 }
25 else return false;
26 }
27
28
29 }