get the password after user registration?

  • Matthias Schneider
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 1 month ago #111331 by Matthias Schneider
get the password after user registration? was created by Matthias Schneider
Hi,

I'm trying to use PHP script plugin to create a user on a different system using some PHP curl commands.

What I would like to get working is that after the user registered and subscribed to a plan, my PHP script creates the user with same username and password on my other system.

Problem is that I don't know if or how I can retrieve the password the user entered when he registered for the plan.
There is no problem to get the username and email with $row->username and $row->email, but $row->user_password is always empty.

Is there anything I'm doing wrong? Or am I using wrong approach to get this working?

Thanks,
Matt

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago #111356 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic get the password after user registration?
Hi Matt

Unfortunately, it is not possible to get the raw password. The reason is because in Joomla, password of an user is encrypted, and there is no way to get the raw password back

If you really want to get password of the user, I think you will have to get it directly from the request. Mean your plugin will needs to process onAfterStoreSubscription event trigger

Try to get password using $password = JFactory::getApplication()->input->getString('password1');

It should give you the data you need

Regards,

Tuan
The following user(s) said Thank You: Matthias Schneider

Please Log in or Create an account to join the conversation.

  • Matthias Schneider
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 1 month ago - 7 years 1 month ago #111385 by Matthias Schneider
Replied by Matthias Schneider on topic get the password after user registration?
Hi Tuan,

thanks for your quick reply.


Actually $password = JFactory::getApplication()->input->getString('password1') also works perfectly in the PHP script plugin when I add it to the 'Subscription Active Script'.


Thank you,
Matt
Attachments:
Last edit: 7 years 1 month ago by Matthias Schneider.

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago #111386 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic get the password after user registration?
To be more clear, that only works if you use a credit card base payment method (or the subscription is free)

If you use online payment method such as PayPal, users will be directed to payment gateway to process payment and subscription active script will only be executed after payment completed, so that code could not be used to get password anymore (the password data is not available in the request if you understand)

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • Matthias Schneider
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 1 month ago #111387 by Matthias Schneider
Replied by Matthias Schneider on topic get the password after user registration?
Thank you very much Tuan!
I somehow expected something like that... :)

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago #111399 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic get the password after user registration?
OK Matthias. Hopefully, you can handle it working as expected base on my feedback

Regards,

Tuan

Please Log in or Create an account to join the conversation.