clockwerk-www – Blame information for rev 44

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 eva 1 <?php
2  
44 vero 3 ///////////////////////////////////////////////////////////////////////////
4 // Copyright (C) Wizardry and Steamworks 2014 - License: MIT //
5 ///////////////////////////////////////////////////////////////////////////
1 eva 6  
44 vero 7 require_once 'lib/recaptchalib.php';
8 require_once 'lib/wasRemoteAdmin.php';
9  
10 define('RECAPTCHA_PRIVATE_KEY', '6Lcz9ukSAAAAAC3u90rcOIdnNnaK_JgMjrOsSzZr');
1 eva 11  
44 vero 12 $first = $_POST["first"];
13 $last = $_POST["last"];
14 $password = $_POST["password"];
1 eva 15  
44 vero 16 $resp=recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY,
17 $_SERVER["REMOTE_ADDR"],
18 $_POST["recaptcha_challenge_field"],
19 $_POST["recaptcha_response_field"]);
1 eva 20  
44 vero 21 if($resp->is_valid) {
22 $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim');
23 $ret = $req->admin_authenticate_user($first, $last, MD5($password), '1');
24 $rep = new SimpleXMLElement($ret);
25 foreach($rep->params->param->value->struct->member as $member) {
26 if($member->name == "success" && $member->value->boolean == "0") {
27 echo 'Sorry, wrong password.';
1 eva 28 exit;
29 }
30 }
44 vero 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);
42 exit;
43 }
44 }
1 eva 45  
44 vero 46 echo '<p>Sorry, incorrect CAPTCHA. Please try again.</p>';
1 eva 47