clockwerk-www – Blame information for rev 55

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