mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 06:08:21 +01:00
Create Twitter.php
This commit is contained in:
parent
73bb76f720
commit
6c273ea368
83
protected/humhub/modules/user/authclient/Twitter.php
Normal file
83
protected/humhub/modules/user/authclient/Twitter.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @link https://www.humhub.org/
|
||||
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
|
||||
* @license https://www.humhub.com/licences
|
||||
*/
|
||||
|
||||
namespace humhub\modules\user\authclient;
|
||||
|
||||
use yii\authclient\OAuth1;
|
||||
|
||||
class Twitter extends OAuth1
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
protected function defaultViewOptions()
|
||||
{
|
||||
return [
|
||||
'popupWidth' => 860,
|
||||
'popupHeight' => 480,
|
||||
'cssIcon' => 'fa fa-twitter',
|
||||
'buttonBackgroundColor' => '#395697',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $authUrl = 'https://api.twitter.com/oauth/authenticate';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $requestTokenUrl = 'https://api.twitter.com/oauth/request_token';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $requestTokenMethod = 'POST';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $accessTokenUrl = 'https://api.twitter.com/oauth/access_token';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $accessTokenMethod = 'POST';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $apiBaseUrl = 'https://api.twitter.com/1.1';
|
||||
|
||||
public $attributeParams = [];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function initUserAttributes()
|
||||
{
|
||||
return $this->api('account/verify_credentials.json', 'GET', $this->attributeParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function defaultName()
|
||||
{
|
||||
return 'twitter';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function defaultTitle()
|
||||
{
|
||||
return 'Twitter';
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user