Help Single sign on between Wordpress and Pligg

2019-08-08 01:07发布

1条回答
三岁会撩人
2楼-- · 2019-08-08 01:20

I think you're trying to make it so that when a user is logged into Wordpress they are also logged into Pligg. Is this correct?

There is an interesting article covering this where the author mentions editing the \libs\login.php file. It's basically editing the file's function and adding user_logged_onto_wp() as a custom function which... well here's the author's quite:

All the work to modify Pligg takes place in ‘libs/login.php’. What we want to do is get Pligg to login using WordPress cookies/authentication. If the user doesn’t yet exist in Pligg, create it. Also, copy over all the existing user data to the Pligg database. We won’t be using Pligg’s login, authentication or logout any more.

However, we can’t just include wordpress and call wordpress functions. Instead, we’re going to have to do it manually. What I’ve done is added a function called is_user_logged_onto_wp(), which does all the extra work.

Check the link and follow his code, this should still work with the latest Pligg 1.1.4 CMS. Not sure though as I haven't personally tested...

查看更多
登录 后发表回答