clockwerk-www – Diff between revs 1 and 44
?pathlinks?
Rev 1 | Rev 44 | |||
---|---|---|---|---|
Line 1... | Line 1... | |||
1 | <?php |
1 | <?php |
|
Line 2... | Line 2... | |||
2 | |
2 | |
|
3 | require_once 'lib/recaptchalib.php'; |
3 | /////////////////////////////////////////////////////////////////////////// |
|
- | 4 | // Copyright (C) Wizardry and Steamworks 2014 - License: MIT // |
||
Line -... | Line 5... | |||
- | 5 | /////////////////////////////////////////////////////////////////////////// |
||
- | 6 | |
||
- | 7 | require_once 'lib/recaptchalib.php'; |
||
4 | require_once 'lib/wasRemoteAdmin.php'; |
8 | require_once 'lib/wasRemoteAdmin.php'; |
|
Line 5... | Line 9... | |||
5 | |
9 | |
|
6 | define('RECAPTCHA_PRIVATE_KEY', '6Lcz9ukSAAAAAC3u90rcOIdnNnaK_JgMjrOsSzZr'); |
10 | define('RECAPTCHA_PRIVATE_KEY', '6Lcz9ukSAAAAAC3u90rcOIdnNnaK_JgMjrOsSzZr'); |
|
7 | |
11 | |
|
8 | $first = $_POST["first"]; |
12 | $first = $_POST["first"]; |
|
9 | $last = $_POST["last"]; |
13 | $last = $_POST["last"]; |
|
10 | $password = $_POST["password"]; |
14 | $password = $_POST["password"]; |
|
11 | |
15 | |
|
12 | $resp=recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, |
16 | $resp=recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, |
|
13 | $_SERVER["REMOTE_ADDR"], |
17 | $_SERVER["REMOTE_ADDR"], |
|
14 | $_POST["recaptcha_challenge_field"], |
18 | $_POST["recaptcha_challenge_field"], |
|
15 | $_POST["recaptcha_response_field"]); |
19 | $_POST["recaptcha_response_field"]); |
|
16 | |
20 | |
|
17 | if($resp->is_valid) { |
21 | if($resp->is_valid) { |
|
18 | $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); |
22 | $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); |
|
19 | $ret = $req->admin_authenticate_user($first, $last, MD5($password), '1'); |
23 | $ret = $req->admin_authenticate_user($first, $last, MD5($password), '1'); |
|
20 | $rep = new SimpleXMLElement($ret); |
24 | $rep = new SimpleXMLElement($ret); |
|
21 | foreach($rep->params->param->value->struct->member as $member) { |
- | ||
22 | if($member->name == "success" && $member->value->boolean == "0") { |
- | ||
23 | echo 'Sorry, wrong password.'; |
- | ||
24 | exit; |
- | ||
25 | } |
- | ||
26 | } |
- | ||
27 | $iar_path = '/var/lib/iar/'.$first.'_'.$last.'/'.$first.'_'.$last.'.iar'; |
- | ||
28 | if(file_exists($iar_path)) { |
- | ||
29 | if(false !== ($handler = fopen($iar_path, 'r'))) { |
- | ||
30 | header('Content-Description: File Transfer'); |
- | ||
31 | header('Content-Type: application/x-gzip-compressed'); |
- | ||
32 | header('Content-Disposition: attachment; filename='.basename($iar_path)); |
- | ||
33 | header('Content-Transfer-Encoding: binary'); |
- | ||
34 | header('Expires: 0'); |
- | ||
35 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
- | ||
36 | header('Pragma: public'); |
- | ||
37 | header('Content-Length: '.filesize($iar_path)); |
- | ||
38 | |
- | ||
39 | while(false !== ($chunk = fread($handler, 4096))) { |
- | ||
40 | echo $chunk; |
25 | foreach($rep->params->param->value->struct->member as $member) { |
|
41 | } |
26 | if($member->name == "success" && $member->value->boolean == "0") { |
|
42 | } |
27 | echo 'Sorry, wrong password.'; |
|
- | 28 | exit; |
||
- | 29 | } |
||
- | 30 | } |
||
- | 31 | $iar_path = '/var/lib/iar/'.$first.'_'.$last.'/'.$first.'_'.$last.'.iar'; |
||
- | 32 | if (file_exists($iar_path)) { |
||
- | 33 | header('Content-Description: File Transfer'); |
||
- | 34 | header('Content-Type: application/x-gzip-compressed'); |
||
- | 35 | header('Content-Disposition: attachment; filename='.basename($iar_path)); |
||
- | 36 | header('Content-Transfer-Encoding: binary'); |
||
- | 37 | header('Expires: 0'); |
||
- | 38 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
||
- | 39 | header('Pragma: public'); |
||
- | 40 | header('Content-Length: '.filesize($iar_path)); |
||
- | 41 | readfile($iar_path); |
||
Line 43... | Line 42... | |||
43 | exit; |
42 | exit; |