function addClient() {
  var ip = $("#select").val();
  var comment = $("#new_comment").val();
  if (ip === "custom") {
    ip = $("#ip-custom").val().trim();
  }

  utils.disableAll();
  utils.showAlert("info", "", "Adding client...", ip);

  if (ip.length === 0) {
    utils.enableAll();
    utils.showAlert("warning", "", "Warning", "Please specify a client IP address");
    return;
  }

  // Validate IP address (may contain CIDR details)
  var ipv6format = ip.includes(":");

  if (!ipv6format && !utils.validateIPv4CIDR(ip)) {
    utils.enableAll();
    utils.showAlert("warning", "", "Warning", "Invalid IPv4 address!");
    return;
  }

  if (ipv6format && !utils.validateIPv6CIDR(ip)) {
    utils.enableAll();
    utils.showAlert("warning", "", "Warning", "Invalid IPv6 address!");
    return;
  }

  $.ajax({
    url: "scripts/pi-hole/php/groups.php",
    method: "post",
    dataType: "json",
    data: { action: "add_client", ip: ip, comment: comment, token: token },
    success: function (response) {
      utils.enableAll();
      if (response.success) {
        utils.showAlert("success", "fas fa-plus", "Successfully added client", ip);
        reloadClientSuggestions();
        table.ajax.reload(null, false);
      } else {
        utils.showAlert("error", "", "Error while adding new client", response.message);
      }
    },
    error: function (jqXHR, exception) {
      utils.enableAll();
      utils.showAlert("error", "", "Error while adding new client", jqXHR.responseText);
      console.log(exception); // eslint-disable-line no-console
    }
  });
}
The software does not perform an authorization check when an actor attempts to access a resource or perform an action.