souzadavi Posted October 25, 2021 Share Posted October 25, 2021 Hello guys, I'm trying to use the Hook ClientAreaPagePasswordReset SItuation: after user ask to create new password from password forgotten page at WHMCS, I would like to send the password URL link to his whatsApp. I didn't figure out how to use the response token from Hook ClientAreaPagePasswordReset to get the user id. Any help to get it done will be nice, I just would like to know how to get the user id from response of hook ClientAreaPagePasswordReset with the token value. thanks very much! 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted October 25, 2021 Share Posted October 25, 2021 Most if not all clientarea hooks will have userid in the vars array . <?php add_hook('ClientAreaPagePasswordReset', 1, function($vars) { $user_id = $vars['userid']; // ... continue on with code }); 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted October 25, 2021 Author Share Posted October 25, 2021 2 hours ago, steven99 said: Most if not all clientarea hooks will have userid in the vars array . <?php add_hook('ClientAreaPagePasswordReset', 1, function($vars) { $user_id = $vars['userid']; // ... continue on with code }); The userid isn't available from $vars :( 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted October 25, 2021 Author Share Posted October 25, 2021 Looking carefully now I didn't find any hook for request password change. I didn't find any hook that run when user use ask for forgotten password. 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted October 26, 2021 Share Posted October 26, 2021 Ah, was thinking of the actual reset and just the page. One, though kludge, would be using ClientChangePassword hook and tracking the reset via clientareapage hook and a database table. However, quick test shows that ClientChangePassword may not actually work as it did not fire off the logModuleCall when reset or simple change. 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted October 27, 2021 Author Share Posted October 27, 2021 I just open new request, please if it is importante to you vote there: https://requests.whmcs.com/idea/new-hook-password-forgotten thanks @steven99 I will give a try. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.