clockwerk-www – Diff between revs 40 and 47

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