clockwerk-www – Diff between revs 17 and 39
?pathlinks?
Rev 17 | Rev 39 | |||
---|---|---|---|---|
1 | <?php |
1 | <?php |
|
2 | |
2 | |
|
3 | require_once 'lib/recaptchalib.php'; |
3 | require_once 'lib/recaptchalib.php'; |
|
4 | require_once 'lib/wasRemoteAdmin.php'; |
4 | require_once 'lib/wasRemoteAdmin.php'; |
|
5 | require_once 'lib/uuid.php'; |
5 | require_once 'lib/uuid.php'; |
|
6 | |
6 | |
|
7 | define('RECAPTCHA_PRIVATE_KEY', '6Lcz9ukSAAAAAC3u90rcOIdnNnaK_JgMjrOsSzZr'); |
7 | define('RECAPTCHA_PRIVATE_KEY', '6Lcz9ukSAAAAAC3u90rcOIdnNnaK_JgMjrOsSzZr'); |
|
8 | |
8 | |
|
9 | ?> |
9 | ?> |
|
10 | <!DOCTYPE html> |
10 | <!DOCTYPE html> |
|
11 | <html> |
11 | <html> |
|
12 | <link rel="stylesheet" href="css/green.css" type="text/css" /> |
12 | <link rel="stylesheet" href="css/green.css" type="text/css" /> |
|
13 | <body class="dark-grey"> |
13 | <body class="dark-grey"> |
|
14 | <div> |
14 | <div> |
|
15 | <img src="img/clockwerk-logo.png"> |
15 | <img src="img/clockwerk-logo.png"> |
|
- | 16 | <h1><?php print gethostname(); ?></h1> |
||
- | 17 | <hr> |
||
16 | <p> |
18 | <p> |
|
17 | <?php |
19 | <?php |
|
18 | |
20 | |
|
19 | $first = $_POST["first"]; |
21 | $first = $_POST["first"]; |
|
20 | $last = $_POST["last"]; |
22 | $last = $_POST["last"]; |
|
21 | $password = $_POST["password"]; |
23 | $password = $_POST["password"]; |
|
22 | $email = $_POST["email"]; |
24 | $email = $_POST["email"]; |
|
23 | |
25 | |
|
24 | $resp=recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, |
26 | $resp=recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, |
|
25 | $_SERVER["REMOTE_ADDR"], |
27 | $_SERVER["REMOTE_ADDR"], |
|
26 | $_POST["recaptcha_challenge_field"], |
28 | $_POST["recaptcha_challenge_field"], |
|
27 | $_POST["recaptcha_response_field"]); |
29 | $_POST["recaptcha_response_field"]); |
|
28 | |
30 | |
|
29 | if(!$resp->is_valid) { |
31 | if(!$resp->is_valid) { |
|
30 | echo '<p>Sorry, incorrect captcha. Please try again.</p>'; |
32 | echo '<p>Sorry, incorrect captcha. Please try again.</p>'; |
|
31 | } |
33 | } |
|
32 | else { |
34 | else { |
|
33 | $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); |
35 | $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); |
|
34 | $uuid = UUID::v4(); |
36 | $uuid = UUID::v4(); |
|
35 | $ret = $req->admin_create_user($first, $last, $password, '128', '128'); |
37 | $ret = $req->admin_create_user($first, $last, $password, '128', '128'); |
|
36 | $rep = new SimpleXMLElement($ret); |
38 | $rep = new SimpleXMLElement($ret); |
|
37 | foreach($rep->params->param->value->struct->member as $member) { |
39 | foreach($rep->params->param->value->struct->member as $member) { |
|
38 | if($member->name == "success" && $member->value->boolean == "0") { |
40 | if($member->name == "success" && $member->value->boolean == "0") { |
|
39 | echo '<p>Sorry, the account could not be created.</p>'; |
41 | echo '<p>Sorry, the account could not be created.</p>'; |
|
40 | break; |
42 | break; |
|
41 | } |
43 | } |
|
42 | else { |
44 | else { |
|
43 | echo '<p>Account created successfully.</p>'; |
45 | echo '<p>Account created successfully.</p>'; |
|
44 | break; |
46 | break; |
|
45 | } |
47 | } |
|
46 | } |
48 | } |
|
47 | } |
49 | } |
|
48 | ?> |
50 | ?> |
|
49 | </p> |
51 | </p> |
|
50 | <p> |
52 | <p> |
|
51 | <a class="button" href="register.php">Create a New Account</a> |
53 | <a class="button" href="register.php">Create a New Account</a> |
|
52 | <a class="button" href="welcome.php">Cancel</a> |
54 | <a class="button" href="welcome.php">Cancel</a> |
|
53 | </p> |
55 | </p> |
|
54 | </div> |
56 | </div> |
|
55 | </div> |
57 | </div> |
|
56 | </body> |
58 | </body> |
|
57 | </html> |
59 | </html> |
|
58 | |
60 | |