redmine_custom_workflows icon indicating copy to clipboard operation
redmine_custom_workflows copied to clipboard

Create user account

Open koren85 opened this issue 2 years ago • 2 comments

Hi, I need to create an account from custom fields. Including send a letter to the specified mail that a new ticket has been created. What is the best way for me to proceed and is it possible to create an account for a user without administrator rights? Any help is welcome!

koren85 avatar Apr 19 '22 12:04 koren85

If you have LDAP set up, you can allow user creation on login, but there is no way to allow user creation without admin access.

Using the REST interface to create the user using an admin API key would be a much better option, and safer.

Details of the API can be found here: https://www.redmine.org/projects/redmine/wiki/Rest_Users

https://www.redmine.org/boards/2/topics/58073 for more info

dalekgamma avatar May 27 '22 14:05 dalekgamma

For sure you can create a user account using before/after script. e.g.:

u = User.new
u.firstname = 'John'
u.lastname = 'Doe'
u.login = 'jdoe'
u.password = 'secret123'
u.password_confirmation = 'secret123'
u.mail = '[email protected]'
if u.save
  Rails.logger.info "New user #{u} created"
else
  Rails.logger.error u.errors.full_messages.to_sentence
end

picman avatar Jun 22 '22 11:06 picman

No feedback => closing

picman avatar Feb 01 '23 11:02 picman