Ejemplo n.º 1
0
  protected boolean renderHeader() throws ServletException, IOException {
    if (!isLoggedOn()) {
      pageContext.setAttribute(
          "ems.header.logo",
          BrandManager.DEFAULT_HEADER_LOGO + ".gif",
          //
          // BrandingSettings.getInstance().getHeaderLogo() + ".gif",
          PageContext.REQUEST_SCOPE);
      pageContext.include("/WEB-INF/jspf/common/templates/page/CappEmptyHeader.jspf");
      return true;
    }

    pageContext.getResponse().setCharacterEncoding("UTF-8");

    UserContext userContext = UserContext.getInstanceFromPageContext(pageContext);
    Customer customer = userContext.getCurrentCustomer();
    pageContext.setAttribute("user", userContext.getCurrentUser());
    pageContext.setAttribute("customer", customer);

    // figure out which header to user
    pageContext.setAttribute("user", userContext.getCurrentUser());
    pageContext.setAttribute("ems.header.logoff", "epalogoff.do", PageContext.REQUEST_SCOPE);
    pageContext.setAttribute("ems.header.home", "customerSearch.do", PageContext.REQUEST_SCOPE);
    pageContext.setAttribute(
        "ems.header.logo",
        BrandManager.DEFAULT_HEADER_LOGO + "_epa.gif",
        // BrandingSettings.getInstance().getHeaderLogo() + "_epa.gif",
        PageContext.REQUEST_SCOPE);
    pageContext.include("/WEB-INF/jspf/common/templates/page/CappHeader.jspf");
    return true;
  }
Ejemplo n.º 2
0
  public ActionForward executeInContext(
      UserContext uc,
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response) {
    int uid = Integer.parseInt(request.getParameter(Constants.USER_ID_FULL));
    int custID = Integer.parseInt(request.getParameter(Constants.CUSTOMER_ID));
    IUserManager um = ManagementContainer.getInstance().getUserManager();

    UserAccount user = um.getUserAccount(custID, uid);

    if (user == null) {
      return mapping.findForward(FAILURE);
    }

    try {
      um.deleteEpaUser(user.getPrimaryEmail());
    } catch (Exception ex) {
      reportSingleError(
          request, ActionMessages.GLOBAL_MESSAGE, "error.epa.user.delete.error", ex.getMessage());
      return mapping.findForward(FAILURE);
    }

    IAuditManager auditManager = ManagementContainer.getInstance().getAuditManager();
    auditManager.saveAudit(
        IAuditManager.AuditCategory.EPA_MGMT,
        "Removed EPA user " + user.getDisplayName() + " ( " + user.getPrimaryEmail() + " )",
        "Remove EPA User Audit",
        null,
        uc.getCurrentUser().getPrimaryEmail());
    return mapping.findForward(SUCCESS);
  }
Ejemplo n.º 3
0
  protected ActionForward executeInContext(
      UserContext uc,
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response) {
    UserEmergencyContactsForm form = (UserEmergencyContactsForm) actionForm;
    IUserManager userManager = ManagementContainer.getInstance().getUserManager();
    EmergencyContactSet contactSets =
        userManager.getEmergencyContacts(uc.getCurrentUser().getUserID());
    if (contactSets != null) {
      form.populateForm(contactSets);
    }

    return mapping.findForward(SUCCESS);
  }