Not sure if this is the right thread, but I’m using TML and love it. The site I’ve used it on needs password protection for all pages except the Home page and Login. I’m using a simple check at the top of page templates to see if the user is logged in:
get_currentuserinfo();
global $user_ID;
if ($user_ID == ”)
{
header(‘Location: /login/’);
}
Login takes them to the TML login page. Problem is, I like how WordPress by default will redirect after login to the page you were intending to view, once you log in. Right now, my header redirect sends them to “login” without a way after that to get back to the page they wanted to see (using TML, I redirect all subscribers to a certain page after login).
Is there a way to capture the referring url and append it to the /login/? Is is there a better way to get users redirected back where they wanted to go, while still keeping pages password protected this way?