本文整理匯總了PHP中LinkedIn::resetToken方法的典型用法代碼示例。如果您正苦於以下問題:PHP LinkedIn::resetToken方法的具體用法?PHP LinkedIn::resetToken怎麽用?PHP LinkedIn::resetToken使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類LinkedIn
的用法示例。
在下文中一共展示了LinkedIn::resetToken方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: linkedInLogin
/**
* Function to Grant Access to Linkedin
* @author Rohan Julka
* */
public function linkedInLogin($userIdApp = null)
{
$userId = !empty($userIdApp) ? $userIdApp : $this->Session->read('Auth.Front.id');
$userIsConnected = $this->User->find('first', array('conditions' => array('User.id' => array($this->Encryption->decode($userId))), 'fields' => array('User.linkedin_connected')));
if (!empty($userIsConnected['User']['linkedin_connected'])) {
$this->Session->setFlash('Your LinkedIn account has already been linked', 'Front/flash_good');
if (!empty($userIdApp)) {
$this->redirect('foxhoprapplication://alreadylinkedin');
} else {
return $this->redirect(array('controller' => 'businessOwners', 'action' => 'social', 'linkedIn'));
}
}
if (!empty($userIdApp)) {
$this->Session->write('Auth.Front.id', $userIdApp);
$this->Session->write('AccessedBy', 'WebService');
}
require_once ROOT . DS . APP_DIR . DS . 'Plugin/linkedin/linkedin.php';
$ln = new LinkedIn(Configure::read('linkedinApiKey'), Configure::read('linkedinApiSecret'), Configure::read('SITE_URL') . 'businessOwners/linkedInOauthCallback', array('w_share', 'r_basicprofile'));
if ($ln->authorize()) {
$ln->resetToken();
$ln->authorize();
echo 'authorized';
} else {
echo 'not authorized';
}
$this->autoRender = false;
}