Password Reminder E-mail Problems (the link in them)

Started by paki, October 13, 2006, 01:34:11 PM

Previous topic - Next topic

paki

Hi, I apologize for not searching a lot before asking this question but I have looked around a little bit. I'm having a problem with my Activation E-mail URL's. Its a similar problem to this one: http://www.simplemachines.org/community/index.php?topic=119866.0

The URL's in the e-mails look like this:

http://www.mysite.com/component/option,com_smf/Itemid,60/action,reminder/sa,setpassword/u,1/code,abb3097866____IP: 71.23.121.111____Username: admin____Regards,__The Mysite.com Team."

First problem is that the link includes the _____IP: on it.. the next is the formatting. All spaces are ___, and at the end of the entire message there is a ", even for private messages.

I am using:

SMF 1.1RC3 (upgraded from RC2, which was an upgrade from RC1)
Bridge 1.1.6 (with patched smf_registration issue)
Joomla 1.0.11

Any ideas what could be wrong? I can give admin access / phpmyadmin access if necessary. Thanks.
http://www.dfwhyundais.com <-- Dallas/Ft. Worth's Local Hyundai Group

Orstio

In your smf.php, what does the integrate_outgoing_email function look like?

paki

#2
here you go:

function integrate_outgoing_email($subject, &$message, $headers)
{
global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings, $Itemid;

$message = str_replace ($scripturl, '"="' . $scripturl, $message);
$message .= '"';
$message = ob_mambofix($message);
$message = str_replace ('"="', ' ', $message);
$message = trim($message);
return true;

/* if ($mosConfig_sef == '1'){
$message = str_replace ($mosConfig_live_site . '/index.php', 'index.php', $message);
preg_match ('~index\.php.+~', $message, $url);
if (isset($url[0])){
$new_url = sefReltoAbs(trim($url[0]));
$new_url = str_replace(';', '/', $new_url);
$message = str_replace($url[0], $new_url, $message);
}
}*/

}
http://www.dfwhyundais.com <-- Dallas/Ft. Worth's Local Hyundai Group

Orstio

Try this instead:

function integrate_outgoing_email($subject, &$message, $headers)
{
global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings, $Itemid, $hotmail_fix;

//First, we need to set up the email so that ob_mambofdix knows what to do with it
$message = str_replace ($scripturl, '"="' . $scripturl, $message);
//Next, let's make sure that URLs with # and . characters don't get mashed up
$message = str_replace ('#new', '"#new', $message);
$message = preg_replace ('/(\.[0-9])/', '"$1', $message);
$message .= '"="';
$message = ob_mambofix($message);
//Now we need to undo those changes so the email looks normal again
$message = str_replace ('"="', ' ', $message);
$message = str_replace ('"#new', '#new', $message);
$message = str_replace ('".', '.', $message);
//THis is an email, after all, so let's make sure entities and specail characters are text, not HTML
$message = trim($message);
    $message = html_entity_decode($message);
$message = un_htmlspecialchars($message);
//No idea why sefReltoAbs does this, but....
$message = str_replace ('____', '
', $message ); //yes, it looks ridiculous, but it works :P
$hotmail_fix = false;
return true;
}

paki

http://www.dfwhyundais.com <-- Dallas/Ft. Worth's Local Hyundai Group

akolar


Jo-bit

Hi!
I changed the line:
$message = str_replace ('____', '
to
$message = str_replace ('__', '

SMF 1.1 Final needs two underscores and it's work!

Can anyone confirm this?

Sageth

I had the same problem after downloading the 1.1.6 bridge with 1.1 Final.  I changed it to two underscores and it works. 

Nice catch. 

BarryBarry

This solves the problem with re-authorizing,
but will it be part of the next update aswell?

Thnx 4 the solution.

arekanderu

can you please tell me where exactly is the line that needs to be changed because in my smf.php of the Bridge (version 1.1.6) i can not find it in the function mentioned above. I do experience the same issue however.

SMF version 1.1.1

Orstio

integrate_outgoing_email is definitely in smf.php of bridge 1.1.6.

arekanderu

Below is the integrate_outgoing_email from my smf.php


function integrate_outgoing_email($subject, &$message, $headers)
{
global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings, $Itemid;

$message = str_replace ($scripturl, '"="' . $scripturl, $message);
$message .= '"';
$message = ob_mambofix($message);
$message = str_replace ('"="', ' ', $message);
$message = trim($message);
return true;

/* if ($mosConfig_sef == '1'){
$message = str_replace ($mosConfig_live_site . '/index.php', 'index.php', $message);
preg_match ('~index\.php.+~', $message, $url);
if (isset($url[0])){
$new_url = sefReltoAbs(trim($url[0]));
$new_url = str_replace(';', '/', $new_url);
$message = str_replace($url[0], $new_url, $message);
}
}*/

}

Orstio

Right.  Try the code in my post above instead of that.

arekanderu

ah ok, i didn't use it earlier because the post had "October 2006" as a date so i figured that it wouldn't be correct. I have also done the change bitpms suggested and i hope that it will be ok now =)

imrich

I'm using SMF 1.1.1 and Joomla 1.0.12 along with bridge 1.1.6 and this patch to smf.php which Orstio shows above.

The activation email works OK, however, if the user tries to use the alternate method of clicking on the "Did you miss the activation email?" link in the login pane and then try to enter his activation code into "If you already know your activation code, enter it here." He is stuck in in a perpetual loop!

The user can either select "Resend Activation code" (which has a link which won't work for this user for some reason).  But if the user tries to enter the activation code manually, he recieves a "Your email address needs to be validated before you can login. Need another activation email?"

Shouldn't the user be allowed to enter his activation code and login directly at this point?

Help please, I have users who are getting frustrated and can't login (and I can't help them except to manually activate them).

matjazz

Quote from: bitpms on December 02, 2006, 07:26:40 PM
Hi!
I changed the line:
$message = str_replace ('____', '
to
$message = str_replace ('__', '

SMF 1.1 Final needs two underscores and it's work!

Can anyone confirm this?


This is working on 1.1.1 ;) tnx a lot :D

Jo-bit

Quote from: matjazz on February 02, 2007, 01:19:58 PM
Quote from: bitpms on December 02, 2006, 07:26:40 PM
Hi!
I changed the line:
$message = str_replace ('____', '
to
$message = str_replace ('__', '

SMF 1.1 Final needs two underscores and it's work!

Can anyone confirm this?


This is working on 1.1.1 ;) tnx a lot :D


The same fault with the bridge 1.1.7 !
WHY???
  ::)


imrich


Alcor

Same problem with the activation link. Versions: SMF 1.1.2, bridge 1.1.7 and Jommla 1.0.12. I did this too and not works

Quote from: matjazz on February 02, 2007, 01:19:58 PM
Quote from: bitpms on December 02, 2006, 07:26:40 PM
Hi!
I changed the line:
$message = str_replace ('____', '
to
$message = str_replace ('__', '

SMF 1.1 Final needs two underscores and it's work!

Can anyone confirm this?


This is working on 1.1.1 ;) tnx a lot :D

and the links sent in the email are wrong, like:

http://www.domain.com/component/option,com_smf/Itemid,73/action,profile/u,1577__Saludos,_El  

baladeva

#19
looks like there is an other fix here:
http://www.simplemachines.org/community/index.php?topic=152836.msg982449#msg982449

that one did it for me, thanks to Orstio

Advertisement: