opensim-www – Blame information for rev 5

Subversion Repositories:
Rev:
Rev Author Line No. Line
5 eva 1 <?php
2  
3 require_once 'lib/recaptchalib.php';
4 require_once 'lib/kos_authenticate.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 KOS_Authenticate('http://127.0.0.1:10000', 'opensim');
19 $ret = $req->authenticate($first, $last, MD5($password), '1');
20 $iar_path = '/var/lib/iar/'.$first.'_'.$last.'/'.$first.'_'.$last.'.iar';
21 if(file_exists($iar_path)) {
22 if(false !== ($handler = fopen($iar_path, 'r'))) {
23 header('Content-Description: File Transfer');
24 header('Content-Type: application/x-gzip-compressed');
25 header('Content-Disposition: attachment; filename='.basename($iar_path));
26 header('Content-Transfer-Encoding: binary');
27 header('Expires: 0');
28 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
29 header('Pragma: public');
30 header('Content-Length: '.filesize($iar_path));
31  
32 while(false !== ($chunk = fread($handler, 4096))) {
33 echo $chunk;
34 }
35 }
36 exit;
37 }
38 }
39  
40 echo '<p>Sorry, incorrect captcha. Please try again.</p>';