简体   繁体   中英

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. I successfully done this job "individually" which is obviously easy when the fb documentation is followed.

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. Or else a popup should appear asking the user to login before he can do those actions (like/ 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).

Please throw some light on how to complete this task. I am using PHP and 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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