[RFC] redirect to previous page after login

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
necer_cheniki
Registered User
Posts: 8
Joined: Thu Aug 11, 2011 5:47 am

Re: [RFC] redirect to previous page after login

Post by necer_cheniki » Fri Nov 30, 2012 7:04 pm

return variable in the URL will be enough (like google.com)

Mavvv
Registered User
Posts: 1
Joined: Mon Apr 08, 2013 10:49 pm

Re: [RFC] redirect to previous page after login

Post by Mavvv » Tue Apr 09, 2013 1:12 pm

I'm kinda baffled at this topic, since there already is a way of doing this...

Well there was actually, but it looks like this stopped working after 3.0.7 update because it was replaced with something else. I had been searching for a fix on this suddenly removed feature and found this:
The "/ucp.php?mode=login&redirect=<some url>" used to always worked with phpbb3, that is up to 3.0.7 PL1.
So great, it got removed and replaced without any notice. Those of us with customized style/templates did not know what the hell was going on and it stopped working after updating the forum. I finally found out it got replaced with this:

Code: Select all

    {S_LOGIN_REDIRECT}
Which is something that should be used in templates, but it has to be used in front of:

Code: Select all

    {S_HIDDEN_FIELDS}
or else it can get overridden by hidden fields apparently. The other problem with this new way, is that it's only allowing redirects on the same domain. That also means if the forum is on a subdomain like forum.somesite.com and it should redirect to the frontpage on somesite.com, it won't work. Both http://wiki.phpbb.com/Meta_refresh and https://wiki.phpbb.com/Redirect have a third parameter 'disable_cd_check' that could enable this, but there's no way to enable external redirects in the admin panels. I've also tried just editing functions.php so it's by default true, but it didn't work for me. But it looks like this guy did get it to work though.

The other problem with this thing is that it depends on the use of a recent template. afaik there is no template-features changelog or "you should update your custom templates!" notification thingy when you update to a new version (and that sucks). Here's the bug ticket, but it's closed as "not a bug" because it only happens with styles that did not get updated. Guess what, not everyone uses subsilver. If you change something that will break features on all current styles unless you use the style that comes with the update, that should get a big notification before people upgrade to the new version. :roll:

---------------------
Suggestions:
  • Perhaps Meta_refresh and Redirect could be changed so redirecting to or from a subdomain on the same domain(tld) would be allowed by default, and actual external redirects (ie. other tld) won't. This is imho the best thing to fix this for most websites that have a custom login on their frontpage. Optionally it might be something you could enable through the admin panel? Allowing redirection to/from subdomains on same tld, or even to other sites(tld)?
Some more general suggestions:
  • Maybe improve the docs and/or notifications on this redirect feature, as I've seen tons of questions about this redirect thing not working. And there never are any useful replies, if any at all (this one being the exception). Clearly this dev-topic existing proves it, apparently nobody knows this feature is already in there (but a bit broken/impossible to use).
  • Improve notifications of changes that add or remove features in templates within each update, since lots of people use custom style/templates that do not get updated when you update to a new forum version. I know there are modified files packages, but those aren't very humanly readable. Plus those are only for the forum code and the style it comes with, not for custom styles. So in this case, the addition of {S_LOGIN_REDIRECT} was not noticeable to those with custom styles installed.

User avatar
keith10456
Registered User
Posts: 523
Joined: Sat Apr 22, 2006 10:29 pm
Contact:

Re: [RFC] redirect to previous page after login

Post by keith10456 » Thu Apr 11, 2013 3:10 pm

I still don't see why Prime's Login Redirect can't be adopted. It works perfect as far as I can see... I've been using it for the longest without any issues.

User avatar
Jessica.
Registered User
Posts: 144
Joined: Wed Feb 09, 2011 8:17 pm
Location: Pennsylvania, USA
Contact:

Re: [RFC] redirect to previous page after login

Post by Jessica. » Thu Apr 11, 2013 9:16 pm

keith10456 wrote:I still don't see why Prime's Login Redirect can't be adopted. It works perfect as far as I can see... I've been using it for the longest without any issues.
+1 for using that.

developer11
I've been banned
Posts: 17
Joined: Tue Dec 09, 2014 10:25 am

Login redirection

Post by developer11 » Tue Dec 09, 2014 8:33 pm

Its another must-do ASAP for phpBB team. When you are reading topic (as unlogged/guest) and you click Reply or Quote, you are redirected to login.php. Thats how it should be. But once succesfully logged in, you should be redirected to answering form..... where do you land instead? at the forum idex page. Absurd.

DavidlQ: thanks for merging :)

BTW: 2 (almost 3) years since topic creation and this feature is still not included. This just shows the attitude phpbb team has towards its users...... scandalous behaviour.....
Last edited by developer11 on Tue Dec 09, 2014 8:53 pm, edited 3 times in total.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1731
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Login redirection

Post by DavidIQ » Tue Dec 09, 2014 8:41 pm

I happen to know this was brought up before but searching yielded this:
https://area51.phpbb.com/phpBB/viewtopi ... 08&t=43623

I've merged the two topics.
Image

User avatar
Pony99CA
Registered User
Posts: 986
Joined: Sun Feb 08, 2009 2:35 am
Location: Hollister, CA
Contact:

Re: Login redirection

Post by Pony99CA » Wed Dec 10, 2014 1:47 am

developer11 wrote:BTW: 2 (almost 3) years since topic creation and this feature is still not included. This just shows the attitude phpbb team has towards its users...... scandalous behaviour.....
Yes, the redirects would be nice, but not having them is more of an annoyance. I presume that the developers either had higher priority things to do or found lower hanging fruit.

Regardless, it's hardly "scandalous".

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.

leschek
Registered User
Posts: 161
Joined: Tue Aug 28, 2012 1:30 pm

Re: [RFC] redirect to previous page after login

Post by leschek » Wed Dec 10, 2014 2:08 am

You can use this extension. At least for me it works.

Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 297
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

Re: Login redirection

Post by Nicofuma » Wed Dec 10, 2014 10:53 am

developer11 wrote: BTW: 2 (almost 3) years since topic creation and this feature is still not included. This just shows the attitude phpbb team has towards its users...... scandalous behaviour.....
phpBB is an Open Source software and so everyone (including you) can contribute and develop what he considers important. So if you want it to be done ASAP feel free to do it.

As I said, everyone can contribute and submit code it's not reserved for the phpBB team and to be honest it's not its role. The main role of the team is to organize and manage the development: reviewing and merging the PRs, organizing the debates, promoting the software... If some members of the team submit some PRs it's as a contributor and not as member of the team. And as I said somewhere else, the main point in an Open Source project is the freedom of the contributors, they submit and propose what they want, based on their own priorities. So if no people submit a PR for this in 3 years, maybe it's because none found it important enough for himself. But you are a developer and it's important for you, so you could be the contributor who submit this PR.
Member of the phpBB Development-Team
No Support via PM

developer11
I've been banned
Posts: 17
Joined: Tue Dec 09, 2014 10:25 am

Re: [RFC] redirect to previous page after login

Post by developer11 » Wed Dec 10, 2014 11:05 am

@up: true; but point is who decides what code (=which code) goes into stable version (=final release)..... its the Realase Manager, who is part of team.
Based on the above statement, if code submitted is against guidelines for said release, it will simply be rejected......
BTW: if anyone can have what they want, why there is subforum titled "Rejected RFC"?

Post Reply