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