clockwerk-www – Blame information for rev 57

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  
55 vero 22 ?>
23  
24 <!DOCTYPE html>
25 <html>
26 <head>
27 <title>Clockwerk</title>
28 <link rel="stylesheet" href="css/gray.css" type="text/css" />
57 vero 29 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
55 vero 30 </head>
31 <body class=dark-grey>
32 <div class="center">
57 vero 33 <img src="img/clockwerk-logo.png" alt="logo">
55 vero 34 <h1><?php print gethostname(); ?></h1>
35 <hr>
36  
37 <?php
38  
39 switch((bool)$resp->is_valid) {
40 case TRUE:
41 $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim');
42 $ret = $req->admin_authenticate_user($first, $last, MD5($password), '1');
43 $rep = new SimpleXMLElement($ret);
44 foreach($rep->params->param->value->struct->member as $member) {
45 switch($member->name) {
46 case "success":
47 switch((bool)$member->value->boolean) {
48 case TRUE:
49 if (file_exists($file)) {
50 chmod($file, 0644);
51 $req->admin_console_command('load iar -m '.$first. ' '.$last.' / '.$file);
52 chmod($file, 0600);
53 echo '<p>IAR uploaded successfully.</p>';
54 }
55 goto last;
56 default:
57 echo '<p>Sorry, wrong password.</p>';
58 goto last;
59 }
60 break;
61 }
62 }
63 default:
64 echo '<p>Sorry, incorrect CAPTCHA. Please try again.</p>';
47 eva 65 }
66  
55 vero 67 last:
68  
69 ?>
70 <p>
71 <a class="button" href="welcome.php">Main Page</a>
72 </p>
73 </div>
74 </body>
75 </html>
76