dovs36921 2012-11-26 18:17
浏览 44
已采纳

用另一个应用程序验证Drupal 7用户?

So essentially part of my company's web site is run off of Drupal 7 plus the commerce plugin. I am wondering if there is a safe way to utilize the users already existing in this system in other parts of the website that are not using Drupal. This is to avoid having two separate user accounts for one single user due to lack of communication between the programs. Is there a safe way to authehnticate users in my application based on information from the Drupal database or a standard way of going about this? The Drupal backing database is a large, strange, complicated behemoth, and I would prefer not to anger it.

The only thing I need to do is determine whether a user's credentials are valid if they login via my authentication form. If I can do this by using the Drupal login system (perhaps by passing a url to forward to afterwards) that would be excellent. Or is there a script that already manages this?

I would also like to be able to determine whether a user has already logged in and is still remember based on the cookie that I am sure the Drupal software sets.

References, applicable scripts I can use in the Drupal core, etc would be much appreciated. I am a person who knows nothing about Drupal, but have good PHP/knowledge as I have been doing web development professionally for several years.

  • 写回答

3条回答 默认 最新

  • dongshanji3102 2012-11-26 18:44
    关注

    Yep it is easy, you can do it one of two ways.

    Option 1, use the Services module and you can use REST to login/authenticate users.

    Option 2, you can write custom code. You would either include the Drupal Boostrap or individual files you need from the user module. Then simply use the user_authenticate() function to check username and password.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!