Home arrow Forum Unusual Error with JSMF RC3
  Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 12:04:57 AM
Home New Posts Search Calendar


Login with username, password and session length
+  Joomla Forum
|-+  Joomla Hacks
| |-+  Joomla-SMF Forum Support
| | |-+  Joomla-SMF 2.0.x (Moderators: -Wolverine, kai920)
| | | |-+  Unusual Error with JSMF RC3
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Unusual Error with JSMF RC3  (Read 2011 times)
Peter
Joomla Newbie
*

Karma: +1/-0
Offline Offline

Posts: 20


View Profile
Unusual Error with JSMF RC3
« on: December 05, 2006, 08:23:55 PM »

Hello,

I've just upgraded to JSMF RC3...Everything is working fine except one thing.

When a user logs in (via CB) its doing something slightly odd.

I have xxxx.net as the main domain for my site, and xxxxx.com/org/co.uk parked and pointed at this.

When a user logs into the site from any of the addresses, I instantly noticed the avatar in the CB Module is a broken img.

I looked at the path of the img and its doing the following:

http://www.xxxxx.net/http://www.xxxxx.com/images/comprofiler/tn62_4575558a0104c.jpg

I've looked at the address bar in the browser and its doing the same there:

http://www.xxxxx.net/http://www.xxxxx.com/

I have no clue why its doing this, I've been running JSMF fine up until now...

When the user navigates the site, it fixes itself, but the initial login causes this problem.

Thanks
Logged
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: Unusual Error with JSMF RC3
« Reply #1 on: December 05, 2006, 09:10:42 PM »

I think you need to do a rewrite rule in your htaccess so that the url changes before the first display of the site.  Try this:

Code:
# This rule rewrites www.yoursite.org and www.yoursite.com to
#      www.yoursite.net
RewriteCond %{HTTP_HOST} ^www\.yoursite\.(org|com)$ [NC]
RewriteRule ^(.*)$ http://www.yoursite.net/$1 [R=301,L]

I'm no expert, so that might be a bit off, but give it a whirl.  This will reformat the links *before* the browser displays them.
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
Peter
Joomla Newbie
*

Karma: +1/-0
Offline Offline

Posts: 20


View Profile
Re: Unusual Error with JSMF RC3
« Reply #2 on: December 05, 2006, 10:57:39 PM »

Thanks for the reply wolverine.

Before I actually do this - I should state that I have been running the past versions of JSMF with no problem and that this problem has only now just occured as I've upgraded to RC3..

My site (joomla as a whole) has never had this problem before, only now when I've upgraded to RC3...

So, is this meant to be happening, or is it a known error or anything?

P.
Logged
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: Unusual Error with JSMF RC3
« Reply #3 on: December 05, 2006, 11:23:22 PM »

hmmmm, on that note, lemme take another look.  There were a few changes to the url rewrite part of the code to fix another issue. 
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: Unusual Error with JSMF RC3
« Reply #4 on: December 05, 2006, 11:55:20 PM »

Its definitely my code, but generally speaking my code must not have been behaving entirely correctly in the previous versions because the last thing to do before returning a reformatted link is to check if the url contains $mosConfig_live_site.  For you that is  http://www.xxxxx.net and the url is coming through as http://www.xxxxx.com

I think I could modify the check to not only check for $mosConfig_live site but also if http:// is not present(signifying a valid link).  However the function is designed such that only urls with $mosConfig_live_site or relative urls should be passed to it.  In that regards it is better to use an htaccess method such as the one I posted above.  Either way, make a backup of your current htaccess before adding the change. 

At this point my testers are working on JSMF 2.0 Final and I am hesitant to change anything that has a broad ranging effect like this.  I may post a specific fix for you in this thread if I find time tomorrow.
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
Peter
Joomla Newbie
*

Karma: +1/-0
Offline Offline

Posts: 20


View Profile
Re: Unusual Error with JSMF RC3
« Reply #5 on: December 06, 2006, 01:40:14 AM »

Thanks for looking into it.

The problem when I add that is...even though it repairs the problem...It causes one obvious (and I'm pretty sure possibly other yet noticed issues) problem...

Since people come to the site from the .com/.net/.org/.co.uk, they have and do link images from the site on other sites, using any of the above extensions...So by putting that in htaccess, it kills any images that are hotlinked from the site that aren't using .net...It also kills any images in the forum/within the site that i've used the .com (or any other extension) for instead of .net

I'm not sure if its possible to fix that and permit usage of the other extensions...
Logged
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: Unusual Error with JSMF RC3
« Reply #6 on: December 06, 2006, 09:36:45 AM »

hmmm, it should not kill those links.  Apache should handle the request.  Might need to investigate the mod rewrite a bit better, I assume that rule is incorrect.

http://httpd.apache.org/docs/1.3/howto/htaccess.html

you can try this fix in components/com_smf/smf.class.php on or around line 675 find:
Code:
if (strpos($url, $mosConfig_live_site) === FALSE) {

and replace it with

Code:
if (strpos($url, $mosConfig_live_site) === FALSE && strpos($url, 'www.yoursite') === FALSE) {

changing www.yoursite to your site.  Let me know if that works.  This is a custom fix and won't be included in the next release so keep a note of this if you intend to upgrade to 2.0 Final.
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
Peter
Joomla Newbie
*

Karma: +1/-0
Offline Offline

Posts: 20


View Profile
Re: Unusual Error with JSMF RC3
« Reply #7 on: February 09, 2007, 10:27:36 AM »

Hi Wolverine,

I've just upgraded to the latest version of JSMF...This problem is still present sadly.

The problem I have now is, when the user signs in, it double prints the url (as detailed above) so:

http://www.mysite.net/http://www.mysite.com/

And it fails to load my sites CSS at all so the user sees a giant mess of a page infront of them.

Previously, it was just the avatar was broken until they navigated the site and it resolved the correct url...Now, its more significant.  The site CSS gets loaded correctly once they navigate away from the front page and it'll be fixed even when they go back to the front page because the address will be correct.

I have just added your fix as detailed above:

if (strpos($url, $mosConfig_live_site) === FALSE && strpos($url, 'www.mysite') === FALSE) {

This fixes the duplicate URL problem...However, causes another.  When the user attempts to login, it logs them in (shows it on the "Who's Online") but they arent properly logged in (it still shows the Username/Password box)...When they navigate the site, they are logged in properly then.

Obviously, most users rely on seeing that "logged in" module to understand they are logged in...So you can see the problem.

T.
« Last Edit: February 09, 2007, 10:40:45 AM by Peter » Logged
-Wolverine
Moderator
Joomla Guru
*****

Karma: +376/-34
Offline Offline

Posts: 3393


Lead Developer


View Profile WWW
Re: Unusual Error with JSMF RC3
« Reply #8 on: February 10, 2007, 10:10:43 AM »

you're going to have all kinds of problems with cookies like you report because of the different domains.  They are being redirected to a domain that is different from the one they logged into.  Whatever you do, make sure that both the Joomla live site setting and SMF url is the same domain.  But that still won't solve the problem of logging in from the front page.  The cookie is still set for whatever domain that is.  After rereading this I still think the .htaccess redirect is your best bet and that you should solve the image problem rather than trying to create a convoluted solution in these three pieces of software.
Logged

Need help?  Check Here First!
Get the JSMF User Guide
SEARCH this forum.
Peter
Joomla Newbie
*

Karma: +1/-0
Offline Offline

Posts: 20


View Profile
Re: Unusual Error with JSMF RC3
« Reply #9 on: February 16, 2007, 07:17:23 AM »

Sad to hear...I'll have a play around with htaccess and come back to you.

Thanks for your help.

P.
Logged
Peter
Joomla Newbie
*

Karma: +1/-0
Offline Offline

Posts: 20


View Profile
Re: Unusual Error with JSMF RC3
« Reply #10 on: March 05, 2007, 10:47:17 PM »

Since moving to a new server and changing Control Panel (to directadmin from cpanel) I've managed to set the domain "pointers" up differently and so this problem has now gladly gone away.

So, not the typical solution...But all domains simply point to the main domain, rather than act as pure redirects.

P.
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Joomla Forum | Powered by SMF 1.1 RC1.
© 2001-2005, Lewis Media. All Rights Reserved.
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal. None of the text or images in this public website may be copied without the expressed written consent of the authors. Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use
Joomla Hacks



Joomla Hacks
German Lang French Lang Italian Lang Spanish Lang Japanese Lang Chinese Lang
Search Contact About Advertise Blogs Topsites Submit News Register Login