I'm creating this post after doing some search on this topic and unable to find a solution. I need some assistance with a code sample for the specific requirement below:
I've a need to duplicate the user creation steps within a custom plugin that I'm creating. Basically, a view within the plugin to create a user with user ID, email and name. Then I would like to automatically assign this user to one specific survey ID and a token.
Appreciate it, if someone could offer some guidance with some code snippet. Thanks in advance.
I have made some progress on my end by creating the view and was able to create the user with the proper permissions in the database. Where I am stuck is the password creation. Can someone please help me understand how LimeSurvey encrypts the PW and how I can call the same function to achieve this.
Sorry, I can't answer exactly to your question.
BTW I think you should be interested by a similar process for token... Maybe api offers a way to create users as well
I was able to create the user password by using SHA256 to hash the password and store it in the database table. I am now able to login as the new user and all the permissions that I set pragmatically through my plugin are working properly.