prepare("SELECT * FROM websettings"); $websettings->execute(); $websettings = $websettings->fetch(PDO::FETCH_OBJ); if ($id) { $iteminfo = getAssetInfo($id); if($iteminfo !== FALSE) //asset id exists in alphaland db { if (isAssetApproved($id) and !isAssetModerated($id)) //if the asset is approved and not moderated { if (WebContextManager::VerifyAccessKeyHeader()) //immediately allow full access { ReturnAsset($iteminfo->Hash, $iteminfo->AssetTypeId); } else { if(isLoggedIn()) { if ($iteminfo->IsPublicDomain == true or $iteminfo->CreatorId == $user->id or $user->IsOwner()) { ReturnAsset($iteminfo->Hash, $iteminfo->AssetTypeId); } } } } die(http_response_code(401)); //unauthorized } else //fallback to roblox assets (compatibility)(will break eventually, need a better solution)(instruct players to use roblox asset url for compatibility?) roblox.com/asset/?id= { WebContextManager::Redirect("https://assetdelivery.roblox.com/v1/asset/?id=" . $id . "&version=" . $assetversion); } }