/applyoar.php |
@@ -56,30 +56,31 @@ |
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 (file_exists($file)) { |
$req->admin_console_command('change region '.$region); |
chmod($file, 0644); |
$req->admin_console_command('load oar '.$file); |
chmod($file, 0600); |
echo '<p>OAR uploaded successfully.</p>'; |
goto last; |
} |
/* } |
} */ |
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); |
$req->admin_console_command('load oar '.$file); |
chmod($file, 0600); |
echo '<p>OAR uploaded successfully.</p>'; |
goto last; |
} |
goto last; |
default: |
echo '<p>Sorry, wrong password.</p>'; |
/sendoar.php |
@@ -55,37 +55,38 @@ |
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) { */ |
$oar_path = '/var/lib/oar/'.$region.'/'.$region.'.oar'; |
if (file_exists($oar_path)) { |
header('Content-Description: File Transfer'); |
header('Content-Type: application/x-gzip-compressed'); |
header('Content-Disposition: attachment; filename='.basename($oar_path)); |
header('Content-Transfer-Encoding: binary'); |
header('Expires: 0'); |
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
header('Pragma: public'); |
header('Content-Length: '.filesize($oar_path)); |
readfile($oar_path); |
goto last; |
} |
echo '<p>Sorry, the OAR file is not available yet.</p>'; |
goto last; |
/* } |
} */ |
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'); |
header('Content-Type: application/x-gzip-compressed'); |
header('Content-Disposition: attachment; filename='.basename($oar_path)); |
header('Content-Transfer-Encoding: binary'); |
header('Expires: 0'); |
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
header('Pragma: public'); |
header('Content-Length: '.filesize($oar_path)); |
readfile($oar_path); |
goto last; |
} |
echo '<p>Sorry, the OAR file is not available yet.</p>'; |
goto last; |
} |
|
echo '<p>Sorry, incorrect CAPTCHA. Please try again.</p>'; |