clockwerk-www – Diff between revs 39 and 40

Subversion Repositories:
Rev:
Only display areas with differencesIgnore whitespace
Rev 39 Rev 40
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> 16 <h1><?php print gethostname(); ?></h1>
17 <hr> 17 <hr>
18 <p> 18 <p>
19 <?php 19 <?php
20 20
21 $first = $_POST["first"]; 21 $first = $_POST["first"];
22 $last = $_POST["last"]; 22 $last = $_POST["last"];
23 $password = $_POST["password"]; 23 $password = $_POST["password"];
24 $email = $_POST["email"]; 24 $email = $_POST["email"];
25   25  
26 $resp=recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, 26 $resp=recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY,
27 $_SERVER["REMOTE_ADDR"], 27 $_SERVER["REMOTE_ADDR"],
28 $_POST["recaptcha_challenge_field"], 28 $_POST["recaptcha_challenge_field"],
29 $_POST["recaptcha_response_field"]); 29 $_POST["recaptcha_response_field"]);
30   30  
31 if(!$resp->is_valid) { 31 if(!$resp->is_valid) {
32 echo '<p>Sorry, incorrect captcha. Please try again.</p>'; 32 echo '<p>Sorry, incorrect captcha. Please try again.</p>';
33 } 33 }
34 else { 34 else {
35 $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); 35 $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim');
36 $uuid = UUID::v4(); 36 $uuid = UUID::v4();
37 $ret = $req->admin_create_user($first, $last, $password, '128', '128'); 37 $ret = $req->admin_create_user($first, $last, $password, '128', '128');
38 $rep = new SimpleXMLElement($ret); 38 $rep = new SimpleXMLElement($ret);
39 foreach($rep->params->param->value->struct->member as $member) { 39 foreach($rep->params->param->value->struct->member as $member) {
40 if($member->name == "success" && $member->value->boolean == "0") { 40 if($member->name == "success" && $member->value->boolean == "0") {
41 echo '<p>Sorry, the account could not be created.</p>'; 41 echo '<p>Sorry, the account could not be created.</p>';
42 break; 42 break;
43 } 43 }
44 else { 44 else {
45 echo '<p>Account created successfully.</p>'; 45 echo '<p>Account created successfully.</p>';
46 break; 46 break;
47 } 47 }
48 } 48 }
49 } 49 }
50 ?> 50 ?>
51 </p> 51 </p>
52 <p> 52 <p>
53 <a class="button" href="register.php">Create a New Account</a> 53 <a class="button" href="register.php">Create a New Account</a>
54 <a class="button" href="welcome.php">Cancel</a> 54 <a class="button" href="welcome.php">Main Page</a>
55 </p> 55 </p>
56 </div> 56 </div>
57 </div> 57 </div>
58 </body> 58 </body>
59 </html> 59 </html>
60   60