You've already forked Atomcms-edit
Low priority fixes: debug comments, Fortify cleanup, badge cost setting, profile query merge, User model fixes, VPN constructor cleanup, PayPal POST, PII removal, Dutch→English translations, duplicate rank check, CHANGELOG
This commit is contained in:
@@ -317,6 +317,10 @@ class HotelApiController extends Controller
|
||||
|
||||
$user = $request->user();
|
||||
|
||||
if ($package->give_rank && $user->rank >= $package->give_rank) {
|
||||
return response()->json(['error' => 'You already have this or a higher rank'], 400);
|
||||
}
|
||||
|
||||
$cost = $package->costs;
|
||||
|
||||
if ($user->credits < $cost) {
|
||||
|
||||
@@ -12,7 +12,7 @@ class BadgeController extends Controller
|
||||
{
|
||||
public function show(): View
|
||||
{
|
||||
$cost = 150;
|
||||
$cost = (int) setting('badge_cost', 150);
|
||||
$currencyType = 'credits';
|
||||
$folderError = false;
|
||||
$errorMessage = '';
|
||||
@@ -60,7 +60,7 @@ class BadgeController extends Controller
|
||||
return redirect()->route('login')->with('error', 'You must be logged in to purchase badges.');
|
||||
}
|
||||
|
||||
$cost = 150;
|
||||
$cost = (int) setting('badge_cost', 150);
|
||||
|
||||
if (property_exists($user, 'credits') && $user->credits !== null && $user->credits < $cost) {
|
||||
return redirect()->back()->with('error', 'You don\'t have enough credits to purchase a badge.');
|
||||
|
||||
@@ -20,8 +20,10 @@ class ProfileController extends Controller
|
||||
'badges',
|
||||
]);
|
||||
|
||||
$showStats = (bool) (WebsiteSetting::where('key', 'profile_show_stats')->first()?->value ?? '1');
|
||||
$showOnline = (bool) (WebsiteSetting::where('key', 'profile_show_online_status')->first()?->value ?? '1');
|
||||
$settings = WebsiteSetting::whereIn('key', ['profile_show_stats', 'profile_show_online_status'])
|
||||
->pluck('value', 'key');
|
||||
$showStats = (bool) ($settings['profile_show_stats'] ?? '1');
|
||||
$showOnline = (bool) ($settings['profile_show_online_status'] ?? '1');
|
||||
|
||||
return view('user.profile', [
|
||||
'user' => $user,
|
||||
|
||||
@@ -17,7 +17,7 @@ class RadioApiKey
|
||||
|
||||
if (empty($key)) {
|
||||
return response()->json([
|
||||
'error' => 'API key is verplicht. Gebruik Authorization: Bearer <key> of ?api_key=<key>',
|
||||
'error' => 'API key is required. Use Authorization: Bearer <key> or ?api_key=<key>',
|
||||
], 401);
|
||||
}
|
||||
|
||||
@@ -25,19 +25,19 @@ class RadioApiKey
|
||||
|
||||
if (! $apiKey) {
|
||||
return response()->json([
|
||||
'error' => 'API key is ongeldig of verlopen',
|
||||
'error' => 'API key is invalid or expired',
|
||||
], 401);
|
||||
}
|
||||
|
||||
if (! $apiKey->isAllowedIp($request->ip())) {
|
||||
return response()->json([
|
||||
'error' => 'IP-adres niet toegestaan voor deze API key',
|
||||
'error' => 'IP address not allowed for this API key',
|
||||
], 403);
|
||||
}
|
||||
|
||||
if (! $apiKey->hasPermission($permission)) {
|
||||
return response()->json([
|
||||
'error' => 'Geen toestemming voor deze actie',
|
||||
'error' => 'No permission for this action',
|
||||
], 403);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class VPNCheckerMiddleware
|
||||
return $this->denyAccess($request);
|
||||
}
|
||||
|
||||
$ipService = new IpLookupService('');
|
||||
$ipService = new IpLookupService;
|
||||
|
||||
$countryInfo = $ipService->getCountryInfo($userIp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user