clockwerk-www – Blame information for rev 61
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
61 | vero | 1 | <?php |
2 | |||
3 | require_once 'lib/recaptchalib.php'; |
||
4 | require_once 'lib/wasRemoteAdmin.php'; |
||
5 | require_once 'lib/uuid.php'; |
||
6 | |||
7 | define('RECAPTCHA_PRIVATE_KEY', '6Lcz9ukSAAAAAC3u90rcOIdnNnaK_JgMjrOsSzZr'); |
||
8 | |||
9 | ?> |
||
10 | <!DOCTYPE html> |
||
11 | <html> |
||
12 | <head> |
||
13 | <title>Clockwerk</title> |
||
14 | <link rel="stylesheet" href="css/green.css" type="text/css" /> |
||
15 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
||
16 | </head> |
||
17 | <body class="dark-grey"> |
||
18 | <div> |
||
19 | <img src="img/clockwerk-logo.png" alt="logo"> |
||
20 | <h1><?php print gethostname(); ?></h1> |
||
21 | <hr> |
||
22 | <p> |
||
23 | <?php |
||
24 | |||
25 | $first = $_POST["first"]; |
||
26 | $last = $_POST["last"]; |
||
27 | $oldpassword = $_POST["oldpassword"]; |
||
28 | $newpassword = $_POST["newpassword"]; |
||
29 | |||
30 | $resp=recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, |
||
31 | $_SERVER["REMOTE_ADDR"], |
||
32 | $_POST["recaptcha_challenge_field"], |
||
33 | $_POST["recaptcha_response_field"]); |
||
34 | |||
35 | switch((bool)$resp->is_valid) { |
||
36 | case TRUE: |
||
37 | $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); |
||
38 | $ret = $req->admin_authenticate_user($first, $last, MD5($oldpassword), '1'); |
||
39 | $rep = new SimpleXMLElement($ret); |
||
40 | foreach($rep->params->param->value->struct->member as $member) { |
||
41 | switch($member->name) { |
||
42 | case "success": |
||
43 | switch((bool)$member->value->boolean) { |
||
44 | case TRUE: |
||
45 | $ret = $req->admin_update_user($first, $last, $newpassword, '128', '128'); |
||
46 | $rep = new SimpleXMLElement($ret); |
||
47 | foreach($rep->params->param->value->struct->member as $member) { |
||
48 | switch($member->name) { |
||
49 | case "success": |
||
50 | switch(boolval($member->value->boolean)) { |
||
51 | case TRUE: |
||
52 | echo '<p>Account updated successfully.</p>'; |
||
53 | goto last; |
||
54 | default: |
||
55 | echo '<p>Sorry, the account could not be updated at this time.</p>'; |
||
56 | goto last; |
||
57 | } |
||
58 | break; |
||
59 | } |
||
60 | } |
||
61 | goto last; |
||
62 | default: |
||
63 | echo '<p>Sorry, wrong password.</p>'; |
||
64 | goto last; |
||
65 | } |
||
66 | break; |
||
67 | } |
||
68 | } |
||
69 | default: |
||
70 | echo '<p>Sorry, incorrect CAPTCHA. Please try again.</p>'; |
||
71 | } |
||
72 | |||
73 | last: |
||
74 | |||
75 | ?> |
||
76 | </p> |
||
77 | <p> |
||
78 | <a class="button" href="reset.php">Reset Password</a> |
||
79 | <a class="button" href="welcome.php">Main Page</a> |
||
80 | </p> |
||
81 | </div> |
||
82 | </div> |
||
83 | </body> |
||
84 | </html> |