Drupal-每次用户登录后,如何重定向到特定于用户的页面? [英] Drupal - After each user login, how can I redirect to a user-specific page?

查看:52
本文介绍了Drupal-每次用户登录后,如何重定向到特定于用户的页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要的是:在每个用户登录后重定向到其特定页面.

What we need: redirect to each user's specific page after their login.

我们尝试过的事情:

登录雪橇模块:可以直接转到每个用户的个人资料页面,但是我们没有在哪里定义特定的节点,即用户David的节点15.如果您有这方面的经验,请提出建议.

Login Toboggan module: can be direct to each user's profile page, however we do not where to define specific node, i.e node 15 for user David. If you have experience on this, please advise.

Nodeacccess:为每种内容类型定义的通用访问控制.

Nodeacccess: generic access control defined to each content type.

还有其他建议吗?

推荐答案

我建议使用登录目标"模块.您可以使用PHP设置要重定向到每个用户的特定节点.该页面上的文档非常清晰,但是如果您需要更多帮助,您的PHP代码段最终将看起来像这样:

I'd recommed the Login Destination module. You can use PHP to set specific nodes to redirect to per user. The documentation on that page is pretty clear, but in case you need some more help, your PHP snippet will end up looking something like:

global $user;
switch $user->uid {
  case '1': //for user 1
    return 'node/1'; //to redirect to node #1
  case '2': //for user 2
    return 'node/10'; //to redirect to node #10
  // and so on...
}

希望有帮助!

刚发现,可能会有所帮助

Just found this, might be helpful.

这篇关于Drupal-每次用户登录后,如何重定向到特定于用户的页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆