Grab new profile info to send to a 3rd party API

kdiamond

Member
Is there a possible process to 'grab' the password that new user creating their own profile (and also using the jUser Fabrik plugin) enters/entered?

My juser plugin is working well, and I am looking into having the new users username, name, and password sent over to a 3rd party API to have them created there automatically. The API is NOT what I am asking about, I am merely asking for any suggestions/guidance on the password field and if it can be grabbed and sent by PHP to the REST API since from what I can tell I need to send a 'clear' password to the API when creating the user over there.

Thank you-
 
Yes. You should be able to run a PHP form submission plugin, running 'onAfterProcess', and get the clear text password by doing ...

Code:
$passwd = $formModel->getElementData('yourtable___yourpasswd');

... and so on, for the values you need.

I can't remember offhand if the full table___element format is needed in onAfterProcess. If that doesn't work, just use the short name, like 'yourpassword', instead.

Alternatively, you can access the form's data array directly in $formModel->formData[].

-- hugh
 
Note the reason for using onAfterProcess, rather than onBeforeProcess, is so your code gets run after validation and storing of the form, and the juser plugin has run.

You'll also probably want to set the plugin to only run on 'new'. You may want to have a separate plugin set for 'edit' which handles changing of the password through the API, if that's an issue.

-- hugh
 
Excellent point on the edit side. Agreed. Thanks for the response. I was thinking the password would be hashed, but the way you describe it, I should be able to retreive it clear.

Best-
 
Yup, even if you set a field element to "password", that only obscures the input, it still submits in clear text, which you can access in the $formModel->formData[] array, or using the $formModel->getElementData() method.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top