Simple Machines Community Forum

Archived Boards and Threads... => Archived Boards => Joomla Bridge Support => Topic started by: paki on October 13, 2006, 01:34:11 PM

Title: Password Reminder E-mail Problems (the link in them)
Post by: paki on October 13, 2006, 01:34:11 PM
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.
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: Orstio on October 13, 2006, 05:33:19 PM
In your smf.php, what does the integrate_outgoing_email function look like?
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: paki on October 14, 2006, 03:26:57 AM
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);
}
}*/

}
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: Orstio on October 14, 2006, 08:44:10 AM
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;
}
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: paki on October 14, 2006, 02:14:12 PM
perfect! thanks for your help!
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: akolar on November 07, 2006, 08:06:11 PM
I confirm that this works. Thanks, Orstio!
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: Jo-bit 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?
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: Sageth on December 13, 2006, 08:17:13 PM
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. 
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: BarryBarry on January 02, 2007, 11:14:12 AM
This solves the problem with re-authorizing,
but will it be part of the next update aswell?

Thnx 4 the solution.
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: arekanderu on January 06, 2007, 02:53:30 PM
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
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: Orstio on January 06, 2007, 03:15:44 PM
integrate_outgoing_email is definitely in smf.php of bridge 1.1.6.
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: arekanderu on January 06, 2007, 09:26:43 PM
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);
}
}*/

}
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: Orstio on January 06, 2007, 09:28:48 PM
Right.  Try the code in my post above instead of that.
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: arekanderu on January 06, 2007, 09:33:03 PM
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 =)
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: imrich on January 08, 2007, 03:36:51 PM
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).
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: 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
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: Jo-bit on February 04, 2007, 04:46:38 AM
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???
  ::)

Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: imrich on February 04, 2007, 09:28:56 AM
oops.. is this change required for bridge 1.1.7?
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: Alcor on February 22, 2007, 06:28:25 AM
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  
Title: Re: Password Reminder E-mail Problems (the link in them)
Post by: baladeva on March 31, 2007, 09:37:35 AM
looks like there is an other fix here:
http://www.simplemachines.org/community/index.php?topic=152836.msg982449#msg982449 (http://www.simplemachines.org/community/index.php?topic=152836.msg982449#msg982449)

that one did it for me, thanks to Orstio