开发者

how to login user through code in drupal?

I have to login a user through drupal code having userID... basically the scenario is that I have registered a user through e-mail verification. when user clicks the link given in email he/she become active. Now I need to implement that along wit开发者_开发知识库h becoming user active, he/she should be logged in automatically. I think i made my point clear. Any idea??

Thanks


Check out the User module, specifically the user_external_login and user_authenticate_finalize functions. You can either call those functions or use them as the basis for creating your own functions.

On a related note, there's not enough detail in your question to know for sure, but it sounds like you might be duplicating functionality already in the User module. If you're new to Drupal, you may want to make sure you can't accomplish what you need to do with the existing options under User management > User settings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜