SimplePortal

Development => Bugs => Fixed or Bogus Bugs => Topic started by: ♦ Ninja ZX-10RR ♦ on October 27, 2015, 06:34:12 PM

Title: Custom pages redirect on BoardIndex on Login
Post by: ♦ Ninja ZX-10RR ♦ on October 27, 2015, 06:34:12 PM
If you visit a custom page accessible to public and then try to login from there, they will redirect you to the board index no matter what you do.

Ref: http://simpleportal.net/index.php?topic=14156.msg70513#msg70513

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;

That one fixes it. Adding to the bug tracker and marking it as solved as per the board rules.
Title: Re: Custom pages redirect on BoardIndex on Login
Post by: emanuele on October 28, 2015, 02:11:00 PM
I hate the $_SESSION['login_url'] sooooooo much!
Title: Re: Custom pages redirect on BoardIndex on Login
Post by: ♦ Ninja ZX-10RR ♦ on October 28, 2015, 03:54:31 PM
Hmm yeah have a look and see if it's present in ElkArte version as well, because more than likely, it is.
SimplePortal 2.3.8 © 2008-2024, SimplePortal