News:

Join the Facebook Fan Page.

Main Menu

loginout back to old url

Started by underscore82, June 18, 2018, 09:45:14 AM

Previous topic - Next topic

underscore82

I have changed my loginout.php when someone logs in, it goes back to the page where it left off.

// Set the login_url if it's not already set (but careful not to send us to an attachment).
   //if (empty($_SESSION['login_url']) && isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'login') === false && //preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0)
   //   $_SESSION['login_url'] = $_SESSION['old_url'];
      $_SESSION['login_url'] = $_SESSION['old_url']; <----
                                             

On my forum I have a login box (right). This login box works well. In my menu I also have a login button. This goes to forum / login / (page). This does not work properly. When I log in the first time, the page returns to the forum / login and if afterwards tries to log in again it goes to index.php.

Does anyone know what I can do about this. I want someone to log back to the page where he stayed. If someone logs in from the login page, he goes back to the login page.   

Arantor

I'd put it back to the code that was originally there.

Interfering with sessions like that can actually break some of the security measures in 2.1.

underscore82

thanks, but maybe you know a way to get what I want

Arantor

Not without going back through the code and or possibly damaging the security routines.

It's been a while, but I'll take a look tonight at 2.1 beta 4 and see how it might be done.

Illori

OP are you actually using SMF 2.1 or are you using SMF 2.0.* ?

underscore82

Thanks Arantor!

Illori: i'm using 2.0.*

Arantor

Oh, I need to figure it out in 2.0? Oh dear, this is going to get interesting.

underscore82

did you manage to look at it?

Arantor

Sorry, no, was busy last night.

What other mods do you have? Any other mod might be affecting this behaviour (and need to be accounted for)

I'll note that part of your problem was actually caused by you commenting the code out in the first place.

underscore82

Quote from: Arantor on June 19, 2018, 02:23:40 PM
Sorry, no, was busy last night.

What other mods do you have? Any other mod might be affecting this behaviour (and need to be accounted for)

I'll note that part of your problem was actually caused by you commenting the code out in the first place.

No problem. I use the following mods.

1   Edit All Message Titles   0.1.1     
2.   reCAPTCHA for SMF   1.0.0     
3.   vBulletin Style Meta Tags   1.1     
4.   SMFPacks Social Profile Pro   1.1.4 
5.   SMF 2.0.13 Update   1.0     
6.   Enhancements to purge inactive members   1.3.7     
7.   More Spiders   1.2     
8.   Simple Audio Video Embedder   4.5     
9.   SMF 2.0.12 Update   1.0     
10.   Separate the sticky topics   1.0.1     
11.   Optimus   1.9.7.3     
12.   Default Avatar   2.3     
13.   SMF Mobile Theme Selector   1.0.3     
14.   SMFPacks Alerts Pro   2.0.18     
15.   Email Inactive Users   1.1.1     
16.   Embed Facebook BBCode   3.9     
17.   AvatarSelect   1.2.1     
18.   Anti-SID(PHPSESSID) canonical tag   0.6     
19.   Ad Managment   3.2     
20.   SMFPacks: SEO Pro Mod   2.3.6     
21.   Smart Pagination   0.8.3     
22.   Add Facebook Like, Tweet, and Google +1   1.0.3a     
23.   Add Social Media Icons To Profiles

Arantor

So, have you put the code back to how it was before you commented it out? That will fix the redirection on the login page going back to the login page (the bit you commented specifically addresses that). You should also get to the current SMF release, especially as it has some changes to the login process since the version you have.

I have no idea what mess some of the SMF Packs mods might have made of things, though I'd hope the SEO Pro one wouldn't interfere with, not so sure about the Social Profile one though. Alerts too actually might interfere now that I think about it.

Incidentally the Anti-SID mod shouldn't be required, that should have been fixed in core years ago. (EDIT: It was fixed in 2.0.6. I thought it was familiar, since I'm the one that implemented the bugfix in core back then.)

Arantor

On an unmodified 2.0.15, this works as expected for me, I'm on a topic as a guest, I log in and I'm on the same topic I was before only this time logged in.

Advertisement: