11
Dave_L
Re: Redirect after login takes users to a different page than they were on
  • 2006/6/5 17:01

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


I don't know if this will help, but I had a similar problem in 2.2.3.

If you weren't logged in, and browsed to a URL that was only accessible to logged-in users, and:

1) ... logged in using the left block, you would get redirected to the main page.

2) .. logged in using the form in the main part of the page, you would get redirected to the right URL.

When I upgraded to 2.2.4, the problem (#1) was fixed.

So maybe comparing 2.2.3 with 2.2.4 would provide a clue. Or maybe not.

12
Chappy
Re: Redirect after login takes users to a different page than they were on
  • 2006/6/6 3:32

  • Chappy

  • Friend of XOOPS

  • Posts: 456

  • Since: 2002/12/14


Thanks, Dave_L...

Perhaps this has something to do with it. I downgraded from 2.2.4 to 2.0.13.2 and then upgraded to 2.0.14. It was doing it ever since I downgraded to 2.0.13.2.

There does seem to be a difference between logging in from the login block and logging in from user.php.

What I am frustrated by is my inability to pin down the reason why, when for instance, I came to this page, saw that you had posted a response, logged in with the login block to the left, and was immediately redirected back to this page to post this message. My site sends folks to random pages where they have no visit history.

The system login block seems unchanged between the various versions - 2.0.13.2, 2.0.14, and 2.2.4.

Its prob something incredibly simple - almost always is.

Thanks, Dave_L
MMM...It tastes like chicken! ...

13
Dave_L
Re: Redirect after login takes users to a different page than they were on
  • 2006/6/6 8:19

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


There's also this patch I posted for 2.2.3.

The patch is obsolete, since the problem is fixed in 2.2.4. But it might work in your case.

14
Chappy
Re: Redirect after login takes users to a different page than they were on
  • 2006/6/7 12:50

  • Chappy

  • Friend of XOOPS

  • Posts: 456

  • Since: 2002/12/14


Does it matter where I insert the lines of code in the file? I looked the code over but could not be sure where to insert it.

Thanks,
Mike D.
MMM...It tastes like chicken! ...

15
Dave_L
Re: Redirect after login takes users to a different page than they were on
  • 2006/6/7 14:05

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


include/checklogin.php

Insert the code delimited by the 
#*#LOGIN_BLOCK_REDIRECT# tags:

[color=ff0000]#*#LOGIN_BLOCK_REDIRECT# - start
    
if (preg_match('/user.php?xoops_redirect=(.*)$/'$url$matches)) {
       
$url urldecode($matches[1]);
    }
#*#LOGIN_BLOCK_REDIRECT# - end[/color]
    
[color=0000ff]redirect_header($url1sprintf(_US_LOGGINGU$user->getVar('uname')));[/color]


The new code is red, the old code is blue.

16
Chappy
Re: Redirect after login takes users to a different page than they were on
  • 2006/6/11 3:38

  • Chappy

  • Friend of XOOPS

  • Posts: 456

  • Since: 2002/12/14


Thanks, Dave_L!

I tried that and it didn't change it, though I greatly appreciated the assistance. I fear that something in XOOPS configuration altered after I downgraded from 2.2.4 to 2.0.13.2. Then when I upgraded to 2.0.14 it just continued functioning that way. What I ended up doing was saving my database and then reinstalling my site completely. It was probably something folks might cosider doing once in awhile, anyway. It got rid of a ton of repeated blocks that just kind of showed up in the blocks manager. Additionally, it cured the issue of the redirect. In general, after having started on XOOPS in January 2002, it seemed like there was a lot of crap in my files and database. It just runs better now (though I still have to install about half of the modules I was running and it has required a ton of cut/paste in my phpmyadmin). It redirects backs to the page it was on before the login now, if you log in from the block on the left. I suspect that when the time comes to develop an upgrade script for the folks who are running 2.2.4, it will be a bigger job than expected.

Anyway, anough for the drivel. I appreciate, as always, the help.
MMM...It tastes like chicken! ...

Login

Who's Online

216 user(s) are online (116 user(s) are browsing Support Forums)


Members: 0


Guests: 216


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits