Hi,
Is there an extension or some code or something I can put onto a page to auto forward the user if they are logged in but display the page if the user is a guest?
Thanks,
Ste
Printable View
Hi,
Is there an extension or some code or something I can put onto a page to auto forward the user if they are logged in but display the page if the user is a guest?
Thanks,
Ste
Site Structure::edit your page::Expert Settings::Show to guests only
Will this not do what you want? (member auto forwarding is unneccessary in this case, as they won't ever see the page)
Above is for members, not users though....
Otherwise (if it is users you want to do this to) you'd need to include a {{file::myfile.php}} insert tag in a content element, place myfile.php in your templates folder, and have the script detect and forward them.
untested:
Code:<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
if (BE_USER_LOGGED_IN)
{
$redirection_url = 'the page to go to';
$this->redirect($redirection_url);
}
?>
Hey,
thats great thanks. I needed to detect if the member is logged in, the module forwards them to a page which I wanted to skip if the member was already logged in.
I will try your solution with the myFile.php as soon as I get chance.
Thanks again,
Ste