HEX
Server: Apache
System: Linux 162-240-236-42.bluehost.com 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
User: bt667 (1004)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/bt667/www/wp-content/plugins/easy-digital-downloads/includes/aweber_api/request-access.php
<?php

include_once('../../../../../wp-load.php');

//$appID = '0d6203e1';

//$oauth_callback = rawurlencode(MV_PLAYER_URL.'/includes/aweber_api/request-access.php?processed=1');

if(isset($_GET['request-access']) && isset($_GET['vid']))

{

	$appID = '0d6203e1';

        $vid = $_GET['vid'];

        $oauth_callback = rawurlencode(MV_PLAYER_URL.'includes/aweber_api/request-access.php?processed=1&vid='.$vid);

        $awebr_access_point =  "https://auth.aweber.com/1.0/oauth/authorize_app/{$appID}?oauth_callback={$oauth_callback}";

	header('Location:'. $awebr_access_point); 

}

if(isset($_GET['processed']) && isset($_GET['vid']))

{

	/* Now process the request */

    $vid=$_GET['vid'];

        try

        {

                global $wpdb;

                $auth = AWeberAPI::getDataFromAweberID($_GET['authorization_code']);

                $aweber_data = array();

                $aweber_data['consumerKey'] = $auth[0];

                $aweber_data['consumerSecret'] = $auth[1];

                $aweber_data['accessKey'] = $auth[2];

                $aweber_data['accessSecret'] = $auth[3];

                /* Now lets save this in database for future use */

                $table_name = $wpdb->prefix . "mvplayer_video";

                $desc = $wpdb->get_row( "SELECT * FROM $table_name where id='$vid'" );

                if(!$desc)

                {

                        $wpdb->insert( $table_name, array('AWeberAccessTokens' => serialize($aweber_data)) );

                }

                else

                {

                        $wpdb->query( "update $table_name set AWeberAccessTokens = '".serialize($aweber_data)."' where id='$vid'" );

                        header('Location:'.get_option( 'siteurl' ) . '/wp-admin/admin.php?page=mv_player_add_video&id='.$vid.'&aweber-success=1');

                }

        }

        catch(Exception $e)

        {

                /* Something went wrong!! */

                header('Location:'.get_option( 'siteurl' ) . '/wp-admin/admin.php?page=mv_player_add_video&id='.$vid.'&aweber-error=1');

        }

        

}