clockwerk-www
/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>'; |