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条)

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line