Update AdminSettingsController, add user filter max limit settings

This commit is contained in:
Daniel Supernault 2024-03-16 05:13:06 -06:00
parent 5162c0704a
commit ac1f074889
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -725,16 +725,25 @@ trait AdminSettingsController
$this->validate($request, [ $this->validate($request, [
'require_email_verification' => 'required', 'require_email_verification' => 'required',
'enforce_account_limit' => 'required', 'enforce_account_limit' => 'required',
'admin_autofollow' => 'required' 'admin_autofollow' => 'required',
'max_user_blocks' => 'required',
'max_user_mutes' => 'required',
'max_domain_blocks' => 'required',
]); ]);
ConfigCacheService::put('pixelfed.enforce_email_verification', $request->boolean('require_email_verification')); ConfigCacheService::put('pixelfed.enforce_email_verification', $request->boolean('require_email_verification'));
ConfigCacheService::put('pixelfed.enforce_account_limit', $request->boolean('enforce_account_limit')); ConfigCacheService::put('pixelfed.enforce_account_limit', $request->boolean('enforce_account_limit'));
ConfigCacheService::put('account.autofollow', $request->boolean('admin_autofollow')); ConfigCacheService::put('account.autofollow', $request->boolean('admin_autofollow'));
ConfigCacheService::put('instance.user_filters.max_user_blocks', (int) $request->input('max_user_blocks'));
ConfigCacheService::put('instance.user_filters.max_user_mutes', (int) $request->input('max_user_mutes'));
ConfigCacheService::put('instance.user_filters.max_domain_blocks', (int) $request->input('max_domain_blocks'));
$res = [ $res = [
'require_email_verification' => $request->boolean('require_email_verification'), 'require_email_verification' => $request->boolean('require_email_verification'),
'enforce_account_limit' => $request->boolean('enforce_account_limit'), 'enforce_account_limit' => $request->boolean('enforce_account_limit'),
'admin_autofollow' => $request->boolean('admin_autofollow'), 'admin_autofollow' => $request->boolean('admin_autofollow'),
'max_user_blocks' => $request->input('max_user_blocks'),
'max_user_mutes' => $request->input('max_user_mutes'),
'max_domain_blocks' => $request->input('max_domain_blocks'),
]; ];
Cache::forget('api:v1:instance-data:rules'); Cache::forget('api:v1:instance-data:rules');
Cache::forget('api:v1:instance-data-response-v1'); Cache::forget('api:v1:instance-data-response-v1');