3 |
- |
1 |
<?php
|
|
|
2 |
if (!isset($_GET["status"])) {
|
|
|
3 |
|
4 |
- |
4 |
ini_set('include_path', ini_get('include_path') . ':.:../ebay/php');
|
|
|
5 |
require_once ('keys.php');
|
3 |
- |
6 |
|
4 |
- |
7 |
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");
|
|
|
8 |
|
3 |
- |
9 |
exit;
|
|
|
10 |
|
|
|
11 |
} else if ($_GET["status"] == "accepted") {
|
|
|
12 |
|
4 |
- |
13 |
printHeader();
|
|
|
14 |
printKeyValues('Accepted', $_GET);
|
|
|
15 |
printFooter();
|
|
|
16 |
closeWindow();
|
3 |
- |
17 |
exit;
|
|
|
18 |
|
|
|
19 |
} else if ($_GET["status"] == "declined") {
|
|
|
20 |
|
4 |
- |
21 |
printHeader();
|
|
|
22 |
printKeyValues('Declined', $_GET);
|
|
|
23 |
printFooter();
|
|
|
24 |
closeWindow();
|
3 |
- |
25 |
exit;
|
|
|
26 |
|
|
|
27 |
}
|
|
|
28 |
|
4 |
- |
29 |
function printHeader() {
|
|
|
30 |
echo '<!DOCTYPE html>';
|
|
|
31 |
echo '<html lang="en">';
|
|
|
32 |
echo '<head>';
|
|
|
33 |
echo ' <title>eBay Access Permission</title>';
|
|
|
34 |
echo ' <meta charset="UTF-8">';
|
|
|
35 |
echo ' <meta name="viewport" content="width=device-width, initial-scale=1.0">';
|
|
|
36 |
echo ' <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">';
|
|
|
37 |
echo ' <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">';
|
|
|
38 |
echo ' <link rel="stylesheet" href="css/style.css">';
|
|
|
39 |
echo '</head>';
|
|
|
40 |
echo '<body>';
|
|
|
41 |
echo ' <div class="w3-main">';
|
|
|
42 |
echo ' <div class="w3-container w3-padding w3-margin w3-card-4">';
|
|
|
43 |
echo ' <div class="w3-container w3-gray" style="height:100px">';
|
|
|
44 |
echo ' <img class="w3-image" src="images/MUNA%20-%20Logo%20100x100.png" alt="MUNA Trading Logo" style="height:100px">';
|
|
|
45 |
echo ' <p class="w3-xxlarge w3-right">eBay Access Permission</p>';
|
|
|
46 |
echo ' </div>';
|
|
|
47 |
echo ' <div class="w3-row">';
|
|
|
48 |
echo ' <div>';
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
function printKeyValues($str, $keyValues) {
|
|
|
52 |
echo '<h2>' . $str . '</h2>';
|
3 |
- |
53 |
foreach($keyValues as $key => $value) {
|
|
|
54 |
echo '<p>' . $key . ': ' . $value . '</p>';
|
|
|
55 |
}
|
|
|
56 |
}
|
4 |
- |
57 |
|
|
|
58 |
function closeWindow() {
|
|
|
59 |
echo '<script type="text/javascript">setTimeout( function() { window.close(); }, 5000);</script>';
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
function printFooter() {
|
|
|
63 |
echo ' </div>';
|
|
|
64 |
echo ' </div>';
|
|
|
65 |
echo ' </div>';
|
|
|
66 |
echo ' <footer class="w3-container w3-center w3-border-top w3-margin">';
|
|
|
67 |
echo ' Copyright © ' . date("Y") . ' MUNA Trading. All rights reserved.';
|
|
|
68 |
echo ' </footer>';
|
|
|
69 |
echo ' </div>';
|
|
|
70 |
echo '</body>';
|
|
|
71 |
echo '</html>';
|
|
|
72 |
}
|
|
|
73 |
|
3 |
- |
74 |
?>
|