clockwerk-www – Blame information for rev 47

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