- try {
- if (req.getParameter("revokeall") != null) {
- if ( !Form.getForm(req, SupportRevokeCertificatesForm.class).submit(resp.getWriter(), req)) {
- throw new GigiApiException("No ticket number set.");
- }
- } else if (req.getParameter("detailupdate") != null || req.getParameter("resetPass") != null) {
- if ( !Form.getForm(req, SupportUserDetailsForm.class).submit(resp.getWriter(), req)) {
- throw new GigiApiException("No ticket number set.");
- }
+ User user = getUser(req, resp);
+ if (user == null) {
+ return;
+ }
+ if (Form.printFormErrors(req, resp.getWriter())) {
+ Form f = getForm(req);
+ SupportedUser targetUser = new SupportedUser(user, getUser(req), LoginPage.getAuthorizationContext(req).getSupporterTicketId());
+
+ if (f instanceof SupportUserDetailsForm) {
+ outputContents(req, resp, user, new SupportRevokeCertificatesForm(req, targetUser), (SupportUserDetailsForm) f);
+ } else if (f instanceof SupportRevokeCertificatesForm) {
+ outputContents(req, resp, user, (SupportRevokeCertificatesForm) f, new SupportUserDetailsForm(req, targetUser));