clockwerk-www – Blame information for rev 5
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | eva | 1 | <?php |
2 | |||
3 | require_once 'lib/recaptchalib.php'; |
||
4 | require_once 'lib/wasRemoteAdmin.php'; |
||
5 | |||
6 | define('RECAPTCHA_PRIVATE_KEY', '6Lcz9ukSAAAAAC3u90rcOIdnNnaK_JgMjrOsSzZr'); |
||
7 | |||
8 | $first = $_POST["first"]; |
||
9 | $last = $_POST["last"]; |
||
10 | $password = $_POST["password"]; |
||
11 | |||
12 | $resp=recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, |
||
13 | $_SERVER["REMOTE_ADDR"], |
||
14 | $_POST["recaptcha_challenge_field"], |
||
15 | $_POST["recaptcha_response_field"]); |
||
16 | |||
17 | if($resp->is_valid) { |
||
18 | $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); |
||
19 | $ret = $req->admin_authenticate_user($first, $last, MD5($password), '1'); |
||
20 | $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; |
||
41 | } |
||
42 | } |
||
43 | exit; |
||
44 | } |
||
45 | } |
||
46 | |||
47 | echo '<p>Sorry, incorrect captcha. Please try again.</p>'; |
||
48 |