Skip to Content Skip to Menu

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

Substitution old_email and new_email ?

  • dotcom22
  • dotcom22
  • OFFLINE
  • Posts: 522
  • Thanks: 14
  • Karma: 4
11 years 2 months ago - 11 years 2 months ago #232120 by dotcom22
Replied by dotcom22 on topic Substitution old_email and new_email ?
yes we have already implemented in my custom plugin the method
Code:
global $_PLUGINS; $_PLUGINS->_setErrorMSG( 'My error message.' ); $_PLUGINS->raiseError( 1 );

and this work well..

You should fire the above after every profile update so it always remains up to date. You should handle whether you need to do an actual update or not in your 3rd party solutions endpoint. So for example if I called the above then whenever the HTTP request is processed it should check if any of those have changed comparing against existing values and if they have then save and if not then just disregard the request.


I don't understand well here... As I said, I need to sync data between each server. So if user update his profile, is necessary to always fire the request. So when you say "it should check if any of those have changed comparing against existing values and if they have then save and if not then just disregard the request" you mean about which value I must compare ? The one present in CB or the one present in remote server ?

My goal was to first check if the remote server is well available and reachable (because maybe he can be down for maintenance or any other reason). So if I update data in CB and the request do not reach the remote server, data will not be sync...reason why I thinking to use BeforeUserUpdate.

any clue?

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins
Last edit: 11 years 2 months 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 2 months ago #232130 by krileon
Replied by krileon on topic Substitution old_email and new_email ?
Just fire your HTTP request on every profile update to constantly keep your external system up to date. Disregard checking if something changed or not, just always send the HTTP request after profile update. If the HTTP request fails due to not being able to reach your external system then next update will try again. All of this is done silently so this gives it the best chance of keeping your external system up to date.


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 2 months ago - 11 years 2 months ago #232143 by dotcom22
Replied by dotcom22 on topic Substitution old_email and new_email ?

then next update will try again.


What do you mean by this ? If user update his profile for example the next time he login (could be days after) ? Or you mean to build something who will attempt again and again to reach remote server until data is updated?

In both case this is not ideal for me because data between each server must absolutely be always equal each seconds/minutes. If for example a user update without problem his email in Joomla/CB but the new email was not transmitted on remote server, user will never be able to be connected to remote server. I cannot take the risk to have a user who have different email in both system. This is the reason why I prefer before be sure to be able to reach remote server. If is not possible, CB profile must not be updated and in this case data are always equal even if not updated.

I use Joomla 3.3.6 - CB 2.0.4 - CBSubs 4 - Several Incubator plugins
Last edit: 11 years 2 months 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 2 months ago - 11 years 2 months ago #232145 by krileon
Replied by krileon on topic Substitution old_email and new_email ?

What do you mean by this ? If user update his profile for example the next time he login (could be days after) ? Or you mean to build something who will attempt again and again to reach remote server until data is updated?

If the first request failed for whatever reason then the next time he updates his profile it'll try again. I suppose you could also execute your request on login too if you wanted.

In both case this is not ideal for me because data between each server must absolutely be always equal each seconds/minutes. If for example a user update without problem his email in Joomla/CB but the new email was not transmitted on remote server, user will never be able to be connected to remote server. I cannot take the risk to have a user who have different email in both system. This is the reason why I prefer before be sure to be able to reach remote server. If is not possible, CB profile must not be updated and in this case data are always equal even if not updated.

It will be assuming the connection to your external server does not fail. Fire your action after registration, after login, and after profile update and you shouldn't have any problems keeping them synchronized. There's no way for you to keep them synchronized down to the very second firing it on those 3 triggers every time is your best option to keep it synchronized.


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.
Last edit: 11 years 2 months ago by krileon.

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

Moderators: beatnantkrileon
Powered by Kunena Forum