opensim-www – Diff between revs 10 and 14
?pathlinks?
Rev 10 | Rev 14 | |||
---|---|---|---|---|
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> |
13 | <body> |
|
14 | <div> |
14 | <div> |
|
15 | <img src="img/spectacledowl-logo.png"> |
15 | <img src="img/spectacledowl-logo.png"> |
|
16 | <p> |
16 | <p> |
|
17 | <?php |
17 | <?php |
|
18 | |
18 | |
|
19 | $first = $_POST["first"]; |
19 | $first = $_POST["first"]; |
|
20 | $last = $_POST["last"]; |
20 | $last = $_POST["last"]; |
|
21 | $password = $_POST["password"]; |
21 | $password = $_POST["password"]; |
|
22 | $email = $_POST["email"]; |
22 | $email = $_POST["email"]; |
|
23 | |
23 | |
|
24 | $resp=recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, |
24 | $resp=recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, |
|
25 | $_SERVER["REMOTE_ADDR"], |
25 | $_SERVER["REMOTE_ADDR"], |
|
26 | $_POST["recaptcha_challenge_field"], |
26 | $_POST["recaptcha_challenge_field"], |
|
27 | $_POST["recaptcha_response_field"]); |
27 | $_POST["recaptcha_response_field"]); |
|
28 | |
28 | |
|
29 | if(!$resp->is_valid) { |
29 | if(!$resp->is_valid) { |
|
30 | echo '<p>Sorry, incorrect captcha. Please try again.</p>'; |
30 | echo '<p>Sorry, incorrect captcha. Please try again.</p>'; |
|
31 | } |
31 | } |
|
32 | else { |
32 | else { |
|
33 | $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); |
33 | $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); |
|
34 | $uuid = UUID::v4(); |
34 | $uuid = UUID::v4(); |
|
35 | $req->admin_console_command('create user '.$first.' '.$last.' '.$password.' '.$email.' '.$uuid); |
35 | $ret = $req->admin_create_user($first, $last, $password, '128', '128'); |
|
- | 36 | $rep = new SimpleXMLElement($ret); |
||
- | 37 | foreach($rep->params->param->value->struct->member as $member) { |
||
- | 38 | if($member->name == "success" && $member->value->boolean == "0") { |
||
- | 39 | echo '<p>Sorry, the account could not be created.</p>'; |
||
- | 40 | } |
||
- | 41 | else { |
||
36 | echo '<p>Account created successfully.</p>'; |
42 | echo '<p>Account created successfully.</p>'; |
|
37 | } |
43 | } |
|
- | 44 | } |
||
- | 45 | } |
||
38 | ?> |
46 | ?> |
|
39 | </p> |
47 | </p> |
|
40 | <p> |
48 | <p> |
|
41 | <a class="so_button" href="register.php">Create a New Account</a> |
49 | <a class="so_button" href="register.php">Create a New Account</a> |
|
42 | <a class="so_button" href="welcome.php">Cancel</a> |
50 | <a class="so_button" href="welcome.php">Cancel</a> |
|
43 | </p> |
51 | </p> |
|
44 | </div> |
52 | </div> |
|
45 | </div> |
53 | </div> |
|
46 | </body> |
54 | </body> |
|
47 | </html> |
55 | </html> |
|
48 | |
56 | |