SMF unwrapped - Logout redirect not redirecting properly

Started by ago-stino, February 21, 2005, 04:46:30 PM

Previous topic - Next topic

ago-stino

Hello I submitted a reply to a previous topic,
http://www.simplemachines.org/community/index.php?topic=28319.0
but I think that maybe this deserves a new one.

I would like also to say that I'm really impressed by the good job done by all the developers. thanks.

This is what I wrote:

QuoteKindred said: In the login module, I have logout redirects set to my main mambo site.... but it drops me into the SMF component. (logins work properly)

Same problem here. My address: http://3d-wip.org [nofollow]   :-[

SMF 1.0.1, Mambo 4.5.2.1 (brand new install yesterday, it works smoothly no problem, same database of SMF), Bridge 3.01

Are there, maybe, any common (bad) procedures which lead to that kind of error? I admit: I was a little hasty, and I forgot, like trenchteam, to install the registration component before the login one (and I did get the same error). So I installed the registration component, then I modified the MOS_SMF.php as suggested, because I need a stand alone version of the forum, then (or before, I don't remember, I installed the SMF mod mambo.tar.gz package, then (or before? and this could be the issue....I would like to crash my head on the wall, because usually I take a good care on this kind of stuffs, but today maybe I was a little tired, I'm working too much) I clicked the "update" link on the Mambo SMF page (edit: and I see this message:
"Notice: Undefined variable: smf_path in /home/thrdwipo/public_html/administrator/components/com_smf/admin.smf.php on line 42
Success". I don't know...the absolute path is correct...)

please..............help!

EDIT:

And If I try to log out from the main mambo home page, I'm logged out and redirected to the Forum but just a while before I see a page with this error message: "Notice: Undefined index: returnurl in /home/thrdwipo/public_html/2D-3D-forum/Sources/MOS_SMF.php on line 363"  (?)

EDIT 2. "only in Firefox not in Explorer" if I log out from inside the Forum, I'm actually logged out, but I get a blank white page. But Zip output is disabled in Mambo..  ..the same if I log "in" from inside the forum. <===  This is SOLVED.  I put http://www.mydomain as my site address, while in SMF is http://mydomain (I made the same silly mistake when I installed Coppermine, that by-the-bye presents the same logout issue...), this drives Firefox mad and don't understand the cookie anymore. Explorer seems to be more clever in this case. But if I was more clever this would not happen.... ;)



Q. What would I like to achieve?
A. To be logged out to the main mambo home page, and to not see any error ever more.    :)




EDIT 3: Should I start a new topic with this?


------------------------------------------------------------------------------------------------


And this is what I'm writing right now on this new topic:

Ok, now I have found this:

"The logout redirect param is not being used in all cases, and is causing all logouts to redirect to the SMF index, instead of the page specified in the params.

While this is not a critical bug, it can be annoying.

This can be fixed rather easily in the login module itself, but if the user chooses to logout from the forum, the redirect
will still end up back at the forum."

http://mamboforge.net/tracker/index.php?func=detail&aid=4614&group_id=543&atid=1971 [nofollow]

written by Ostio.



i'm sorry but..if it's not critical it's surely a very dangerous bug. Why? Because hundreds, thousand, billions of users will run away from the portal forever. If I logged in from the home page of the Portal, I should be able to logout to the same position. What i'm doing inside the forum as a guest now, looking for mushrooms? Usability.......................yooo hooo........   :'(


More:
Inside the FAQs of this bridge-related-board I saw that the bridge registration/login section is "stand-alone-like" and you should deactivate the login-registration part under Mambo (done, easy) and SMF. How could I do that on SMF ? I can deactivate the registration but not the login. Mayeb the bridge do that by itself? It doesn't seem so. Instead I see that the registration is still managed by SMF because I can deactivate it from inside SMF. Anyway, I don't mind about this. The issue is the "not-redirected-on-logout-find-the way-home-by-yourself-or-click-the-link-that-I-added-to-the-menu"....

Is it possible that nobody else see the importance of this? Please, come on...

What could I do inside the index.template.php (or whatever) if I would like to do some hard-coding to redirect the logout to the static URL of the home of the portal (mambo)?
http://3d-wip.org [nofollow]

Orstio

If you want to hard-code the logout URL, you can do so in MOS_SMF.php.  Sorry for the inconvenience. 

Because you are running a stand-alone forum, you would have to do that, anyway.  The Mambo params are not picked up by the stand-alone forum.

Find this in MOS_SMF.php:

switch ($_REQUEST['returnurl']){
  case "0";
  $_SESSION['logout_url'] = $GLOBALS['mosConfig_live_site'];
  break;

  case "1";
  $_SESSION['logout_url'] = $scripturl;
  break;

  case "2";
  $_SESSION['logout_url'] = $_REQUEST['return'];
  break;
}


and replace it with this:

  $_SESSION['logout_url'] = $GLOBALS['mosConfig_live_site'];

(Just a note:  Because SMF is stand-alone, I won't guarantee that $GLOBALS['mosConfig_live_site'] will actually have any value when logging out from the stand-alone forum.  It will certainly have a value on any Mambo page, but not necessarily on a forum page.  So, you might want to hardcode the URL in there instead.  Your choice. :) )

ago-stino

#2
Quote from: Orstio on February 21, 2005, 06:25:27 PM
If you want to hard-code the logout URL, you can do so in MOS_SMF.php.  Sorry for the inconvenience. 



Yes. THANKS! May I kiss you?

Ok. This solves the issue on the Mambo home. Now when I log out from there, I don't see the error anymore and I return safely logged out on the same page.

I imagine that now...if I wanted to achieve the same effect on the Forum... that is to return to the main home page (mambo) when I log out...I have to put my clumsy hands on the code inside SSI.php...

Wait a minute....you say that I have to hard code inside the Forum, but even though the forum is "stand-alone" (that is not wrapped, right?) I see that all the links on the menu are managed by mambo. in this case, logout button has got this hyperlink:

http://3d-wip.org/index.php?option=com_smf&Itemid=27&?action=logout;sesc=795f6ca786fc3 [nofollow]
5d8dad707b6562044cd

Is not this session managed by the Mambo bridge? And if the answer is positive, why the fix doesn't work? where is the variable that we are missing? OK. Ok. I don't mind why (in this very moment)...I'm looking for a temporary solution...maybe this is possible without hard-coding my url inside SSI.php, LogInOut.php or whatever (infact, I have also to figure out where to put my dirty hands).

Another discovery:: When I go back to the main (mambo)  home after logging out in the forum, I am, obviously and fortunately, logged out...but I can still modify the news that I put on frontpage!!! I'm logged out from the Forum and from Mambo but I can still modify the news!
This doesn't happen if I log out inside the main (mambo) home page. And this happens with or without your suggested modification. Shut down the browser, cleaned the cookies, tried re-tried, still happens.

AAARRRRGGHHH!!!!

:'( :'( :'( :'( :'( :'( :'( :'( :'(
http://3d-wip.org [nofollow]

Orstio

Because your forum is stand-alone, in order to logout of both Mambo and SMF, you will have to modify your SMF theme, so that all URLs with "?action=logout" will now say "?action=mambo_logout".

Likewise, you will have to change all "?action=login2" to "?action=mambo_login" so that the login will handle both as well.

ago-stino

#4
Orstio, I would say that you saved my night!
I was just writing back to you in this moment, saying that I was going to reinstall everything from scratch, restoring the database at the backup-before-installing-mambo...(everything but the forum, btw, too much work on that!)

  :) :) :) ;) :D


now...I think that for a while I can keep the site set up in this way:

you are on the frontpage, you log out to the front page....you are on the forum, ok...if you log out here you can stay for a while or, if you like, you can click the "home" button. (I put another "Forum home" button").
Great! This solves the problems for a while, until the redirection on the Mambo admin page will start to work!

I really thank you for your help and for the wonderful work you have done so far.

ago-stino
http://3d-wip.org [nofollow]

ago-stino

Orstio,

this is really   :D funny ;D  :

now, I don't know why, without touching anything, if I log out from the Forum I'm redirected to the Mambo home, exactly what I wanted!

I'm really glad...I hope there will be no side effects   :-[


ago-stino
http://3d-wip.org [nofollow]

Orstio

Quotenow, I don't know why, without touching anything, if I log out from the Forum I'm redirected to the Mambo home, exactly what I wanted!

The combination of the change to MOS_SMF.php and your theme changes should have had that effect.  ;)

ago-stino

Yes. In the previous message I thought it didn't  work but now it works. ;)

Anyway, latest news, I have not searched in the forum, maybe it's already written somewhere:

you can say "bye bye" to w3c validation now.

All those new "&" are a problem...maybe coding them as "&amp;" ?
I wanted to try but I couldn't find the code, I think it's melted inside the database, isn't it?

Ok, I'll comment the 2 validation buttons until this will be solved. I have tons of things to do....

Thank you again!
http://3d-wip.org [nofollow]

ago-stino

#8
latest of the latest, and then I'll be quite for a while:

looking at the error log, after every login, I get a "Trying to get property of non-object in /home/......./MOS_SMF.php on line 311"

the line should be this:
mysql_query("UPDATE {$mos_prefix}users SET lastvisitDate='$currentDate' where id='$session->userid'");


:D
http://3d-wip.org [nofollow]

ago-stino

#9
Orstio,

a little feedback:

I installed your last bridge 3.02, it's perfect for me! And now the "Trying to get property of non-object in /home/......./MOS_SMF.php on line 311", that I received sometimes, has disappeared.

Yes now, the new bridge works properly if I set on login module "return to Mambo homepage". This is perfect for me since it's exactly what I wanted. It worked also with the modification that you suggested me to do in this thread, a part for that little (but not compromising any functionality) error that I get, that now is gone.

It doesn't work, as you said here http://mamboforge.net/tracker/index.php?func=detail&aid=4614&group_id=543&atid=1971 [nofollow]
if you set "return to the page from where you logged in/logged out".
Not a big issue, for me. In my opinion, one could/should decide if the site will be Forum-centric or Mambo-centric.  Edit: with the option "return to Mambo home page after logout"  enabled, if you login inside the Forum, you will log out still inside the Forum. This is really good, even if not forseen, because it's coherent.  If I enter the site directly at the Forum, I will log out still to the Forum. Nice.


but...at least "in my case" (since I made several modifications, and I'm not sure if it is due to them), it works if I set "return to SMF page", but only when I login in. When I log out it returns always to the Mambo homepage. Tested with Firefox and Explorer. Always deleting cookies after each test, and restarting the browser.


Last thing:

You fixed the validation issue!
I had tears starting to fall from my eyes when I saw that!   ;-)


Thank you for your great support and the excellent work you are doing.

bye

ago-stino
http://3d-wip.org [nofollow]

Advertisement: