-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsetprimary.php
More file actions
executable file
·40 lines (32 loc) · 978 Bytes
/
setprimary.php
File metadata and controls
executable file
·40 lines (32 loc) · 978 Bytes
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
<?php
include ("header.php");
include ("pass.php");
$primaryLocation = "/home/stakebox/UI/primary".$currentWallet."address.php";
function changePrimary(){
global $primaryLocation;
global $newPrimary;
if(!file_exists("$primaryLocation")){
$file = fopen("$primaryLocation","w");
fwrite($file,"");
fclose($file);
}
if (is_readable($primaryLocation) == FALSE)
die ("The primary address file must be writable.") ;
// Open the file and erase the contents if any
$fp = fopen($primaryLocation, "w");
// Write the data to the file
// CODE INJECTION WARNING!
fwrite($fp, "<?php\n\$primary='$newPrimary';\n?>");
// Close the file
fclose($fp);
echo '<h4><a><p><b>Your main wallet address has been changed.</p></b></a></h4>' ;
}
if($_POST['address'] != ""){
$newPrimary = $_POST['address'];
changePrimary();
print_r('You have set the main wallet address to ');
print_r($_POST['address']);
}
?>
</div>
<?php include ("footer.php");?>