opensim-www – Diff between revs 14 and 15

Subversion Repositories:
Rev:
Only display areas with differencesRegard whitespace
Rev 14 Rev 15
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 $ret = $req->admin_create_user($first, $last, $password, '128', '128'); 35 $ret = $req->admin_create_user($first, $last, $password, '128', '128');
36 $rep = new SimpleXMLElement($ret); 36 $rep = new SimpleXMLElement($ret);
37 foreach($rep->params->param->value->struct->member as $member) { 37 foreach($rep->params->param->value->struct->member as $member) {
38 if($member->name == "success" && $member->value->boolean == "0") { 38 if($member->name == "success" && $member->value->boolean == "0") {
39 echo '<p>Sorry, the account could not be created.</p>'; 39 echo '<p>Sorry, the account could not be created.</p>';
-   40 break;
40 } 41 }
41 else { 42 else {
42 echo '<p>Account created successfully.</p>'; 43 echo '<p>Account created successfully.</p>';
-   44 break;
43 } 45 }
44 } 46 }
45 } 47 }
46 ?> 48 ?>
47 </p> 49 </p>
48 <p> 50 <p>
49 <a class="so_button" href="register.php">Create a New Account</a> 51 <a class="so_button" href="register.php">Create a New Account</a>
50 <a class="so_button" href="welcome.php">Cancel</a> 52 <a class="so_button" href="welcome.php">Cancel</a>
51 </p> 53 </p>
52 </div> 54 </div>
53 </div> 55 </div>
54 </body> 56 </body>
55 </html> 57 </html>
56   58