简体   繁体   English

如果他没有直接登录我的网站,请阻止用户喜欢/分享/添加对内容的评论

[英]Prevent user from like/ share/ add comment to content if he is not directly logged into my website

I am trying to integrate facebook login, like, share, comments in my website. 我想在我的网站上整合facebook登录,比如分享,评论。 I successfully done this job "individually" which is obviously easy when the fb documentation is followed. 我成功地“单独”完成了这项工作,这在遵循fb文档时显然很容易。

Now the interesting bit is I was asked to integrate these in such a way that 现在有趣的是,我被要求以这样的方式整合这些

  • The user should be able to like/ comment/ share if and only if he is logged into my website with his facebook credentials. 当且仅当他用他的facebook凭据登录我的网站时,用户应该能够喜欢/评论/分享。 Or else a popup should appear asking the user to login before he can do those actions (like/ comment/ share) 否则应该出现一个弹出窗口,要求用户在他可以执行这些操作之前登录(例如/ comment / share)

  • The user should not be automatically logged into website even if he has opened facebook in another tab (which I tried to achieve but the user is able to like/ share/ comment even without actually logging into my website which I should prevent). 用户不应该自动登录到网站,即使他已经在另一个标签中打开了facebook(我试图实现但用户能够喜欢/分享/评论,即使没有实际登录我的网站,我应该阻止)。

Please throw some light on how to complete this task. 请详细说明如何完成此任务。 I am using PHP and jQuery. 我正在使用PHP和jQuery。 Thanks for any suggestions. 谢谢你的任何建议。

I haven't ever done anything like this but I assume there is some or other 'widget' on your page that performs the tasks you mention. 我没有做过这样的事情,但我认为你的页面上有一些或其他“小部件”可以执行你提到的任务。 I also assume that these widgets are provided by, say, facebook. 我还假设这些小部件是由facebook提供的。

I would suggest simply not rendering the relevant widget unless your user is signed into your site. 除非您的用户已登录到您的网站,否则我建议您不要渲染相关的小部件。

You could render some 'disabled' image that looks like the original that can pop up your login page. 您可以渲染一些看起来像可以弹出登录页面的原始图像的“已禁用”图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM