How to redirect user to a specific page after they login if they belong to a certain role?

后端 未结 9 849
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-11 04:26

We have certain users in our member list that have a role \"vendor\" attached to them. All such members are to be redirected to a certain page upon login. How can this be ac

相关标签:
9条回答
  • 2020-12-11 05:13

    There are modules that do this (besides Trigger+Actions), such as LoginDestination: http://drupal.org/project/login_destination. This Drupal forum post has a bit more info about it as well.

    0 讨论(0)
  • 2020-12-11 05:18

    There is more than one way to skin this cat... This is my preferred Drupal 7 method:

    function hook_user_login(&$edit, $account) {
      $edit['redirect'] = 'node/123';
    }
    
    0 讨论(0)
  • 2020-12-11 05:21

    This can be achieved by using a combination of content access and login toboggan modules. You'll be able to restrict pages and prompt user to login to access them.

    0 讨论(0)
提交回复
热议问题