@Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String action = request.getParameter("action");
        if (Utils.isNullOrEmpty(action)) {
            return;
        }
        PrintWriter out = response.getWriter();
        if (action.equals("assignuser")) {
            //admin is assigning a user
            int eventid = Integer.parseInt(request.getParameter("eventid"));
            int userid = Integer.parseInt(request.getParameter("userid"));
            int adminid = ((UserDAO.User) request.getSession().getAttribute("user")).id;
            java.util.Date date = new java.util.Date();
            Timestamp timereserved = new Timestamp(date.getTime());
            EventAssignmentsDAO.EventAssignment assignment = EventAssignmentsDAO.assignUser(eventid, userid, adminid, timereserved);
            if (assignment != null) {
                out.write("success");
            } else {
                out.write("fail");
            }
        }
        out.flush();
        out.close();
    }