0

Following is the use case I have to complete:

User registers on a drupal site and the admin assigns him/her to a Group (Amateur Group). Say after 6 months of registration to that Group, user has to be moved to another group (Expert Group), removing him/her from the previous group, automatically without the admin intervening.

Any ideas how this can be achieved? Is there any module for this?

Thanks in advance!

Tushar Gupta - curioustushar
  • 58,085
  • 24
  • 103
  • 107
Kunal Aggarwal
  • 301
  • 4
  • 18

1 Answers1

1

You could write a simple drupal module implementing hook_cron to check certain conditions every time the cron is executed. You could also use user login hook. You just need to get all users using entity_load('user') and check which of them have certain role (Amateur):

if (in_array('amateur', $user->roles) && moreThanSixMonthMembership($user)) {
  // Change roles
}

Once you know which users should change their group, assign the proper roles. This may be helpful.

Hope it helps.

Community
  • 1
  • 1
Bustikiller
  • 2,423
  • 2
  • 16
  • 34