Пример #1
0
 @RequestMapping("/users")
 public ModelAndView showUsers(HttpServletRequest request) {
   if (LoginChecker.userLoggedInAndAdmin(request)) {
     List<User> users = organizer.getAllUsers();
     List<UserTO> userTOs = new LinkedList<UserTO>();
     for (User u : users) {
       userTOs.add(TransferObjectConverter.getUserTO(u));
     }
     return new ModelAndView("Users", "users", userTOs);
   }
   return new ModelAndView(
       "redirect:loginForm.htm?info='You have to be logged in as admin to view this page.'");
 }
Пример #2
0
 @RequestMapping("/alarms")
 public ModelAndView showAlarms(HttpServletRequest request) {
   if (LoginChecker.userLoggedInAndAdmin(request)) {
     List<Alarm> alarms = organizer.getAllAlarms();
     List<AlarmTO> alarmTOs = new LinkedList<AlarmTO>();
     for (Alarm a : alarms) {
       alarmTOs.add(TransferObjectConverter.getAlarmTO(a));
     }
     return new ModelAndView("Alarms", "alarms", alarmTOs);
   }
   return new ModelAndView(
       "redirect:loginForm.htm?info='You have to be logged in as admin to view this page.'");
 }