-
Notifications
You must be signed in to change notification settings - Fork 45
/
vault.php
128 lines (109 loc) · 4.97 KB
/
vault.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?
include ("core/wallet.php");
if ($_GET ['key'] && $addr->verKey ( $_GET ['key'] )) {
$ltcaddr = $addr->verKey ( $_GET ['key'] );
if (! isset ( $_SESSION ["key"] )) {
$_SESSION ["key"] = $_GET ["key"];
header ( "location: vault?key=" . $_GET ["key"] );
}
} else
$ltcaddr = "FAiL...";
include ('templates/header.php');
// index page
?>
<div class="page-header">
<h2 align="center"><? echo "{$ltcaddr}"; ?><small></small>
</h2>
</div>
<div class="row">
<div class="span10">
<?php
if ($_GET ['key']) {
if ($addr->verKey ( $_GET ['key'] )) {
$ltcaddr = $addr->verKey ( $_GET ['key'] );
// sets/updates
// session_key with
// valid provided ...
if ($_POST ['amount'] && $_POST ['address']) {
try {
$addr->sanitizedSend ( $_POST ['address'], $ltcaddr, $_GET ['key'], str_replace ( ",", ".", $_POST ['amount'] ) );
echo '<div class="alert-message success" data-alert="alert"><a class="close" onclick="\$().alert()" href="#">×</a><p>Successfully sent ' . $_POST ['amount'] . " LTC to" . $_POST ['address'] . '</p></div>';
} catch ( Exception $erar ) {
switch ($erar->getMessage ()) {
case "INVALID_AMT" :
echo srserr ( "What sort-of amount is that!? Trying to exploit?" );
break;
case "INVALID_ADDR" :
echo srserr ( "Sending {$_POST['amount']} to {$_POST['address']} failed: Invalid litecoin address" );
break;
case "SEND_FAILED" :
echo srserr ( "Sending {$_POST['amount']} to {$_POST['address']} failed: Not enough funds in your account, if you are SURE you have enough money, please contact an admin" );
break;
case "LOW_BALANCE" :
echo srserr ( "Sending {$_POST['amount']} to {$_POST['address']} failed: Not enough funds in your account, Remember some transactions requires a 0.1 minimum fee, if you are SURE you have enough money, please contact an admin" );
break;
default :
echo srserr ( "Well fuck, something bad happened...and my script hasn't detected why, please contact an admin IMMEDIETLY" );
}
}
}
echo srsnot ( "<strong>IMPORTANT!</strong> DO <strong>NOT</strong> LOSE THIS LINK, IT IS LINKED TO YOUR ACCOUNT, IF YOU LOSE THIS LINK, YOU HAVE LOST ACCESS TO YOUR ACCOUNT AND WE WILL NOT BE ABLE TO RETRIEVE IT FOR YOU... <br>
<br>
<center><a href=http://wallet.it.cx/vault?key={$_GET['key']} style=\"font-size: 12px;\">http://wallet.it.cx/vault?key={$_GET['key']}</a> (ctrl+b to bookmark)</center>" );
// echo "<h4>Address:
// <input type='text'
// value='{$ltcaddr}'
// style='width: 260px;
// text-align: center;'
// readonly=readonly
// /></h4>";
echo "<p><h2>Balance: " . $addr->ltc->getbalance ( $_GET ['key'], 5 ) . "</h2><i style='font-size: 9px; padding-top:0px;margin-top:0px;'>Deposits updated after 5 confirms, 0.1 LTC reserved for fee</i></p>";
echo "<h4>Send LTC:</h4>";
echo "<form class='form-stacked' action='{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}' method='POST'><label for='address'>Address to send to</label><input type='text' id='address' name='address' style='width: 260px; text-align: center;'/>
<br /><label for='amount'>Amount of LTC to send</label><input type='text' id='amount' name='amount' style='width: 180px; text-align: right;' /> <input type='submit' class='btn info'value='SEND'/></form>";
?><br> <br>
<table style="width: 560px;">
<thead>
<tr>
<td><h4>Security:</h4></td>
</tr>
</thead>
<tr>
<td style="border: 0px;">
<form class='form-stacked'>
<label for="pass">Set A Password</label> <input type='password'
id='pass' name='pass' style='width: 180px; text-align: left;' /><br>
<label for="pass2">Retype</label> <input type='password'
id='pass2' name='pass2' style='width: 180px; text-align: left;' />
<input type='submit' class='btn info' value='SET' /> <br> <i>setting
will require you to enter it to access your vault</i>
</form>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<?
echo "<br><h4>Your last 15 transactions:</h4>";
echo "<div style=\"margin-right: 20px;\"><table class='bordered-table condensed-table zebra-striped'><tr><td>Confirms</td><td>Transaction ID</td><td>Amount</td><td>Fee</td></tr>";
$dump = array_reverse ( $addr->ltc->listtransactions ( $_GET ['key'], "15" ) );
foreach ( $dump as $herp ) {
if ($herp ['account'] == $_GET ['key']) {
echo "<tr><td>" . $herp ['confirmations'] . "</td><td><input type='text' value='" . $herp ['txid'] . "' style='margin: 0px;'/></td><td>" . $herp ['amount'] . "</td><td>" . ($herp ['fee'] ? $herp ['fee'] : 0) . "</td></tr>";
}
}
echo "</table></div>";
$addr->PDO_Conn = NULL;
} else {
echo srserr ( "INVALID KEY..." );
}
} else {
echo srserr ( "Why are you on this page? You haven't even set a key..." );
}
?>
</div>
<?
include ("templates/sidebar.php");
include ('templates/footer.php');
?>