Redirection to the other site page via ssi_login

Started by mitko, June 22, 2022, 03:00:20 PM

Previous topic - Next topic

mitko

Hi there!
Can you please advice, i'm trying to setup the redirect to another site page after login.
I'm editing SSI.php accordingly
function ssi_login($redirect_to = 'https://www.lightphotos.net/', $output_method = 'echo')But nothing happen after login - user stays on a main page of the forum. What's wrong?
Version SMF 2.1.2

Oldiesmann

SSI.php has no effect on forum operation at all. It's a file that's designed to allow you to include some forum features (such as a login box) on another page of your website. See https://wiki.simplemachines.org/smf/Category:SSI for more information.

If you make the following change to Sources/LoginOut.php, you should be able to accomplish what you want, as long as the user isn't trying to download an attachment and SMF hasn't set some other URL to send them back to.

Sources/LogInOut.php

Find
elseif (isset($_SESSION['login_url']) && strpos($_SESSION['login_url'], 'dlattach') !== false)
unset($_SESSION['login_url']);

Add after that
else
$_SESSION['login_url'] = 'https://www.lightphotos.net';
Michael Eshom
Christian Metal Fans

mitko

Thanks for advise! It seems it works if login page is standalone but if it is just a pop-up from the main forum page i'm getting blank page instead of redirect. Any thoughts?

Oldiesmann

Are there any errors in your forum error log? A blank page generally indicates that there's a PHP error somewhere.
Michael Eshom
Christian Metal Fans

mitko

I've checked server logs and forum logs - both empty  :(

Kindred

then you need to have a chat with your host....  if the system is not logging errors that generate a white screen of death, it suggests a badly configured server logging system
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

mitko

Interesting that then i click page source on this black screen i can see the source of the page and seems this is main page of the forum  :o

Advertisement: