The Profile Registration Redirect module is a custom Drupal module designed to handle user redirection immediately after account creation. When a user registers an account with a specific profile type, they are automatically redirected to the appropriate profile editing page. Additionally, if the profile type is main, the user is assigned the role member_pending_approval.
-
Immediate Redirection:
- After account creation, the user is immediately redirected to their profile editing page based on the
profileparameter in the URL.
- After account creation, the user is immediately redirected to their profile editing page based on the
-
Role Assignment:
- If the
profileparameter is equal tomain, the user is automatically assigned themember_pending_approvalrole.
- If the
- The module implements
hook_user_insert(), which is triggered when a new user account is created. - The function checks if the
profileparameter is present in the URL. - If
profile=mainis found:- The user is assigned the
member_pending_approvalrole. - The user is redirected to the
/user/UID/mainprofile editing page, whereUIDis the user's ID.
- The user is assigned the
- The redirection happens immediately after account creation, ensuring a smooth user experience.