Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

How to update password in remote website ?

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
11 years 1 month ago - 11 years 1 month ago #233864 by dotcom22
hello

I have 2 website:

Website A: CB installed with several addon such Auto-Action.
Website B: Simple site without CB

Some specific users of website A will have also an account on website B and I would like use same login/password for access in both site. I setup website B for disallow Edit Profil (such email and password) and my goal is to update the password in website B IF users update their password in website A.

For do that, I suppose is required to code a little script and place the file somewhere in website B. Then use in website A, Auto-Action with a Post request (with trigger Afteruserupdate) who will transmit updated password to the script and let the script update the password. So the Post Url will look probably like this:

www.websiteB.com/update_password.php?userid= [user_id]&password=[password]

This is right ? It is possible to perform this task in this way or this is subject to some limitation ?

thank

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins
Last edit: 11 years 1 month ago by dotcom22.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 1 month ago #233903 by krileon
Replied by krileon on topic How to update password in remote website ?
Use a Query action in CB Auto Actions on the after registration, after profile update, and after login triggers. Those are the only times the password will be cleartext and can be pushed to your second site as cleartext. You'd set your query action to External and specify everything you need to connect to your external sites database. This way you're pushing the password straight to the database.

If you already have an endpoint though to do this via HTTP call then you can use the Request action to send a POST to your URL.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
11 years 1 month ago - 11 years 1 month ago #233913 by dotcom22
Replied by dotcom22 on topic How to update password in remote website ?
I tested you suggestion but I got an error500 and this disallow me to create the action. This is due to mod_security of CB server so I just asked Beat to add an exception.

Meanwhile could you tell me:

1) What I'm supposed to set in "Host" field of external DB ? I suppose if the remote site is hosted in the same server, I need to set "localhost" ??? And if is hosted in another server, I must set what ??? server IP or Url such www.remote.com ??


2) The following query is right for do what I want ?
Code:
UPDATE `jos_comprofiler` SET `password` = '[password]' WHERE `email` = '[email]'



thank

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins
Last edit: 11 years 1 month ago by dotcom22.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 1 month ago #233930 by krileon
Replied by krileon on topic How to update password in remote website ?

1) What I'm supposed to set in "Host" field of external DB ? I suppose if the remote site is hosted in the same server, I need to set "localhost" ??? And if is hosted in another server, I must set what ??? server IP or Url such www.remote.com ??

If the database is on a completely different host then you put the URL or IP Address to your site. If it's on the same server, but different database set it to localhost or the IP Address. If it's on the same server and same database then use Internal.

2) The following query is right for do what I want ?

No, you need to query _users. CB does not store password and email in _comprofiler.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
11 years 1 month ago - 11 years 1 month ago #234002 by dotcom22
Replied by dotcom22 on topic How to update password in remote website ?
Beat added an exception in the server for allow me to use a query Action. So I have set the action using now this query:
Code:
UPDATE `jos_users` SET `password` = '[var1_password]' WHERE `email` = '[email]'

Action is well fired but unfortunately I cannot login in remote Joomla using the new password.

My external DB credential seem to be correct because the Test Connection display 2 green message telling:

Connected to the External database server successfully.
Connected to the External database successfully.


The password seem to be well updated because if I set a password (from remote site Backend) such "hello123" and I update my profile (from my main site where the action is fired), then I cannot login using "hello123" in remote site. So a modification is well performed but not with the new password...

You told me in a previous post, the password is sent in cleartext only when using some specific trigger such onafteruserupdate and this is the trigger I use.

I tried also using this query:
Code:
UPDATE `jos_users` SET `password` = '[password]' WHERE `email` = '[email]'

but this don't change nothing...

Any clue?

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins
Last edit: 11 years 1 month ago by dotcom22.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 1 month ago #234010 by krileon
Replied by krileon on topic How to update password in remote website ?
If you're pushing the data to an external Joomla install then you need to push the encrypted password. Joomla does not work with plaintext passwords. Each Joomla install has a unique secret aswell, which is used to match passwords. Both of your installs would need the same secret in configurationn.php I believe for it to work properly otherwise you'll need to encode the password your self with your other sites secret.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

Moderators: beatnantkrileon
Powered by Kunena Forum