OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions I want to create a user in process.yml

This topic contains 4 replies, has 2 voices, and was last updated by  Jaimy 7 years, 4 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #34312

    thinh2010
    Participant

    Hi there,

    I am working on a student management system. My ideal is each time I create a new student, I want to also create a user related to this student, to login the system.

    So that I think I must work with process.yml. But I cannot found the way to create a new user, because the password needs encrypt.

    Do you guys have any ideal?
    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #34313

    thinh2010
    Participant

    Hi,

    I found a solution

    #34314

    Jaimy
    Participant

    Hi @thinh2010,

    Not entirely sure if this is going to work, but you might create a sample process like this and modify it to your needs. If I’m not mistaken when a user is created through the GUI, the password is being encrypted after submitting. So having the PlainPassword attribute set, might help with your quest of creating a User in a process.

    Hope this helps!

    Kind Regards,

    Jaimy Casteleijn

    #34315

    thinh2010
    Participant

    @Hi Jaimy,

    Thanks for your reply. I already found a way to do it, and posted above.

    Your code I think will not work because if you just set the plainPassword, there is exception said that you need password to create an User (I already tried it before and got this error)

    So that you need call the updateUser function in UserManager via @call_service_method to generate encrypted password from plainPassword.

    Regards,

    Thinh

    #34316

    Jaimy
    Participant

    Hi @thinh2010,

    Good call on the call_service_method, that will do the trick :). It’s nice of you to post the solution you’ve found, since there might be others who’re dealing with some of the same issues as you were having with the creation of an User via a different way than the GUI. This will might help others in their development with OroCRM

    Kind Regards,

    Jaimy Casteleijn

Viewing 4 replies - 1 through 4 (of 4 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

Back to top