Skip to content

Commit ad249d8

Browse files
Merge pull request #150 from jaredhendrickson13/v124
[WIP] v1.2.4 Fixes
2 parents 598af19 + 0014c35 commit ad249d8

9 files changed

Lines changed: 292 additions & 165 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,19 @@ URL: https://{{$hostname}}/api/v1/firewall/alias
996996

997997

998998

999+
***Query params:***
1000+
1001+
| Key | Value | Description |
1002+
| --- | ------|-------------|
1003+
| id | string | Name of existing alias to modify. Unlikely other endpoint, this field does NOT use the numeric pfSense ID to locate objects. |
1004+
| name | string | Change name of alias (optional) |
1005+
| type | string | Change type of alias. Alias type can only be changed when the targetted alias is not in use (optional) |
1006+
| descr | string | Change alias description (optional) |
1007+
| address | string or array | Overwrite existing alias addresses with new addresses. Multiple values may be passed in as array, singular values may be passed in as string (optional) |
1008+
| detail | string or array | Overwrite existing alias address details with new details. Multiple values may be passed in as array, singular values may be passed in as string. Detail values must match index of alias addresses (optional) |
1009+
1010+
1011+
9991012
***Body:***
10001013

10011014
```js

pfSense-pkg-API/files/etc/inc/api/framework/APIResponse.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2334,7 +2334,7 @@ function get($id, $data=[], $all=false) {
23342334
"status" => "bad request",
23352335
"code" => 400,
23362336
"return" => $id,
2337-
"message" => "Firewall rule dnpipe and pdnpip queue and a virtual interface cannot be selected"
2337+
"message" => "Firewall rule dnpipe and pdnpipe queue and a virtual interface cannot be selected"
23382338
],
23392339
4226 => [
23402340
"status" => "bad request",

pfSense-pkg-API/files/etc/inc/api/models/APIFirewallRuleCreate.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,13 @@ class APIFirewallRuleCreate extends APIModel {
254254
if ($this->initial_data["pdnpipe"] !== $this->validated_data["dnpipe"]) {
255255
# Determine pipe types
256256
$dnpipe_type = $dnqueues[$this->validated_data['dnpipe']][0];
257-
$pdnpipe_type = $dnqueues[$_POST['pdnpipe']][0];
257+
$pdnpipe_type = $dnqueues[$this->initial_data['pdnpipe']][0];
258258

259-
# Ensure the dnpipe and pdnpipe types do not match
259+
# Ensure the dnpipe and pdnpipe types match
260260
if (($dnpipe_type === "?" and $pdnpipe_type !== "?") or ($pdnpipe_type === "?" and $dnpipe_type !== "?")) {
261-
$this->validated_data["pdnpipe"] = $this->initial_data["pdnpipe"];
262-
} else {
263261
$this->errors[] = APIResponse\get(4225);
262+
} else {
263+
$this->validated_data["pdnpipe"] = $this->initial_data["pdnpipe"];
264264
}
265265
} else {
266266
$this->errors[] = APIResponse\get(4224);

pfSense-pkg-API/files/etc/inc/api/models/APIFirewallRuleUpdate.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,13 @@ class APIFirewallRuleUpdate extends APIModel {
292292
if ($this->initial_data["pdnpipe"] !== $this->validated_data["dnpipe"]) {
293293
# Determine pipe types
294294
$dnpipe_type = $dnqueues[$this->validated_data['dnpipe']][0];
295-
$pdnpipe_type = $dnqueues[$_POST['pdnpipe']][0];
295+
$pdnpipe_type = $dnqueues[$this->initial_data['pdnpipe']][0];
296296

297-
# Ensure the dnpipe and pdnpipe types do not match
297+
# Ensure the dnpipe and pdnpipe types match
298298
if (($dnpipe_type === "?" and $pdnpipe_type !== "?") or ($pdnpipe_type === "?" and $dnpipe_type !== "?")) {
299-
$this->validated_data["pdnpipe"] = $this->initial_data["pdnpipe"];
300-
} else {
301299
$this->errors[] = APIResponse\get(4225);
300+
} else {
301+
$this->validated_data["pdnpipe"] = $this->initial_data["pdnpipe"];
302302
}
303303
} else {
304304
$this->errors[] = APIResponse\get(4224);

0 commit comments

Comments
 (0)