clockwerk-www

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 46  →  ?path2? @ 47
/about.php
@@ -1,6 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Clockwerk</title>
<link rel="stylesheet" href="css/gray.css" type="text/css" />
</head>
<body class=dark-grey>
<div class="center">
<img src="img/clockwerk-logo.png">
/account.php
@@ -9,7 +9,10 @@
?>
<!DOCTYPE html>
<html>
<head>
<title>Clockwerk</title>
<link rel="stylesheet" href="css/green.css" type="text/css" />
</head>
<body class="dark-grey">
<div>
<img src="img/clockwerk-logo.png">
/applyiar.php
@@ -0,0 +1,39 @@
<?php
 
///////////////////////////////////////////////////////////////////////////
// Copyright (C) Wizardry and Steamworks 2014 - License: MIT //
///////////////////////////////////////////////////////////////////////////
 
require_once 'lib/recaptchalib.php';
require_once 'lib/wasRemoteAdmin.php';
 
define('RECAPTCHA_PRIVATE_KEY', '6Lcz9ukSAAAAAC3u90rcOIdnNnaK_JgMjrOsSzZr');
 
$first = $_POST["first"];
$last = $_POST["last"];
$file = $_FILES["file"]["tmp_name"];
$password = $_POST["password"];
 
$resp = recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
 
if ($resp->is_valid) {
$req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim');
$ret = $req->admin_authenticate_user($first, $last, MD5($password), '1');
$rep = new SimpleXMLElement($ret);
foreach($rep->params->param->value->struct->member as $member) {
if ($member->name == "success" && $member->value->boolean == "0") {
echo 'Sorry, wrong password.';
exit;
}
}
if (file_exists($file)) {
$req->admin_console_command('load iar '.$file. ' '.$last.' / '.$file);
header('Location: welcome.php');
exit;
}
}
 
echo '<p>Sorry, incorrect CAPTCHA. Please try again.</p>';
/applyoar.php
@@ -0,0 +1,66 @@
<?php
 
///////////////////////////////////////////////////////////////////////////
// Copyright (C) Wizardry and Steamworks 2014 - License: MIT //
///////////////////////////////////////////////////////////////////////////
 
// Hostname or IP of your OpenSim MySQL server.
$MYSQL_HOSTNAME='localhost';
// Username of the OpenSim MySQL user.
$MYSQL_USERNAME='opensim';
// Password of the OpenSim MySQL user.
$MYSQL_PASSWORD='***';
// Name of the OpenSim database on the MySQL server.
$MYSQL_DATABASE='opensim';
 
require_once 'lib/recaptchalib.php';
require_once 'lib/wasRemoteAdmin.php';
 
define('RECAPTCHA_PRIVATE_KEY', '6Lcz9ukSAAAAAC3u90rcOIdnNnaK_JgMjrOsSzZr');
 
$first = $_POST["first"];
$last = $_POST["last"];
$region = $_POST["region"];
$file = $_FILES["file"]["tmp_name"];
$password = $_POST["password"];
 
$resp = recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
 
if ($resp->is_valid) {
$req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim');
$ret = $req->admin_authenticate_user($first, $last, MD5($password), '1');
$rep = new SimpleXMLElement($ret);
foreach($rep->params->param->value->struct->member as $member) {
if ($member->name == "success" && $member->value->boolean == "0") {
echo 'Sorry, wrong password.';
exit;
}
}
try {
$mysql = new PDO('mysql:host='.$MYSQL_HOSTNAME.';dbname='.$MYSQL_DATABASE.';', $MYSQL_USERNAME, $MYSQL_PASSWORD);
$mysql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$query = $mysql->prepare("SELECT RegionName FROM regions WHERE owner_uuid=(SELECT PrincipalID FROM UserAccounts WHERE FirstName=:first AND LastName=:last)");
$query->bindParam(':first', $first);
$query->bindParam(':last', $last);
$query->execute();
}
catch(PDOException $e) {
print 'The given agent is not the owner of the region to download.';
return 1;
}
while ($result = $query->fetchObject()) {
if ($result->RegionName == $region) {
if (file_exists($file)) {
$req->admin_console_command('change region '.$region);
$req->admin_console_command('load oar '.$file);
header('Location: welcome.php');
exit;
}
}
}
}
 
echo '<p>Sorry, incorrect CAPTCHA. Please try again.</p>';
/getiar.php
@@ -1,6 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Clockwerk</title>
<link rel="stylesheet" href="css/gray.css" type="text/css" />
</head>
<body class="dark-grey">
<div>
<div class="center">
/getoar.php
@@ -1,6 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Clockwerk</title>
<link rel="stylesheet" href="css/gray.css" type="text/css" />
</head>
<body class="dark-grey">
<div>
<div class="center">
/index.php
@@ -1,8 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Clockwerk</title>
<link rel="stylesheet" href="css/gray.css" type="text/css" />
</head>
<body class="dark-grey">
 
<div class="center">
<img src="img/clockwerk-logo.png">
<h1><?php print gethostname(); ?></h1>
/register.php
@@ -1,6 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>Clockwerk</title>
<link rel="stylesheet" href="css/gray.css" type="text/css" />
</head>
<body class="dark-grey">
<div>
<div class="center">
/uploadiar.php
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<title>Clockwerk</title>
<link rel="stylesheet" href="css/gray.css" type="text/css" />
</head>
<body class="dark-grey">
<div>
<div class="center">
<img src="img/clockwerk-logo.png">
<h1><?php print gethostname(); ?></h1>
<hr>
</div>
<script type="text/javascript" src="lib/jquery.min.js"></script>
<form class="dark-grey" style="color:#000;text-shadow:none;text-align:left;max-width:480px;min-width:150px" method="post" action="applyiar.php"><div class="title"></div>
<div class="element-input" ><label class="title">Agent First Name<span class="required"></span></label><input class="large" type="text" name="first" required="required"/></div>
<div class="element-input" ><label class="title">Agent Last Name<span class="required"></span></label><input class="large" type="text" name="last" required="required"/></div>
<div class="element-file" ><label class="title">IAR File</label><label class="large" ><div class="button">Choose File</div><input type="file" class="file_input" name="file" /><div class="file_text">No file selected</div></label></div>
<div class="element-password" ><label class="title">Password<span class="required"></span></label><input class="large" type="password" name="password" value="" required="required"/></div>
<div class="element-recaptcha" ><label class="title">Captcha</label><script type="text/javascript">var RecaptchaOptions = {theme : "clean"};</script>
<script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6Lcz9ukSAAAAAPu4CYSJCjPiZeQJgG0ywy4wL_Fj&theme=clean"></script>
<noscript><iframe src="http://www.google.com/recaptcha/api/noscript?k=6Lcz9ukSAAAAAPu4CYSJCjPiZeQJgG0ywy4wL_Fj&hl=en" height="300" width="500" frameborder="0"></iframe></br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea><input type="hidden" name="recaptcha_response_field" value="manual_challenge"></noscript>
<script type="text/javascript">if (/#invalidcaptcha$/.test(window.location)) (document.getElementById("recaptcha_widget_div")).className += " error"</script></div>
 
<div class="submit">
<input type="submit" value="Upload">
<input type="button" onclick="parent.location='welcome.php'" value="Cancel">
</div>
</form>
<script type="text/javascript" src="lib/gray.js"></script>
 
</div>
</body>
</html>
/uploadoar.php
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<title>Clockwerk</title>
<link rel="stylesheet" href="css/gray.css" type="text/css" />
</head>
<body class="dark-grey">
<div>
<div class="center">
<img src="img/clockwerk-logo.png">
<h1><?php print gethostname(); ?></h1>
<hr>
</div>
<script type="text/javascript" src="lib/jquery.min.js"></script>
<form class="dark-grey" style="color:#000;text-shadow:none;text-align:left;max-width:480px;min-width:150px" method="post" action="applyoar.php"><div class="title"></div>
<div class="element-input" ><label class="title">Agent First Name<span class="required"></span></label><input class="large" type="text" name="first" required="required"/></div>
<div class="element-input" ><label class="title">Agent Last Name<span class="required"></span></label><input class="large" type="text" name="last" required="required"/></div>
<div class="element-input" ><label class="title">Region<span class="required"></span></label><input class="large" type="text" name="region" required="required"/></div>
<div class="element-file" ><label class="title">OAR File</label><label class="large" ><div class="button">Choose File</div><input type="file" class="file_input" name="file" /><div class="file_text">No file selected</div></label></div>
<div class="element-password" ><label class="title">Password<span class="required"></span></label><input class="large" type="password" name="password" value="" required="required"/></div>
<div class="element-recaptcha" ><label class="title">Captcha</label><script type="text/javascript">var RecaptchaOptions = {theme : "clean"};</script>
<script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=6Lcz9ukSAAAAAPu4CYSJCjPiZeQJgG0ywy4wL_Fj&theme=clean"></script>
<noscript><iframe src="http://www.google.com/recaptcha/api/noscript?k=6Lcz9ukSAAAAAPu4CYSJCjPiZeQJgG0ywy4wL_Fj&hl=en" height="300" width="500" frameborder="0"></iframe></br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea><input type="hidden" name="recaptcha_response_field" value="manual_challenge"></noscript>
<script type="text/javascript">if (/#invalidcaptcha$/.test(window.location)) (document.getElementById("recaptcha_widget_div")).className += " error"</script></div>
 
<div class="submit">
<input type="submit" value="Upload">
<input type="button" onclick="parent.location='welcome.php'" value="Cancel">
</div>
</form>
<script type="text/javascript" src="lib/gray.js"></script>
 
</div>
</body>
</html>
/welcome.php
@@ -1,8 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Clockwerk</title>
<link rel="stylesheet" href="css/gray.css" type="text/css" />
</head>
<body class="dark-grey">
 
<div class="center">
<img src="img/clockwerk-logo.png">
<h1><?php print gethostname(); ?></h1>