clockwerk-www – Diff between revs 53 and 55
?pathlinks?
Rev 53 | Rev 55 | |||
---|---|---|---|---|
Line 17... | Line 17... | |||
17 | $resp = recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, |
17 | $resp = recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, |
|
18 | $_SERVER["REMOTE_ADDR"], |
18 | $_SERVER["REMOTE_ADDR"], |
|
19 | $_POST["recaptcha_challenge_field"], |
19 | $_POST["recaptcha_challenge_field"], |
|
20 | $_POST["recaptcha_response_field"]); |
20 | $_POST["recaptcha_response_field"]); |
|
Line -... | Line 21... | |||
- | 21 | |
||
- | 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 |
||
21 | |
37 | |
|
- | 38 | switch((bool)$resp->is_valid) { |
||
22 | if ($resp->is_valid) { |
39 | case TRUE: |
|
23 | $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); |
40 | $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); |
|
24 | $ret = $req->admin_authenticate_user($first, $last, MD5($password), '1'); |
41 | $ret = $req->admin_authenticate_user($first, $last, MD5($password), '1'); |
|
25 | $rep = new SimpleXMLElement($ret); |
42 | $rep = new SimpleXMLElement($ret); |
|
- | 43 | foreach($rep->params->param->value->struct->member as $member) { |
||
- | 44 | switch($member->name) { |
||
26 | foreach($rep->params->param->value->struct->member as $member) { |
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; |
||
27 | if ($member->name == "success" && $member->value->boolean == "0") { |
55 | default: |
|
- | 56 | echo '<p>Sorry, wrong password.</p>'; |
||
- | 57 | goto last; |
||
- | 58 | } |
||
28 | echo 'Sorry, wrong password.'; |
59 | break; |
|
29 | exit; |
60 | } |
|
- | 61 | } |
||
- | 62 | default: |
||
30 | } |
63 | echo '<p>Sorry, incorrect CAPTCHA. Please try again.</p>'; |
|
31 | } |
- | ||
32 | if (file_exists($file)) { |
- | ||
33 | chmod($file, 0644); |
- | ||
34 | $req->admin_console_command('load iar '.$file. ' '.$last.' / '.$file); |
- | ||
35 | chmod($file, 0600); |
- | ||
36 | header('Location: welcome.php'); |
- | ||
37 | exit; |
- | ||
38 | } |
- | ||
Line -... | Line 64... | |||
- | 64 | } |
||
- | 65 | |
||
- | 66 | last: |
||
- | 67 | |
||
39 | } |
68 | ?> |
|
- | 69 | <p> |
||
- | 70 | <a class="button" href="welcome.php">Main Page</a> |
||
- | 71 | </p> |
||
- | 72 | </div> |
||
- | 73 | </body> |