Active
Project:
Node registration
Version:
7.x-1.16
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2015 at 21:23 UTC
Updated:
8 Feb 2015 at 01:57 UTC
Jump to comment: Most recent
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
Comment #1
rudiedirkx commentedThat seems like a good idea. You should always use
url()to make URLs though. Or evenl()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.