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

后端 未结 9 1221
佛祖请我去吃肉
佛祖请我去吃肉 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: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';
    }
    

提交回复
热议问题