collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 255
  • Dot Hidden: 0
  • Dot Users: 1
  • Dot Users Online:

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • [DFg]DJF-1975: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 pm
  • [DFg]DJF-1975: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 pm
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 pm
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 pm
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 pm
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 pm
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 am
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 am
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 am
  • emanuele: [link]
    November 01, 2016, 12:43:50 pm
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 pm
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 am
  • [DFg]DJF-1975: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 am
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 pm
  • phantomm: and from what I see only patch is broken, full install package is fine
    October 21, 2016, 03:44:44 pm
  • phantomm: they say it for over 3 weeks now..
    October 21, 2016, 03:43:52 pm
  • aegersz: SMF say that bug fix 2.0.13 is coming soon ...
    October 19, 2016, 06:46:12 pm
  • Chen Zhen: check that thread at a later date as that file is not a final fix
    October 10, 2016, 03:09:18 pm
  • [DFg]DJF-1975: Thanks for the shoutbox fix file!
    October 10, 2016, 09:17:19 am

* Recent Posts

Re: I need some help. by andy
[July 17, 2017, 09:33:21 am]


I need some help. by ufaforwork2
[July 16, 2017, 08:55:11 am]


Re: Insecure URL by Chen Zhen
[July 12, 2017, 09:18:57 pm]


Re: PHP 7.1 : A non well formed numeric value encountered by Chen Zhen
[July 12, 2017, 08:41:31 pm]


Re: PHP 7.1 : A non well formed numeric value encountered by emanuele
[July 12, 2017, 07:20:43 am]

Thanks for having an interest with our portal. If you have any requests for features, have a look at the Feature Requests board.

Author Topic: Redirecting user to the previous/last visited page url after login  (Read 4098 times)

0 Members and 1 Guest are viewing this topic.

Offline ROZA

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: None
  • SP Version: 2.3.6
I asked this on smf community but they told me should ask it here!
 After users login to my site successfully(whatever way they choose/forced to login, including using original Login form from menu or filling the quick Login box on top of every pages etc) , I want to redirect them to their previous viewed page where they logged in from instead of homepage or board index.In this case the simple machines site itself has this feature I'm looking for. I use smf 2.0.11 and simple portal 2.3.6 and several other mods.
Thanks in advance for your comments and sorry for my poor English!

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1149
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Redirecting user to the previous/last visited page url after login
« Reply #1 on: October 26, 2015, 05:34:26 pm »
ROZA,

Please check "Administration Center" - "SimplePortal" - "Configuration" - "General Settings" - "Disable Portal Redirection"

Regards
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

▼ My job! ▼

No PMs for support unless it's a paid request. Thank you! :)
#OpIsis

Offline ROZA

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: None
  • SP Version: 2.3.6
Re: Redirecting user to the previous/last visited page url after login
« Reply #2 on: October 27, 2015, 01:38:02 pm »
Dear Ninja, That setting just determines which one of these two pages(portal homepage or forum index)will be shown to users after they login not the page they visited before login.
Quote
Consider a situation where user access a specific page which requires login to proceed. If the user is currently not logged in he will be redirected to the login page. Once user logs in successfully with valid credentials, web site redirects a user to one of those mentioned pages. User has to go through a menu or search in order to go to the page where he was trying to access before login. This is not user friendly since user wants to automatically redirect to the page he was trying to access before login.

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1149
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Redirecting user to the previous/last visited page url after login
« Reply #3 on: October 27, 2015, 06:07:35 pm »
Well, automatic redirect to the last seen page is a standard SMF feature and the only way SimplePortal can alter it is the one I mentioned. I just tried what you quoted and works perfectly fine on my forum, it redirects to the previously visited page (my case, an hidden section), not on Board Index.

So to summarize:
1) This is actually a typo within the Help text of that checkbox, because it switches between redirecting on portal and no redirect, which is totally different from what it claims to be doing.
2) Your issue is not within SimplePortal if that box is already checked, if it isn't... Check it.

I am currently investigating further about that checkbox. Thanks for your report and sorry for the inconvenience.
EDIT: My thesis is that I when you go to the Login area then it goes to BoardIndex or Portal, and always on Portal if it's unchecked. However, the description is still wrong and needs to be fixed.

Best regards
« Last Edit: October 27, 2015, 06:10:52 pm by ♦ Ninja ZX-10RR ♦ »
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

▼ My job! ▼

No PMs for support unless it's a paid request. Thank you! :)
#OpIsis

Offline Sayaka

  • Hero Member
  • *****
  • Posts: 2172
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Redirecting user to the previous/last visited page url after login
« Reply #4 on: October 27, 2015, 06:28:39 pm »
Hello,

The reason for this behavior is because custom pages do not have login_url set.

You can do change this behavior by opening /Sources/PortalPages.php

Find:
Code: [Select]
$page_id = !empty($_REQUEST['page']) ? $_REQUEST['page'] : 0;
Replace with:
Code: [Select]
$page_id = !empty($_REQUEST['page']) ? $_REQUEST['page'] : 0;

$_SESSION['login_url'] = $scripturl . '?page=' . $page_id;

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1149
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Redirecting user to the previous/last visited page url after login
« Reply #5 on: October 27, 2015, 06:31:20 pm »
Further investigation (with Sayaka) showed that it's actually a little bug with pages, and only happens with ***SimplePortal custom pages*** (to make it clear). If you login from any custom page it will always redirect to BoardIndex or Portal no matter what you do, I will add this to the bug tracker for the following version.
EDIT: added to the bug tracker.

And thanks Sayaka for the fix ;)
« Last Edit: October 27, 2015, 07:00:01 pm by ♦ Ninja ZX-10RR ♦ »
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

▼ My job! ▼

No PMs for support unless it's a paid request. Thank you! :)
#OpIsis

Offline ROZA

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: None
  • SP Version: 2.3.6
Re: Redirecting user to the previous/last visited page url after login
« Reply #6 on: October 28, 2015, 03:35:53 am »
Thank you very much for your replays Ninja and Sayaka,
 I did check the disable redirect setting and also I changed the code you mentioned in PortalPages.php but still the problem persists. For me It does not happen only with  SimplePortal custom pages But for all pages/posts/topics. actually I do not have any custom page yet. I tried different ways to log in, but always be referred to the forum index. When you Ninja are saying:
Quote
I just tried what you quoted and works perfectly fine on my forum, it redirects to the previously visited page (my case, an hidden section), not on Board Index.
So IMO It means that maybe this issue just exists on my forum.But why? How do I figure out where the problem has arisen? Please if you know something about it, do not hesitate to tell. I would be grateful.

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1149
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Redirecting user to the previous/last visited page url after login
« Reply #7 on: October 28, 2015, 12:12:06 pm »
Hmm, please provide your mod list, I have around 140 of them and it's not happening, so I should be able to give you some hints about it.

Regards
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

▼ My job! ▼

No PMs for support unless it's a paid request. Thank you! :)
#OpIsis

Offline ROZA

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: None
  • SP Version: 2.3.6
Re: Redirecting user to the previous/last visited page url after login
« Reply #8 on: October 29, 2015, 03:44:21 am »
Thanks for your support. The list of my installed mods:

1.   Similar Topics   0.6   
2.   Custom Action Mod   3.2   
3.   Custom Copyright   1.0.4   
4.   SMF 2.0.11 Update   1.0   
5.   MDLT: Manage Default Linktree   1.2   
6.   Pretty URLs   1.1.2   
7.   SA Chat   1.0a Rev120   
8.   Default Avatar   2.3   
9.   Like Posts   2.0.5   
10.   Board Icons   1.0   
11.   Responsive Curve   1.0 Beta 5   
12.   httpBL   2.5.1   
13.   SimplePortal   2.3.6


And also I have these mods uploaded:

1.   Site Integration Mod   1.41   
2.   Menu Editor Lite   1.0.5   
3.   SMF Articles   3.0.2   
4.   SA KB   1.2   
5.   Stop Spammer   2.3.9   
6.   Simple ImgBR Upload Image in CSS - upload by URL   1.0   
7.   SMF Links   3.0.5   
8.   Downloads System   2.5   
9.   Breeze   1.0.8   
10.   Forum Firewall   2.0.0   
11.   Bakers Dozen Pages   1.2   


In addition, the language of my website is right to left if that matters.
« Last Edit: October 30, 2015, 09:27:11 am by ROZA »

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1149
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Redirecting user to the previous/last visited page url after login
« Reply #9 on: October 29, 2015, 04:55:15 pm »
Oh, PrettyURLs. With all due respect to its developers it's one of the worst mods around, it is known to cause a *lot* of problems (without being useful either - ref: http://www.simplemachines.org/community/index.php?topic=427913.10) and most likely this one as well because I have all of your other mods installed, excluding the linktree (I personally recoded that entirely to make it responsive) and also SAChat which has been banned by my host because a bug in it was causing *major* server overloadings.

Sorry if this was not exactly what you wanted to read, but I'd rather be frank about it than throwing some excuses :/

Disclaimer: in no way I (nor SP team) am attacking Pretty URLs developers, I am just basing myself on facts, sadly.

Regards
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

▼ My job! ▼

No PMs for support unless it's a paid request. Thank you! :)
#OpIsis

Offline ROZA

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: None
  • SP Version: 2.3.6
Re: Redirecting user to the previous/last visited page url after login
« Reply #10 on: October 30, 2015, 05:19:36 am »
Well, actually that was what I wanted to read! I uninstalled PrettyURLs and also SAChat(I don't know why but nobody was using this one on my forum!)   and yes! the problem has been solved and now smf redirect me to the my last visited page after login!
 Thank you Ninja ZX-10RR I really appreciate your help.

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1149
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Redirecting user to the previous/last visited page url after login
« Reply #11 on: October 30, 2015, 07:45:41 am »
Glad you got it fixed, I am marking the topic as solved seeing your reply, in case you have further problems feel free to mark it as unsolved by clicking the relative button ;)

And... You're welcome. I said that because usually people that have it installed tend to stick a lot to PrettyURLs mod, but apparently you are an exception to that ;D
All in all awesome topic, the problem got fixed and we found something that can be improved as well, very nice.

Best regards
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

▼ My job! ▼

No PMs for support unless it's a paid request. Thank you! :)
#OpIsis