running Joomla 1.0.5, SMF 1.1RC2, and J!-SMF Bridge 1.1.3, cannot get the login to STAY on the Joomla home page, even if no redirect is sclected in setup! Logins and logouts continue to route to the Forum home page, which is annoying!
oh Duh! Sorry - using com_login-acctexp, which was hacked to allow use of com_acctexp 0.6.8, the newest one. no big change, just points to com_acctxp instead of com_registration
The reason it does this is that that login module is missing a session variable we use in order to know that we are coming from a joomla login. If you set $_SESSION['_FROM_MOS'] = true; in that login the redirect should take you back to joomla home.
If you need my help simply post the login module and I can make the change.
I will try to work the redirect a different way in the future so no modification of external logins are necessary.
Thanks Wolverine - I'll definitely post the module, as I'm still on the leaarning curve here, and modifying modules isn't on my radar for a whle, althouhg I do want to learn.
Thanks!
(A NOTE TO CLARIFY TO FORUM VISITORS HERE - DO NOT DOWNLOAD THE ATTACHED MODULE - IT WILL NOT HELP YOU USE J-SMF BRIDGE - IT WAS POSTED ONLY TO PROVIDE CODE FOR WOLVERINE TO INVESTIGATE)
« Last Edit: June 22, 2006, 12:39:01 AM by Bruce Nazarian »
This thing's giving me more trouble than it's worth. I think this is at least the third bug I've found, and these forums are so full of repeat problems from people not reading previous threads that I can hardly find anything. If I didn't need this for functionality, believe me, I wouldn't use it.
My login does the same thing as above, redirects to SMF. I have set the redirect off on login and selected the redirect to Joomla option on logout. The login module that I use is mod_login_userextended. It has a parameter to allow redirect on log-in/out, but setting it to the frontpage had no effect. I also tried adding the above code to the module, again with no effect.
Version info: Mambo 4.5.4 SMF 1.1RC2 Joomla-SMF Bridge 1.1.3 Running Apache
Any help would be greatly appreciated.
« Last Edit: June 22, 2006, 10:25:10 AM by Gary Raduns »
As long as I have to keep fixing bugs, I'll keep posting fixes: After spending forever trying to fix this with settings, I finally decided to sit down and examine some of the code. I was able to fix the problem on logOUT, but the login problem is a bit more persistent. I developed this fix in Mambo 4.5.4, but it should work with any version of Mambo or Joomla.
The problem does NOT lie in the login module from what I have determined. It lies in the Mambo index.php patch. I had had previously patched it manually because the patch was designed for the Joomla index.php. The only downside to my fix, you'll have to edit the code manually. I could post an entire 4.5.4 index.php file upon request, but I am not attaching one at this time.
In the logout section of the code, the original patched version reads:
Code:
else if ($option == "logout") { //JOOMLAHACKS.COM //$mainframe->logout();
Removing or commenting the mosRedirect statement fixed the redirect issue, but caused even more errors that I wasn't about to deal with, so I changed it back. I then uncommented the mainframe logout and found the doSMFlogout() function in functions.smf.php in the administrator component. Calling this funciton simply logs the user out of the SMF database. To log the user out of the fronted Mambo/Joomla uncomment the mainframe logout. At this point, the redirect is not needed to log the user out of SMF, so it can be removed. The fixed code:
Code:
else if ($option == "logout") { //JOOMLAHACKS.COM doSMFLogout(); $mainframe->logout();
...
The fixed code logs the user out of both sources, and by default redirects to index.php, the Mambo/Joomla frontpage.
I am still trying to correct the login issue. If I find a solution there I will post it here as well.
EDIT: I tried using the integrateLogin method from the bridge's functions, but I think there is something wrong with the SMF login portion of this method. The redirect was avoided with this method and the user logged into the site, but when I tried to access the forum, the login didn't transfer. I used this code to test:
the fix is forthcoming Gary. On a side note, if you are interested in helping the bridge please send me a pm, I have more than enough work to do and help is appreciated.
The last code snippet I posted above works for logging in to the frontend without a redirect. The only thing it won't do for you, Bruce, is log users into SMF. If you don't mind users having to log in to SMF a second time, you can start with that code until somoene comes up with something better.
well, Gary, we're halfway to a complete solution, and since I think the inconvenience of logging in a second time far outweighs the slight inconvenience of hitting the "home" menu, I'm going to leave the "logout" fix yu wrote in place, and hold off until Wolverine (or someone else) finds the magic to fix the login.
thanks for your sleuthing! Someday I hope to know enough to reciprocate!
Which logout button are you using? It should definitely work for the Joomla login, and probably for the SMF as well, but if it doesn't work there I can check that out, too.
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