Skip to content

Commit f1cbd1e

Browse files
Fixed issue in APITools.inc that prevented the full privilege list from being parsed
1 parent da6665a commit f1cbd1e

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1934,7 +1934,7 @@ function get($id, $data=[], $all=false) {
19341934

19351935

19361936
];
1937-
$response = $responses[(!array_key_exists($id, $responses)) ? $id : 1];
1937+
$response = $responses[(array_key_exists($id, $responses)) ? $id : 1];
19381938
$response["data"] = $data;
19391939
if ($all === true) {
19401940
$response = $responses;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ require_once("util.inc");
2323
require_once("interfaces.inc");
2424
require_once("interfaces_fast.inc");
2525
require_once("priv.defs.inc");
26+
require_once("priv.inc");
2627
require_once("service-utils.inc");
2728
require_once("filter.inc");
2829
require_once("shaper.inc");

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class APIUserCreate extends APIModel {
4545
# Ensure username is not reserved by the system
4646
if (!$this->is_username_reserved($this->initial_data["username"])) {
4747
# Ensure username is not longer that 32 characters
48-
if (strlen($this->initial_data["username"]) > 32) {
48+
if (strlen($this->initial_data["username"]) <= 32) {
4949
$this->validated_data["name"] = $this->initial_data['username'];
5050
} else {
5151
$this->errors[] = APIResponse\get(5038);

0 commit comments

Comments
 (0)