PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
plugins
/
dokan-pro
/
includes
/
lib
/
hybridauth
/
Provider
<?php /*! * Hybridauth * https://hybridauth.github.io | https://github.com/hybridauth/hybridauth * (c) 2017 Hybridauth authors | https://hybridauth.github.io/license.html */ namespace Hybridauth\Provider; use Hybridauth\Adapter\OAuth2; use Hybridauth\Data; use Hybridauth\Exception\UnexpectedApiResponseException; use Hybridauth\User; /** * LinkedIn OAuth2 provider adapter. */ class LinkedIn extends OAuth2 { /** * {@inheritdoc} */ public $scope = 'r_basicprofile r_emailaddress w_share'; /** * {@inheritdoc} */ protected $apiBaseUrl = 'https://api.linkedin.com/v1/'; /** * {@inheritdoc} */ protected $authorizeUrl = 'https://www.linkedin.com/oauth/v2/authorization'; /** * {@inheritdoc} */ protected $accessTokenUrl = 'https://www.linkedin.com/oauth/v2/accessToken'; /** * {@inheritdoc} */ protected $apiDocumentation = 'https://developer.linkedin.com/docs/oauth2'; /** * {@inheritdoc} */ public function getUserProfile() { $fields = [ 'id', 'email-address', 'first-name', 'last-name', 'headline', 'location', 'industry', 'picture-url', 'public-profile-url', 'num-connections', ]; if ($this->config->get('photo_size') === 'original') { $fields[] = 'picture-urls::(original)'; } $response = $this->apiRequest('people/~:(' . implode(',', $fields) . ')', 'GET', ['format' => 'json']); $data = new Data\Collection($response); if (!$data->exists('id')) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } $userProfile = new User\Profile(); $userProfile->identifier = $data->get('id'); $userProfile->firstName = $data->get('firstName'); $userProfile->lastName = $data->get('lastName'); $userProfile->photoURL = $data->get('pictureUrl'); $userProfile->profileURL = $data->get('publicProfileUrl'); $userProfile->email = $data->get('emailAddress'); $userProfile->description = $data->get('headline'); $userProfile->country = $data->filter('location')->get('name'); if ($this->config->get('photo_size') === 'original') { $originals = $data->get('pictureUrls'); if (!empty($originals->values)) { $userProfile->photoURL = $originals->values[0]; } } $userProfile->emailVerified = $userProfile->email; $userProfile->displayName = trim($userProfile->firstName . ' ' . $userProfile->lastName); $userProfile->data['connections'] = $data->get('numConnections'); return $userProfile; } /** * {@inheritdoc} * * @see https://developer.linkedin.com/docs/share-on-linkedin */ public function setUserStatus($status) { $status = is_string($status) ? ['comment' => $status] : $status; if (!isset($status['visibility'])) { $status['visibility']['code'] = 'anyone'; } $headers = [ 'Content-Type' => 'application/json', 'x-li-format' => 'json', ]; $response = $this->apiRequest('people/~/shares?format=json', 'POST', $status, $headers); return $response; } }
[+]
..
[-] WindowsLive.php
[edit]
[-] Google.php
[edit]
[-] GitLab.php
[edit]
[-] BitBucket.php
[edit]
[-] YahooOpenID.php
[edit]
[-] PaypalOpenID.php
[edit]
[-] Instagram.php
[edit]
[-] Authentiq.php
[edit]
[-] Yahoo.php
[edit]
[-] WeChat.php
[edit]
[-] Tumblr.php
[edit]
[-] BlizzardAPAC.php
[edit]
[-] Foursquare.php
[edit]
[-] BlizzardEU.php
[edit]
[-] Blizzard.php
[edit]
[-] Yandex.php
[edit]
[-] MicrosoftGraph.php
[edit]
[-] WordPress.php
[edit]
[-] StackExchangeOpenID.php
[edit]
[-] Discord.php
[edit]
[-] Facebook.php
[edit]
[-] Reddit.php
[edit]
[-] Twitter.php
[edit]
[-] TwitchTV.php
[edit]
[-] Mailru.php
[edit]
[-] AOLOpenID.php
[edit]
[-] Spotify.php
[edit]
[-] OpenID.php
[edit]
[-] SteemConnect.php
[edit]
[-] GitHub.php
[edit]
[-] Steam.php
[edit]
[-] LinkedIn.php
[edit]
[-] Disqus.php
[edit]
[-] WeChatChina.php
[edit]
[-] Dribbble.php
[edit]
[-] StackExchange.php
[edit]
[-] Odnoklassniki.php
[edit]
[-] Vkontakte.php
[edit]