/** * Initialization */ public function init() { parent::init(); $token = null; if ($this->isAuthenticated()) { $token = $this->session->token; } $this->api = new Application_Model_FacebookApi($token); }
/** * Complete authentication */ public function finishauthAction() { parent::finishauth(); if ($this->isAuthenticated()) { echo "worked!"; } else { echo "didn't work"; } }
/** * Initialization */ public function init() { parent::init(); $api_key = $this->config->key; $api_secret = $this->config->secret; $this->api = new Grooveshark_Api($api_key, $api_secret); if ($this->isAuthenticated()) { $this->api->setSession($this->session->sessionId); } else { // Start a session $session = $this->api->startSession(); $this->session->sessionId = $session; $user = new Grooveshark_User(); // Log me in $user->setUsername($this->config->username); $user->setTokenFromPassword($this->config->password); $user = $this->api->authenticateUser($user); $this->session->profile = serialize($user); } }
/** * Initialization */ public function init() { parent::init(); }