if (cancel != null) { if (!"list".equals(from)) { return "mainMenu"; } return "cancel"; }
    public String save() throws Exception {        if (cancel != null) {            if (!"list".equals(from)) {                return "mainMenu";            }            return "cancel";        }        if (delete != null) {            return delete();        }        Boolean encrypt = (Boolean) getConfiguration().get(Constants.ENCRYPT_PASSWORD);        if (StringUtils.equals(getRequest().getParameter("encryptPass"), "true")                 && (encrypt != null && encrypt.booleanValue())) {            String algorithm = (String) getConfiguration().get(Constants.ENC_ALGORITHM);            if (algorithm == null) { // should only happen for test case                log.debug("assuming testcase, setting algorithm to 'SHA'");                algorithm = "SHA";            }            user.setPassword(StringUtil.encodePassword(user.getPassword(), algorithm));        }        boolean isNew = ("".equals(getRequest().getParameter("user.version")));        String[] userRoles = getRequest().getParameterValues("user.userRoles");        for (int i = 0; userRoles != null && i < userRoles.length; i++) {            String roleName = userRoles[i];            user.addRole(roleManager.getRole(roleName));        }        try {            userManager.saveUser(user);        } catch (UserExistsException e) {            log.warn(e.getMessage());            List args = new ArrayList();            args.add(user.getUsername());            args.add(user.getEmail());            addActionError(getText("errors.existing.user", args));            // redisplay the unencrypted passwords            user.setPassword(user.getConfirmPassword());            return INPUT;        }        if (!"list".equals(from)) {            // add success messages            saveMessage(getText("user.saved"));            return "mainMenu";        } else {            // add success messages            List args = new ArrayList();            args.add(user.getFullName());            if (isNew) {                saveMessage(getText("user.added", args));                // Send an account information e-mail                message.setSubject(getText("signup.email.subject"));                sendUserMessage(user, getText("newuser.email.message", args),                                RequestUtil.getAppURL(getRequest()));                return "addAnother";            } else {                saveMessage(getText("user.updated.byAdmin", args));                return INPUT;            }        }    }