clockwerk-www
/applyoar.php |
@@ -56,20 +56,23 @@ |
case "success": |
switch((bool)$member->value->boolean) { |
case TRUE: |
/* try { |
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 Name FROM land WHERE OwnerUUID=(SELECT PrincipalID FROM UserAccounts WHERE FirstName=:first AND LastName=:last)"); |
$query = $mysql->prepare("SELECT UserLevel FROM UserAccounts WHERE FirstName=:first AND LastName=:last"); |
$query->bindParam(':first', $first); |
$query->bindParam(':last', $last); |
$query->execute(); |
$result=$query->fetch(PDO::FETCH_ASSOC); |
} |
catch(PDOException $e) { |
print '<p>Sorry, the authenticated agent is not the owner of the region to download.</p>'; |
print '<p>Sorry, a database error occurred.</p>'; |
goto last; |
} |
while ($result = $query->fetchObject()) { |
if ($result->RegionName == $region) { */ |
if($result['UserLevel'] < 100) { |
print '<p>Sorry, the authenticated agent does not have the necessary level to apply OARs.</p>'; |
goto last; |
} |
if (file_exists($file)) { |
$req->admin_console_command('change region '.$region); |
chmod($file, 0644); |
@@ -78,8 +81,6 @@ |
echo '<p>OAR uploaded successfully.</p>'; |
goto last; |
} |
/* } |
} */ |
goto last; |
default: |
echo '<p>Sorry, wrong password.</p>'; |
/sendoar.php |
@@ -55,20 +55,23 @@ |
goto last; |
} |
} |
/* try { |
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 Name FROM land WHERE OwnerUUID=(SELECT PrincipalID FROM UserAccounts WHERE FirstName=:first AND LastName=:last)"); |
$query = $mysql->prepare("SELECT UserLevel FROM UserAccounts WHERE FirstName=:first AND LastName=:last"); |
$query->bindParam(':first', $first); |
$query->bindParam(':last', $last); |
$query->execute(); |
$result=$query->fetch(PDO::FETCH_ASSOC); |
} |
catch(PDOException $e) { |
print 'The given agent is not the owner of the region to download.'; |
return 1; |
print '<p>Sorry, a database error occurred.</p>'; |
goto last; |
} |
while ($result = $query->fetchObject()) { |
if ($result->RegionName == $region) { */ |
if($result['UserLevel'] < 100) { |
print '<p>Sorry, the authenticated agent does not have the necessary level to download OARs.</p>'; |
goto last; |
} |
$oar_path = '/var/lib/oar/'.$region.'/'.$region.'.oar'; |
if (file_exists($oar_path)) { |
header('Content-Description: File Transfer'); |
@@ -84,8 +87,6 @@ |
} |
echo '<p>Sorry, the OAR file is not available yet.</p>'; |
goto last; |
/* } |
} */ |
} |
|
echo '<p>Sorry, incorrect CAPTCHA. Please try again.</p>'; |