Open adriansev opened 3 months ago
Some notes for changing the password
https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/user/card.php#L679 https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/user/card.php#L686
Seems like the entire segment from line 673 to like 695 handles password changes and if needed sending it to the user.
The 2 functions called above are found here:
public function setPassword: https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/user/class/user.class.php#L2394
public function send_password https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/user/class/user.class.php#L2536
What kind of http method would be a good choice here?
GET, PUT, POST?
GET - no, because we are not getting any data PUT - no because we are not putting any data either, the password is generated and then sent, we do not supply the password POST - same reasons as PUT
basing my attempt on:
* @url GET {id}/setGroup/{group}
*/
public function setGroup($id, $group, $entity = 1)
I'll sprinkle in some code from public function put($id, $request_data = null)
as well
It changes the password, but at the moment I can not get it to send, and I do not like some variables I had to set
Feature Request
It would be really useful to have a programmatic way to regenerate and send user password.
Use case
For programmatic creation of users, an addition of regenerate and send password would complete the user addition procedure. Moreover, for security reasons, would be useful to have this functionality as part of REST API.
Suggested implementation
No response
Suggested steps
No response