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