SleepWalker / hoauth

yii-hoauth provides simple integration with social network authorisation lib Hybridauth in Yii.
Other
59 stars 35 forks source link

Update User Status #49

Closed hallstar05 closed 10 years ago

hallstar05 commented 10 years ago

How do I update a user's status? For example, updating a logged-in (connected) Facebook user's status.

For example, with hybridauth, I do this:

    $adapter = $hybridauth->authenticate( $provider );
    $adapter->setUserStatus($message);

But how can I do that using this library? Thanks.

SleepWalker commented 10 years ago

hi @hallstar05, you can do that almost the same way:

$oAuth = UserOAuth::model()->authenticate( $provider );
$oAuth->adapter->setUserStatus($message);

or when you want, you can do that through db

$oAuth = UserOAuth::model()->findUser(5, "Google");
if($oAuth) {  // this user had used HOAuth earlier
  $oAuth->adapter->setUserStatus($message);
}
hallstar05 commented 10 years ago

This is brilliant! Thanks for helping.

SleepWalker commented 10 years ago

not at all :)