0

I have problem! Im trying add Facebook login on my website but some stuff in my script is encoded. Problem is that in facebook login for detect user is logged in or not use this code:

if ($user)
 {
   /* Some code for logged in user
 }

And on myy website I using this code:

if(User::isLoggedIn())
 {
   /* some code
 }

My question is how can I change this to dont need change every file where is User::isLoggedIn()

4

2 回答 2

1

进入您的 User 类,isLoggedIn 方法,添加

public function isLoggedIn() {
    global $user
    return $user;
}
于 2013-02-13T09:19:13.850 回答
0

我所做的是将用户 Facebook 帐户与用户登录帐户链接,在我的数据库用户表中添加一个字段,然后,当用户通过 Facebook 登录时,我检查他的 ID 是否与我的数据库中的用户帐户相关联。

如果是这样,我会在激活登录的情况下初始化用户类。

于 2013-02-13T09:19:52.987 回答