diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-04-14 02:13:16 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-04-14 02:13:16 +0200 |
commit | 3b2567ab4501c8034881d30421906db934751de0 (patch) | |
tree | 38989762bb8916ac650ca9df4ba45dfe297e5a05 | |
parent | 50f474bab05be0c46077201bd24dd54c6e901f2c (diff) | |
download | bank-3b2567ab4501c8034881d30421906db934751de0.tar.gz bank-3b2567ab4501c8034881d30421906db934751de0.tar.bz2 bank-3b2567ab4501c8034881d30421906db934751de0.zip |
remove legacy website
-rw-r--r-- | .gitmodules | 4 | ||||
-rw-r--r-- | website/config.php | 43 | ||||
-rw-r--r-- | website/fake_wire_transfer.php | 134 | ||||
-rw-r--r-- | website/index.php | 128 | ||||
-rw-r--r-- | website/start_wire_transfer.php | 61 | ||||
-rw-r--r-- | website/style.css | 83 | ||||
m--------- | website/web-common | 0 |
7 files changed, 0 insertions, 453 deletions
diff --git a/.gitmodules b/.gitmodules index d7acbe1..4998965 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ -[submodule "website/web-common"] - path = website/web-common - url = ../web-common - branch = master [submodule "talerbank/app/static/web-common"] path = talerbank/app/static/web-common url = git://taler.net/web-common diff --git a/website/config.php b/website/config.php deleted file mode 100644 index b2e33da..0000000 --- a/website/config.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/* - This file is part of GNU TALER. - Copyright (C) 2014, 2015, 2016 INRIA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2.1, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> - - @author Marcello Stanisci - @author Florian Dold -*/ - -$explicit_currency = false; -//$explicit_currency = "PUDOS"; - -$host = $_SERVER["HTTP_HOST"]; -switch ($host) { -case "bank.demo.taler.net": - $BANK_CURRENCY = "KUDOS"; - break; -case "bank.test.taler.net": - $BANK_CURRENCY = "PUDOS"; - break; -default: - if ($explicit_currency != false) { - $BANK_CURRENCY = $explicit_currency; - } - else { - http_response_code (500); - echo "<p>Bank configuration error: No currency for domain $host</p>\n"; - die(); - } -} - -?> diff --git a/website/fake_wire_transfer.php b/website/fake_wire_transfer.php deleted file mode 100644 index 7d9f2ac..0000000 --- a/website/fake_wire_transfer.php +++ /dev/null @@ -1,134 +0,0 @@ -<?php -/* - This file is part of GNU TALER. - Copyright (C) 2014, 2015, 2016 INRIA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2.1, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> - - @author Marcello Stanisci - @author Florian Dold -*/ - -require_once "config.php"; - -function die_with_error($hint, $status=500, $detail=null) { - http_response_code ($status_code); - echo "<p>Unsuccessful: $hint</p>\n"; - echo "<p>Please try again.</p>\n"; - if ($detail) { - echo "<p>Error detail:</p>"; - $text = htmlspecialchars($detail); - echo "<pre>$text</pre>"; - } - die(); -} - -session_start(); - -$exchange = $_SESSION['exchange']; - -if (0 == preg_match('/^(http|https):\/\/.*\/$/', $exchange)) { - die_with_error("bad exchange base url", 400); -} - -$reserve_pub = $_SESSION['reserve_pub']; -$amount = array( - 'value' => (int)$_SESSION['amount_value'], - 'fraction' => (int)$_SESSION['amount_fraction'], - 'currency' => $_SESSION['amount_currency'], -); - -// pack the JSON -$json = json_encode(array( - 'reserve_pub' => $reserve_pub, - 'execution_date' => "/Date(" . time() . ")/", - 'wire' => array( - 'type' => 'test', - 'account_number' => 123 - ), - 'amount' => $amount)); - -// craft the HTTP request -$req = new http\Client\Request ("POST", - $exchange . "admin/add/incoming", - array ("Content-Type" => "application/json")); -$req->getBody()->append ($json); - -// execute HTTP request -$client = new http\Client; - -try { - $client->enqueue($req)->send(); -} catch (Exception $e) { - die_with_error("could not make request to exchange (URL wrong?)", 500); -} - -$resp = $client->getResponse(); - -// evaluate response -$status_code = $resp->getResponseCode(); -http_response_code ($status_code); - -if ($status_code != 200) { - die_with_error("request to exchange returned bad status ($status_code)", 502, $resp->toString()); -} - -?> -<!DOCTYPE html> -<html lang="en"> -<head> - <title><?php echo $BANK_CURRENCY; ?> Bank - Taler Demo</title> - <link rel="stylesheet" type="text/css" href="style.css"> -<script type="application/javascript"> -<?php -echo "var reserve_pub = '$reserve_pub';"; -?> - -function confirmReserve() { - var event = new CustomEvent("taler-confirm-reserve", { - detail: { - reserve_pub: reserve_pub - } - }); - document.dispatchEvent(event); -} -document.addEventListener("DOMContentLoaded", confirmReserve); -</script> -</head> - -<body> - <header> - <div id="logo"> - <svg height="100" width="100"> - <circle cx="50" cy="50" r="40" stroke="darkmagenta" stroke-width="6" fill="white" /> - <text x="19" y="83" font-family="Verdana" font-size="90" fill="darkmagenta">B</text> - </svg> - </div> - - <h1>KUDOS Bank - Taler Demo</h1> - </header> - - <aside class="sidebar" id="left"> - </aside> - - <section id="main"> - <h1>Success!</h1> - - The bank has successfully transfered KUDOS to your chosen exchange. Your - wallet should now start to withdraw coins from the exchange. This might take a - while, but it will happen in the background. So you can now continue to - browse. - - Exit through the <a href="/shop">gift shop</a> and enjoy! - </section> -</body> -</html> diff --git a/website/index.php b/website/index.php deleted file mode 100644 index e402e56..0000000 --- a/website/index.php +++ /dev/null @@ -1,128 +0,0 @@ -<!DOCTYPE html> -<!-- - This file is part of GNU TALER. - Copyright (C) 2014, 2015, 2016 INRIA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2.1, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> - - @author Marcello Stanisci - @author Florian Dold ---> - -<?php -require_once "config.php"; -?> -<html lang="en"> -<head> - <title>KUDOS Bank - Taler Demo</title> - <link rel="stylesheet" type="text/css" href="style.css"> - <script src="web-common/taler-presence.js" type="application/javascript"></script> - <script type="application/javascript"> -<?php -echo "\tvar bank_currency = '$BANK_CURRENCY';\n"; -?> - - function requestCreateReserve() { - var form = document.getElementById("reserve-form"); - var event = new CustomEvent("taler-create-reserve", { - detail: { - callback_url: "start_wire_transfer.php", - amount: { - value: parseInt(form.elements["reserve-amount"].value), - fraction: 0, - currency: bank_currency - }, - wt_types: ["test"] - } - }); - document.dispatchEvent(event); - }; - - function addOption(value, currency) { - var s = document.getElementById("reserve-amount"); - var e = document.createElement("option"); - e.textContent = "".concat(value, " ", currency); - e.value = value; - s.appendChild(e); - } - - function addOptions() { - addOption(1, bank_currency); - addOption(2, bank_currency); - addOption(5, bank_currency); - addOption(10, bank_currency); - addOption(20, bank_currency); - } - - document.addEventListener("DOMContentLoaded", addOptions); - </script> -</head> - -<body> - <header> - <div id="logo"> - <svg height="100" width="100"> - <circle cx="50" cy="50" r="40" stroke="darkmagenta" stroke-width="6" fill="white" /> - <text x="19" y="83" font-family="Verdana" font-size="90" fill="darkmagenta">B</text> - </svg> - </div> - - <?php -echo "<h1>$BANK_CURRENCY bank - Taler Demo!</h1>\n"; - ?> - - </header> - - <aside class="sidebar" id="left"> - </aside> - - <section id="main"> - - <?php -echo "<h1>Welcome to the $BANK_CURRENCY bank!</h1>\n"; - ?> - - <article> - <p> - Through this page, you can wire funds to our demonstrator exchange - in order to create your reserves from where withdraw your coins. - Once the reserve is created, the withdrawing of coins will be - entirely handled by the wallet, with no intervention required - to the user. - </p> - <p> - Enter the desired amount, and click 'Select exchange'. Your wallet - will ask you to choose a exchange and will automatically submit all the - needed data into the bank's system. At the end of the withdrawal, - the wallet will show you the 'All coins withdrawn' nice message. - </p> - - <p class="taler-installed-hide">Still missing a wallet? - <a href="http://demo.taler.net/">Install one!</a> - </p> - - <form id="reserve-form" action="fake_wire_transfer.php" method="POST"> - <input type="text" id="reserve-pk-input" name="reserve_pk" hidden></input> - Amount to withdraw: - <select id="reserve-amount"> - <!-- amounts will be added with JavaScript --> - </select> - <input type="text" name="exchange_rcv" id="kudos-exchange" hidden></input> - <input class="taler-installed-activate" - type="button" - onclick="requestCreateReserve()" - value="Select exchange"></input> - </form> - </article> - </section> -</body> -</html> diff --git a/website/start_wire_transfer.php b/website/start_wire_transfer.php deleted file mode 100644 index 7fadbb1..0000000 --- a/website/start_wire_transfer.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php -/* - This file is part of GNU TALER. - Copyright (C) 2014, 2015, 2016 INRIA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2.1, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> - - @author Florian Dold -*/ - -// Set cookies from from the query parameters. -// Note that it would be cleaner / more RESTful to pass -// them as the POST body though. - -session_start(); - -function get($name) { - if (isset($_GET[$name])) { - return $_GET[$name]; - } - echo "Parameter $name not set"; - http_response_code(400); - die(); -} - -$_SESSION["exchange"] = get("exchange"); -$_SESSION["reserve_pub"] = get("reserve_pub"); -$_SESSION["amount_value"] = (int) get("amount_value"); -$_SESSION["amount_fraction"] = (int) get("amount_fraction"); -$_SESSION["amount_currency"] = get("amount_currency"); - -?> -<!DOCTYPE html> -<html lang="en"> -<head> - <title>KUDOS Bank - Taler Demo</title> - <link rel="stylesheet" type="text/css" href="style.css"> -<script type="application/javascript"> - -function submitForm() { - var form = document.getElementById("transfer"); - form.submit(); -} -document.addEventListener("DOMContentLoaded", submitForm); - -</script> -</head> - -<body> - <form id="transfer" action="fake_wire_transfer.php"></form> -</body> -</html> diff --git a/website/style.css b/website/style.css deleted file mode 100644 index be5dd95..0000000 --- a/website/style.css +++ /dev/null @@ -1,83 +0,0 @@ -/* - This file is part of GNU TALER. - Copyright (C) 2014, 2015, 2016 INRIA - - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU Lesser General Public License as published by the Free Software - Foundation; either version 2.1, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License along with - TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> - - @author Gabor Toth -*/ - -body { - background-color: white; - margin: 0; - padding: 0; - font-family: Verdana, sans; -} - -header { - width: 100%; - height: 100px; - margin: 0; - padding: 0; - border-bottom: 1px solid black; -} - -header h1 { - font-size: 200%; - margin: 0; - padding: 0 0 0 120px; - position: relative; - top: 50%; - transform: translateY(-50%); -} - -header #logo { - float: left; - width: 100px; - padding: 0; - margin: 0; - text-align: center; - border-right: 1px solid black; -} - -aside { - width: 100px; - float: left; -} - -section#main { - margin: 0 0 0 100px; - padding: 20px; - border-left: 1px solid black; - height: 100%; - max-width: 40em; -} - -section#main h1:first-child { - margin-top: 0; -} - -h1 { - font-size: 160%; -} - -h2 { - font-size: 140%; -} - -h3 { - font-size: 120%; -} - -h4, h5, h6 { - font-size: 100%; -} diff --git a/website/web-common b/website/web-common deleted file mode 160000 -Subproject 026ef2476676ef00b6c2a0cec135a8e64024ee5 |