Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

[SOLVED] Customize URL in CB Reconfirm

  • sysopcrew
  • sysopcrew
  • OFFLINE
  • Posts: 74
  • Thanks: 14
  • Karma: 3
7 years 10 months ago - 7 years 10 months ago #292367 by sysopcrew
[SOLVED] Customize URL in CB Reconfirm was created by sysopcrew
This isn't really a bug, but an issue I've run into. I'm using JFactory and CB API in external code (I've previously posted about this in another thread about the CB Profile Update Logger).

The good news is the CB Reconfirm plugin fires when my staff update the email address through my custom form. However, my staff use a dedicated URL that differs from the site URL that our volunteers use.

Example (not actual URLs): staff.example.org/edit/ is the staff form.

Volunteers use example.org/ to login and edit profiles.

When staff update the email address, CB Reconfirm sends an email, but the confirm link is staff.example.org/edit/profile/pluginclass/cbreconfirmemail?confirmcode=reg123abc789xyz ( example.org/profile/ is the required CB Profile menu item)

The confirm link should only be example.org/profile/pluginclass/cbreconfirmemail?confirmcode=reg123abc789xyz (sans "staff" subdomain and sans "/edit" in the URL).

Is there a way to correct this? Or will I need to edit the CB Reconfirm PHP file and just remember it for if/when it gets updated next?

--
David Riviera
Last edit: 7 years 10 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • sysopcrew
  • sysopcrew
  • OFFLINE
  • Posts: 74
  • Thanks: 14
  • Karma: 3
7 years 10 months ago #292368 by sysopcrew
Replied by sysopcrew on topic Customize URL in CB Reconfirm
For the time being, I edited /components/com_comprofiler/plugin/user/plug_cbreconfirmemail/cbreconfirmemail.php by adding the line:
Code:
$mailBody = str_replace('https://staff.example.org/edit/','https://example.org/',$mailBody);

Before this line:
Code:
$cbNotification->sendFromSystem

And the correct link is now in the email. I know if I update this plugin, this will be lost, so if there's a better permanent solution, that'd be cool.

--
David Riviera

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

  • sysopcrew
  • sysopcrew
  • OFFLINE
  • Posts: 74
  • Thanks: 14
  • Karma: 3
7 years 10 months ago #292369 by sysopcrew
Replied by sysopcrew on topic Customize URL in CB Reconfirm
Just noticed that the email still ends in:
Code:
NOTE: This email was automatically generated from Metro Skywarn (https://staff.example.org/edit/).

I'm guessing that is added by $cbNotification->sendFromSystem(). Any way to override that?

--
David Riviera

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
7 years 10 months ago #292377 by krileon
Replied by krileon on topic Customize URL in CB Reconfirm
That site URL is based off your $live_site value in configuration.php. If it's empty then it's based off whatever domain they're viewing your site as. You can hardcode it to whatever you want resulting in all of those URLs always pointing to whatever domain you supply, but it will also affect all URLs output in HTML as well. Aside from that you would need to edit the language string and supply the URL your self with whatever domain you want (you can substitute in the confirm code with [cbactivation]).


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.
The following user(s) said Thank You: sysopcrew

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

  • sysopcrew
  • sysopcrew
  • OFFLINE
  • Posts: 74
  • Thanks: 14
  • Karma: 3
7 years 10 months ago #292395 by sysopcrew
Replied by sysopcrew on topic Customize URL in CB Reconfirm
$live_site did exactly what I needed. There's no Joomla HTML output to my custom staff URL, so setting $live_site will do fine. Thanks!

--
David Riviera
The following user(s) said Thank You: krileon

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

  • sysopcrew
  • sysopcrew
  • OFFLINE
  • Posts: 74
  • Thanks: 14
  • Karma: 3
7 years 10 months ago #292398 by sysopcrew
Replied by sysopcrew on topic Customize URL in CB Reconfirm
I also now trap $_GET and $_GET=='cancel' in my own code before I build JFactory and CB API and redirect it to the proper URL. Another simple solution I didn't think of earlier. JFactory/CB are only part of our larger solution, and the project may double next year.

--
David Riviera
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum