File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Core Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ class Form {
132132
133133 # Gather information about the authenticated user
134134 $ client = new Auth ();
135- $ client ->username = $ _SESSION ['Username ' ] ?: DEFAULT_CLIENT_USERNAME ;
135+ $ client ->username = $ _SESSION ['Username ' ];
136136
137137 # Obtain the `id` from URL parameters
138138 $ this ->id = is_numeric ($ _GET ['id ' ]) ? intval ($ _GET ['id ' ]) : null ;
@@ -403,7 +403,9 @@ class Form {
403403 }
404404
405405 try {
406- (new $ this ->model (id: $ id ))->delete ();
406+ $ model_to_delete = new $ this ->model (id: $ id );
407+ $ model_to_delete ->client = $ this ->model ->client ;
408+ $ model_to_delete ->delete ();
407409 $ this ->print_success_banner ("Deleted {$ this ->model ->verbose_name } with ID $ id. " );
408410 } catch (Response $ resp_error ) {
409411 $ error_message = $ resp_error ->getMessage ();
You can’t perform that action at this time.
0 commit comments