Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to get property of non-object. #25

Open
krzysztof-gzocha opened this issue Feb 17, 2013 · 1 comment
Open

Trying to get property of non-object. #25

krzysztof-gzocha opened this issue Feb 17, 2013 · 1 comment

Comments

@krzysztof-gzocha
Copy link

Hi.
I've just installed yii-eauth extension and the authentication process works pretty well, but after auth I get this error. Any suggestions?

I was thinking about storing service->id as user's ID in my database just after successful login.

I'm using Yii 1.1.12 with yii-user module and this is the errors:

in pop-up window:
protected\components\WebUser.php(39):

36 public function updateSession() {
37         $user = Yii::app()->getModule('user')->user($this->id);
38         $userAttributes = CMap::mergeArray(array(
39                                                 'email'=>$user->email,
40                                                 'username'=>$user->username,
41                                                 'create_at'=>$user->create_at,
42                                                 'lastvisit_at'=>$user->lastvisit_at,
43                                            ),$user->profile->getAttributes());
44         foreach ($userAttributes as $attrName=>$attrValue) {
45             $this->setState($attrName,$attrValue);
46         }
47     }

in any other site:
protected\modules\user\UserModule.php(197)

public static function isAdmin() {
193         if(Yii::app()->user->isGuest)
194             return false;
195         else {
196             if (!isset(self::$_admin)) {
197                 if(self::user()->superuser)
198                     self::$_admin = true;
199                 else
200                     self::$_admin = false;
201             }
202             return self::$_admin;
203         }
204     }
@dekmabot
Copy link

got the same problem.
As I see, the new record is not created after authorizing by oauth-provider.

that`s why $user = Yii::app()->getModule('user')->user($this->id); got nothing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants