How can I make 2 kind of registration on site ?

For example: I have registered users and they can do another registration and become vip registered users.

Comments

esllou’s picture

Wouldn't you just have a different role?

Members who sign up would be Authenticated Users and then you can manually create a role, let's call it "VIP" and you can manually put members into that if they apply for it, pay for it or go through some type of threshold (nodes created, votes, etc) to get to that role level.

And you can even use MySql triggers to automate role updating.

mysocom’s picture

to esllou

I don't want to do it manually, user should have a ability to choose his role himself.

smokingtrucks’s picture

Here's an overview of a possible solution using a custom module:


1. Use hook_menu to create a vip registration menu item. Example (user/register/vip)

$items[] = array('path' => 'user/register/vip', 'title' => t('vip registration'),
    'type' => MENU_LOCAL_TASK);



2. Use hook_user to add a hidden form field to the user registration form if the path is 'user/register/vip'

if ( $op == 'register' && arg(2) == 'vip' ) {
  $vip_form['vip'] = array(
  	  '#type' => 'hidden',
	  '#value' => TRUE
    );
  return $vip_form;
}



3. Use hook_user to add the vip role to users registered with the 'user/register/vip' form. We're just checking for the hidden 'vip' form field.

if ( $op == 'insert' && $edit['vip'] ) {
  //add the vip role to the user object ($account)
}