Update:
Today I implemented sottwell’s EditProfile snippet that allows web users to edit their profile from the website.
Everything in the provided snippet worked as expected. When a user changes their password, an email is sent to them with their login credentials utilizing the
webLoginSendNewPassword()
function inside of
weblogin.common.inc.php
However, the [+surl+] placeholder was not being replaced properly with the site url, rather it was just a period? ( . )
Looking deeper into the function, I realized it was leveraging PHP_SELF:
Line #60:
$message = str_replace("[+surl+]",dirname(PHP_SELF),$message);
I ended up having to change this line of code to the following to get it to work:
$message = str_replace("[+surl+]",$modx->config[’site_url’],$message);
What’s interesting is that I did not experience this issue when initially creating the user, and I believe the same function/email is used in both places.
Regardless, I thought I’d relay the experience regarding the change of PHP_SELF to config[’site_url’] in
weblogin.common.inc.php (Line#60) to get the link to the site to come through...
Thoughts?