forked from ConcealNetwork/conceal-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunds.php
24 lines (22 loc) · 866 Bytes
/
funds.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
<?php
define("REASON", "reason");
define("SUCCESS", "success");
if (hash('ripemd160', $_POST['uploadKey']) == "01855f7552595d8ab056318471ac5e0a0421a906")
{
if (!unlink('funds.dat.old')) {
echo json_encode(array(SUCCESS => false, REASON => 'Failed to delete the old funds.dat!'));
} else {
if (!rename('funds.dat', 'funds.dat.old')) {
echo json_encode(array(SUCCESS => false, REASON => 'Failed to rename the funds.dat!'));
} else {
if (file_put_contents('funds.dat', $_POST['fundsData']) === false) {
echo json_encode(array(SUCCESS => false, REASON => 'Failed to write the new funds.dat!'));
} else {
echo json_encode(array(SUCCESS => true));
}
}
}
} else {
echo json_encode(array(SUCCESS => false, REASON => 'The upload key is wrong or not specified!'));
}
?>