You should be able to use the user type module on an existing site which has allready a significant amount of users when you could ask them to choose a type at logging in. After choosing the type you will still be able to change from one user type to an other using the switch user feature which was recently added.
Why not simply use the switch user type? Because some sites will allow only one (permanent) user type and will turn off the permission to switch. For this reason this feature could still be usefull.

CommentFileSizeAuthor
#1 user_types_give_type.module.patch2.89 KBdomidc

Comments

domidc’s picture

StatusFileSize
new2.89 KB

I decided to develop the feature I requested. A form will be displayed at login in. After choosing your type the page wont be available anymore so if the access to switch user is disabled the type chosen is permanent.

documentation:

adapted functions:
  • menu hook : new item(path 'choosetype') who calls the form via user_types_page(), access is checked by user_type_user_access_choosetype().
  • user hook : case login which checks if you are allready a 'typed' user, and if you're not you'll be directed to the form.
new functions:
  • user_type_user_access_choosetype() : If you allready have a type access is denied to the form.
  • user_types_page() : Sets up the page to display the form.
  • user_types_set_type() : the form where you can choose your type.
  • user_types_set_type_submit($form_id, $form_values): inserts your uid and user_type_type in the user_types_user table.
swentel’s picture

Status: Active » Fixed

There was an implementation of the idea in HEAD allready, so I left the current implementation with one minor modification based on your suggestions: you can only switch if you currently have the default user type (normal user).

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.