ISSUE: When registrations are restricted to authenticated users, and an unauthenticated user visits registration-enabled node, there is nothing to prompt the user to login so that they can sign up.

PROPOSED SOLUTION: Provide a "You must login to register" link so that users can click the link, login and signup. The link should include ?destination=current_path() so that the user is redirected back to the appropriate node after logging in. Something along the lines of:

 if( $user->uid < 1 ) {
		global $base_url;
		print "You must <a href='$base_url/user/login?destination=" . current_path() . "'>login to register</a>";} 

Thanks
Dan

Comments

rudiedirkx’s picture

That seems like a good idea. You should always use url() to make URLs though. Or even l() to make links.

It not quite as easy as checking logged in status though. Just logging in might not be enough: registration might be disabled, or the start date in the future, or the end date in the past, or it's full and no waiting list. Etc.

So it's very tricky to check: you want to do all checks, except the user stuff (like anon/auth and role etc).

I'll think about it. Patch always welcome.