Subversion Repositories munaweb

Rev

Rev 3 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
if (!isset($_GET["status"])) {

    ini_set('include_path', ini_get('include_path') . ':.:../ebay/php');
    require_once ('keys.php');

    header("Location: https://signin.ebay.com/authorize?client_id=" . $app . "&redirect_uri=" . $runame . "&response_type=code&scope=https%3A%2F%2Fapi.ebay.com%2Foauth%2Fapi_scope%2Fsell.marketing");

    exit;

} else if ($_GET["status"] == "accepted") {

    printHeader();
    printKeyValues('Accepted', $_GET);
    printFooter();
    closeWindow();
    exit;
    
} else if ($_GET["status"] == "declined") {

    printHeader();
    printKeyValues('Declined', $_GET);
    printFooter();
    closeWindow();
    exit;

}

function printHeader() {
    echo '<!DOCTYPE html>';
    echo '<html lang="en">';
    echo '<head>';
    echo '    <title>eBay Access Permission</title>';
    echo '    <meta charset="UTF-8">';
    echo '    <meta name="viewport" content="width=device-width, initial-scale=1.0">';
    echo '    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">';
    echo '    <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">';
    echo '    <link rel="stylesheet" href="css/style.css">';
    echo '</head>';
    echo '<body>';
    echo '    <div class="w3-main">';
    echo '        <div class="w3-container w3-padding w3-margin w3-card-4">';
    echo '            <div class="w3-container w3-gray" style="height:100px">';
    echo '                <img class="w3-image" src="images/MUNA%20-%20Logo%20100x100.png" alt="MUNA Trading Logo" style="height:100px">';
    echo '                <p class="w3-xxlarge w3-right">eBay Access Permission</p>';
    echo '            </div>';
    echo '            <div class="w3-row">';
    echo '                <div>';
}

function printKeyValues($str, $keyValues) {
    echo '<h2>' . $str . '</h2>';
    foreach($keyValues as $key => $value) {
        echo '<p>' . $key . ': ' . $value . '</p>';
    }
}

function closeWindow() {
    echo '<script type="text/javascript">setTimeout( function() { window.close(); }, 5000);</script>';
}

function printFooter() {
    echo '                </div>';
    echo '            </div>';
    echo '        </div>';
    echo '        <footer class="w3-container w3-center w3-border-top w3-margin">';
    echo '            Copyright &#169; ' . date("Y") . ' MUNA Trading. All rights reserved.';
    echo '        </footer>';
    echo '    </div>';
    echo '</body>';
    echo '</html>';
}

    ?>