anteo / redmine_custom_workflows

Allows to create custom workflows for Redmine
http://www.redmine.org/plugins/custom-workflows
GNU General Public License v2.0
182 stars 72 forks source link

Create user account #256

Closed koren85 closed 1 year ago

koren85 commented 2 years ago

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!

dalekgamma commented 2 years ago

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

picman commented 2 years ago

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 = 'jdoe@gmail.com'
if u.save
  Rails.logger.info "New user #{u} created"
else
  Rails.logger.error u.errors.full_messages.to_sentence
end
picman commented 1 year ago

No feedback => closing