A free open source IT asset/license management system
Start storing admin_cc_always
Marcus Moore12dc33244da0
diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.phpindex 747f7b7284..b652455a57 100644--- a/app/Http/Controllers/SettingsController.php+++ b/app/Http/Controllers/SettingsController.php@@ -650,6 +650,7 @@ class SettingsController extends Controller$setting->alert_email = $alert_email;$setting->admin_cc_email = $admin_cc_email;+ $setting->admin_cc_always = $request->validated('admin_cc_always');$setting->alerts_enabled = $request->input('alerts_enabled', '0');$setting->alert_interval = $request->input('alert_interval');$setting->alert_threshold = $request->input('alert_threshold');diff --git a/app/Http/Requests/StoreNotificationSettings.php b/app/Http/Requests/StoreNotificationSettings.phpindex bf5f5b3d4e..f58d014c76 100644--- a/app/Http/Requests/StoreNotificationSettings.php+++ b/app/Http/Requests/StoreNotificationSettings.php@@ -5,6 +5,7 @@ namespace App\Http\Requests;use App\Models\Accessory;use Illuminate\Foundation\Http\FormRequest;use Illuminate\Support\Facades\Gate;+use Illuminate\Validation\Rule;class StoreNotificationSettings extends FormRequest{@@ -26,6 +27,9 @@ class StoreNotificationSettings extends FormRequestreturn ['alert_email' => 'email_array|nullable','admin_cc_email' => 'email_array|nullable',+ 'admin_cc_always' => [+ Rule::in('0', '1'),+ ],'alert_threshold' => 'numeric|nullable','alert_interval' => 'numeric|nullable|gt:0','audit_warning_days' => 'numeric|nullable',diff --git a/tests/Feature/Settings/AlertsSettingTest.php b/tests/Feature/Settings/AlertsSettingTest.phpindex 42974d6640..7812d0eb33 100644--- a/tests/Feature/Settings/AlertsSettingTest.php+++ b/tests/Feature/Settings/AlertsSettingTest.php@@ -18,7 +18,10 @@ class AlertsSettingTest extends TestCasepublic function testAdminCCEmailArrayCanBeSaved(){$response = $this->actingAs(User::factory()->superuser()->create())- ->post(route('settings.alerts.save', ['alert_email' => '[email protected],[email protected]']))+ ->post(route('settings.alerts.save', [+ 'alert_email' => '[email protected],[email protected]',+ 'admin_cc_always' => '1',+ ]))->assertStatus(302)->assertValid('alert_email')->assertRedirect(route('settings.index'))