0

We are using SugarCRM Professional 6.4.2 hosted on our own LAMP server.

For the sake of privacy, I want to override the way /modules/Campaigns/WebToLeadCapture.php handles the "redirect" destination. Currently it includes all the form field data as GET variables in the redirect URI string which, when combined with web analytics tools, kiosk computers, etc., exposes our users' data.

I know where the URI string is constructed in WebToLeadCapture.php, and I know how to remove/disable that section of code, but I want to do this in an upgrade-safe location—not in the same file.

WebToLeadCapture.php does have a line about upgrade-safe customizations, but it's not especially helpful:

/**
* To make your changes upgrade safe create a file called leadCapture_override.php and place the changes there
*/

...I don't know where the suggested leadCapture_override.php file is intended to go.

I am inclined to conclude, based on the results of my web and forum research, that the recommendation to use that filename is a relic of when WebToLeadCapture.php was located (not as a mere redirect, as it is now) in the web root of the SugarCRM application, before the allowed "Entry Points" code was revamped.

This is further complicated by the fact that the web to lead capture functionality is designed to use /index.php as the form action, meaning that the core code-base determines (somehow) which file to use to handle the action, and has to recognize it as an allowed entry point. In other words, if SugarCRM is equipped to allow upgrade-safe customizations to WebToLeadCapture.php, it would have to look for the existence of a specific file in a specific location as a potential replacement.

Any recommendations or advice?

Thanks in advance!

nmjk
  • 749
  • 3
  • 9
  • 25

1 Answers1

2

Lead capture happens in modules/Leads/Capture.php now. In that file you will see the reference to the leadCapture_override.php file near the top. It is looking for that file in the root directory of your SugarCRM instance. If it is there then that code will execute instead. Basically copy Capture.php to the root directory, rename to leadCapture_override.php, and remove that file_exists conditional check for leadCapture_override.php.

egg
  • 1,736
  • 10
  • 12
  • I don't understand how modules/Leads/Capture.php comes into the mix when the Web-to-Lead capture forms are generated in the Campaigns module, and the form action that's generated is "/index.php?entryPoint=WebToLeadCapture". Are we thinking of two different things? I've also confirmed that the file I'm looking at is correct, because I edited it in place and achieved the desired effect. It's just not upgrade safe. – nmjk Oct 24 '13 at 01:19
  • You're right. Can you switch over to entryPoint=leadCapture instead? WebToLeadCapture cannot be customized in an upgrade-safe manner. – egg Oct 24 '13 at 01:26
  • 1
    That did the trick. For anyone referencing this answer in the future, I actually copied /modules/Campaigns/WebToLeadCapture.php to /leadCapture_override.php and changed the form action "entryPoint" parameter to "leadCapture". No other changes to form structure were needed. Thanks, @egg! – nmjk Oct 24 '13 at 22:44