forked from elmadev/elmastats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstate.php
31 lines (29 loc) · 865 Bytes
/
state.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
<?php
/*State.dat recoverer
Parameters:
u - username
p - password hash
*/
include("func.php");
//Load users
$users = array(array());
$files = array();
$handle = opendir("usersz/");
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") $users[$file] = loadUser($file);
}
closedir($handle);
if ($users[$_GET["u"]]["nick"] != "") {
if ($users[$_GET["u"]]["pwd"] == $_GET["p"]) {
if (file_exists("statefilesz/" . $_GET["u"] . ".dat")) {
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"" . $_GET["u"] . ".dat\"");
$file = file_get_contents("statefilesz/" . $_GET["u"] . ".dat");
echo($file);
}
} else {
header("Content-Type: text/plain");
echo("wrong password, nab");
}
}
?>