clockwerk-www – Blame information for rev 67
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | eva | 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> |
||
47 | eva | 12 | <head> |
13 | <title>Clockwerk</title> |
||
64 | vero | 14 | <link rel="stylesheet" href="css/grey.css" type="text/css" /> |
57 | vero | 15 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
47 | eva | 16 | </head> |
17 | vero | 17 | <body class="dark-grey"> |
1 | eva | 18 | <div> |
57 | vero | 19 | <img src="img/clockwerk-logo.png" alt="logo"> |
39 | zed | 20 | <h1><?php print gethostname(); ?></h1> |
21 | <hr> |
||
1 | eva | 22 | <p> |
23 | <?php |
||
24 | |||
25 | $first = $_POST["first"]; |
||
26 | $last = $_POST["last"]; |
||
27 | $password = $_POST["password"]; |
||
28 | $email = $_POST["email"]; |
||
29 | |||
30 | $resp=recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, |
||
31 | $_SERVER["REMOTE_ADDR"], |
||
32 | $_POST["recaptcha_challenge_field"], |
||
33 | $_POST["recaptcha_response_field"]); |
||
55 | vero | 34 | |
35 | switch((bool)$resp->is_valid) { |
||
36 | case TRUE: |
||
37 | $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); |
||
38 | $uuid = UUID::v4(); |
||
39 | $ret = $req->admin_create_user($first, $last, $password, '128', '128'); |
||
40 | $rep = new SimpleXMLElement($ret); |
||
41 | foreach($rep->params->param->value->struct->member as $member) { |
||
42 | switch($member->name) { |
||
43 | case "success": |
||
64 | vero | 44 | switch((bool)$member->value->boolean) { |
55 | vero | 45 | case TRUE: |
46 | echo '<p>Account created successfully.</p>'; |
||
47 | goto last; |
||
48 | default: |
||
49 | echo '<p>Sorry, the account could not be created.</p>'; |
||
50 | goto last; |
||
51 | } |
||
52 | break; |
||
53 | } |
||
1 | eva | 54 | } |
55 | vero | 55 | break; |
56 | default: |
||
57 | echo '<p>Sorry, incorrect captcha. Please try again.</p>'; |
||
1 | eva | 58 | } |
55 | vero | 59 | |
60 | last: |
||
61 | |||
1 | eva | 62 | ?> |
67 | vero | 63 | |
64 | <form class="dark-grey"> |
||
65 | <input type="button" onclick="parent.location='register.php'" value="Create a New Account"> |
||
66 | <input type="button" onclick="parent.location='welcome.php'" value="Main Page"> |
||
67 | </form> |
||
1 | eva | 68 | </div> |
69 | </body> |
||
70 | </html> |