Esempio n. 1
0
 public function api_requesttoken()
 {
     //pull in our interface class.
     $provider = $this->get('provider');
     //this is where we generate our token.
     $token_key = MyOAuthProvider::generateToken();
     $token_secret = MyOAuthProvider::generateToken();
     //okay, save it to the db.
     $t = new OAuthToken();
     $t->set('type', 1);
     $t->set('consumer_id', $provider->consumer->id);
     $t->set('token', $token_key);
     $t->set('token_secret', $token_secret);
     $t->save();
     $data['oauth_token'] = $token_key;
     $data['oauth_token_secret'] = $token_secret;
     return $data;
 }
Esempio n. 2
0
 public function api_requesttoken()
 {
     //pull in our interface class.
     $provider = $this->get('provider');
     //this is where we generate our token.
     $token_key = MyOAuthProvider::generateToken();
     $token_secret = MyOAuthProvider::generateToken();
     //okay, save it to the db.
     $t = new OAuthToken();
     $t->set('type', OauthToken::$REQUEST);
     $t->set('consumer_id', $provider->consumer->id);
     $t->set('token', $token_key);
     $t->set('token_secret', $token_secret);
     $t->set('ip_address', $_SERVER['REMOTE_ADDR']);
     $t->set('last_seen', date("Y-m-d H:i:s"));
     $t->save();
     $data['oauth_token'] = $token_key;
     $data['oauth_token_secret'] = $token_secret;
     return $data;
 }