Skip to content

Commit

Permalink
fix: pass in Auth object during Form construction
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhendrickson13 committed Nov 23, 2023
1 parent b59a481 commit 318858a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pfSense-pkg-API/files/etc/inc/api/core/Form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ class Form {
# Obtain submitted form data
$this->form_data = $_POST;

# Gather information about the authenticated user
$client = new Auth();
$client->username = $_SESSION["Username"];

# Obtain the `id` from URL parameters
$this->id = (is_numeric($_GET["id"])) ? intval($_GET["id"]) : null;

# Create a new object for the assigned Model
$this->model = new $this->model_name(id: $this->id);
$this->model = new $this->model_name(id: $this->id, client: $client);

foreach ($this->title_path as &$path) {
$path = gettext($path);
Expand Down

0 comments on commit 318858a

Please sign in to comment.