Exemplo n.º 1
0
 /**
  * Logs in user, eventually
  *
  * @param username
  * @param password
  */
 public static Boolean login(String username, String password) {
   Boolean status;
   if (username.equals("sigve") && password.equals("1337")) {
     setUser(User.getUser(1)); // get user 1 for now
     GregorianCalendar now = new GregorianCalendar(2012, 3, 23); // arbitrary date for now
     System.out.println("User logged in");
     pushView(new CalendarView());
     Client.setNotifications(Message.getMessages(Client.user));
     Client.setActiveWeek(
         now.get(GregorianCalendar.YEAR),
         now.get(GregorianCalendar.MONTH),
         now.get(GregorianCalendar.DATE));
     status = true;
   } else {
     System.out.println("Wrong username and/or password");
     status = false;
   }
   return status;
 }