/** * Creates a user account. Requires {@link Jenkins#ADMINISTER} */ @Restricted(NoExternalUse.class) public User createAccountByAdmin(StaplerRequest req, StaplerResponse rsp, String addUserView, String successView) throws IOException, ServletException { checkPermission(Jenkins.ADMINISTER); User u = createAccount(req, rsp, false, addUserView); if (u != null && successView != null) { rsp.sendRedirect(successView); } return u; }
/** * Creates a user account. Intended to be called from the setup wizard. * Note that this method does not check whether it is actually called from * the setup wizard. This requires the {@link Jenkins#ADMINISTER} permission. * * @param req the request to retrieve input data from * @return the created user account, never null * @throws AccountCreationFailedException if account creation failed due to invalid form input */ @Restricted(NoExternalUse.class) public User createAccountFromSetupWizard(StaplerRequest req) throws IOException, AccountCreationFailedException { checkPermission(Jenkins.ADMINISTER); SignupInfo si = validateAccountCreationForm(req, false); if (!si.errors.isEmpty()) { String messages = getErrorMessages(si); throw new AccountCreationFailedException(messages); } else { return createAccount(si); } }
/** * Creates an user account. Used by admins. * * This version behaves differently from {@link #doCreateAccount(StaplerRequest, StaplerResponse)} in that * this is someone creating another user. */ public void doCreateAccountByAdmin(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(Hudson.ADMINISTER); if(createAccount(req, rsp, false, "addUser.jelly")!=null) { rsp.sendRedirect("."); // send the user back to the listing page } }
/** * Creates an user account. Used by admins. * * This version behaves differently from * {@link #doCreateAccount(StaplerRequest, StaplerResponse)} in that this is * someone creating another user. */ public void doCreateAccountByAdmin(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(Hudson.ADMINISTER); if (createAccount(req, rsp, false, "addUser.jelly") != null) { rsp.sendRedirect("."); // send the user back to the listing page } }
/** * Creates an user account. Used by admins. * * This version behaves differently from {@link #doCreateAccount(StaplerRequest, StaplerResponse)} in that * this is someone creating another user. */ public void doCreateAccountByAdmin(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(Hudson.ADMINISTER); if(createAccount(req, rsp, false, "addUser.jelly")!=null) { rsp.sendRedirect("."); // send the user back to the listing page } }
/** * Creates an user account. Used by admins. * * This version behaves differently from {@link #doCreateAccount(StaplerRequest, StaplerResponse)} in that * this is someone creating another user. */ public void doCreateAccountByAdmin(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { checkPermission(Hudson.ADMINISTER); if(createAccount(req, rsp, false, "addUser.jelly")!=null) { rsp.sendRedirect("."); // send the user back to the listing page } }
/** * Creates a user account. Requires {@link Jenkins#ADMINISTER} */ @Restricted(NoExternalUse.class) public User createAccountByAdmin(StaplerRequest req, StaplerResponse rsp, String addUserView, String successView) throws IOException, ServletException { checkPermission(Jenkins.ADMINISTER); User u = createAccount(req, rsp, false, addUserView); if (u != null && successView != null) { rsp.sendRedirect(successView); } return u; }