77use App \Http \Requests \ImageUploadRequest ;
88use App \Http \Requests \SettingsSamlRequest ;
99use App \Http \Requests \SetupUserRequest ;
10+ use App \Http \Requests \StoreLdapSettings ;
11+ use App \Http \Requests \StoreLocalizationSettings ;
12+ use App \Http \Requests \StoreNotificationSettings ;
13+ use App \Http \Requests \StoreLabelSettings ;
14+ use App \Http \Requests \StoreSecuritySettings ;
1015use App \Models \CustomField ;
1116use App \Models \Group ;
1217use App \Models \Setting ;
@@ -273,20 +278,6 @@ public function index() : View
273278 return view ('settings/index ' , compact ('settings ' ));
274279 }
275280
276- /**
277- * Return the admin settings page.
278- *
279- * @author [A. Gianotto] [<[email protected] >] 280- *
281- * @since [v1.0]
282- */
283- public function getEdit () : View
284-
285- {
286- $ setting = Setting::getSettings ();
287-
288- return view ('settings/general ' , compact ('setting ' ));
289- }
290281
291282 /**
292283 * Return a form to allow a super admin to update settings.
@@ -486,7 +477,7 @@ public function getSecurity() : View
486477 *
487478 * @since [v1.0]
488479 */
489- public function postSecurity (Request $ request ) : RedirectResponse
480+ public function postSecurity (StoreSecuritySettings $ request ) : RedirectResponse
490481 {
491482 $ this ->validate ($ request , [
492483 'pwd_secure_complexity ' => 'array ' ,
@@ -556,7 +547,7 @@ public function getLocalization() : View
556547 *
557548 * @since [v1.0]
558549 */
559- public function postLocalization (Request $ request ) : RedirectResponse
550+ public function postLocalization (StoreLocalizationSettings $ request ) : RedirectResponse
560551 {
561552 if (is_null ($ setting = Setting::getSettings ())) {
562553 return redirect ()->to ('admin ' )->with ('error ' , trans ('admin/settings/message.update.error ' ));
@@ -599,7 +590,7 @@ public function getAlerts() : View
599590 * @author [A. Gianotto] [<[email protected] >] 600591 * @since [v1.0]
601592 */
602- public function postAlerts (Request $ request ) : RedirectResponse
593+ public function postAlerts (StoreNotificationSettings $ request ) : RedirectResponse
603594 {
604595 if (is_null ($ setting = Setting::getSettings ())) {
605596 return redirect ()->to ('admin ' )->with ('error ' , trans ('admin/settings/message.update.error ' ));
@@ -780,7 +771,7 @@ public function getLabels() : View
780771 * @author [A. Gianotto] [<[email protected] >] 781772 * @since [v4.0]
782773 */
783- public function postLabels (Request $ request ) : RedirectResponse
774+ public function postLabels (StoreLabelSettings $ request ) : RedirectResponse
784775 {
785776 if (is_null ($ setting = Setting::getSettings ())) {
786777 return redirect ()->to ('admin ' )->with ('error ' , trans ('admin/settings/message.update.error ' ));
@@ -859,26 +850,7 @@ public function getLdapSettings() : View
859850 {
860851 $ setting = Setting::getSettings ();
861852 $ groups = Group::pluck ('name ' , 'id ' );
862-
863-
864- /**
865- * This validator is only temporary (famous last words.) - @snipe
866- */
867- $ messages = [
868- 'ldap_username_field.not_in ' => '<code>sAMAccountName</code> (mixed case) will likely not work. You should use <code>samaccountname</code> (lowercase) instead. ' ,
869- 'ldap_auth_filter_query.not_in ' => '<code>uid=samaccountname</code> is probably not a valid auth filter. You probably want <code>uid=</code> ' ,
870- 'ldap_filter.regex ' => 'This value should probably not be wrapped in parentheses. ' ,
871- ];
872-
873- $ validator = Validator::make ($ setting ->toArray (), [
874- 'ldap_username_field ' => 'not_in:sAMAccountName ' ,
875- 'ldap_auth_filter_query ' => 'not_in:uid=samaccountname|required_if:ldap_enabled,1 ' ,
876- 'ldap_filter ' => 'nullable|regex:"^[^(]"|required_if:ldap_enabled,1 ' ,
877- ], $ messages );
878-
879-
880-
881- return view ('settings.ldap ' , compact ('setting ' , 'groups ' ))->withErrors ($ validator );
853+ return view ('settings.ldap ' , compact ('setting ' , 'groups ' ));
882854 }
883855
884856 /**
@@ -887,7 +859,7 @@ public function getLdapSettings() : View
887859 * @author [A. Gianotto] [<[email protected] >] 888860 * @since [v4.0]
889861 */
890- public function postLdapSettings (Request $ request ) : RedirectResponse
862+ public function postLdapSettings (StoreLdapSettings $ request ) : RedirectResponse
891863 {
892864 if (is_null ($ setting = Setting::getSettings ())) {
893865 return redirect ()->to ('admin ' )->with ('error ' , trans ('admin/settings/message.update.error ' ));
0 commit comments