stephb9959
2023-01-25 16:39:00 -08:00
parent b54a914c0d
commit d5e0687ade
5 changed files with 8 additions and 8 deletions

2
build
View File

@@ -1 +1 @@
4
6

View File

@@ -23,7 +23,7 @@ namespace OpenWifi {
void ProvWebSocketClient::ws_command_serial_number_search(const Poco::JSON::Object::Ptr &O,
bool &Done, std::string &Answer) {
Done = false;
auto Prefix = O->get("serial_prefix").toString();
auto Prefix = ORM::Escape(O->get("serial_prefix").toString());
Poco::toLowerInPlace(Prefix);
Logger().information(Poco::format("serial_number_search: %s", Prefix));
if (!Prefix.empty() && Prefix.length() < 13) {
@@ -58,7 +58,7 @@ namespace OpenWifi {
void ProvWebSocketClient::ws_command_subuser_search( const Poco::JSON::Object::Ptr &O, bool &Done, std::string &Answer) {
Done = false;
auto operatorId = O->get("operatorId").toString();
auto operatorId = ORM::Escape(O->get("operatorId").toString());
std::string nameSearch, emailSearch;
OpenWifi::RESTAPIHandler::AssignIfPresent(O,"nameSearch",nameSearch);
OpenWifi::RESTAPIHandler::AssignIfPresent(O,"emailSearch",emailSearch);

View File

@@ -104,7 +104,7 @@ namespace OpenWifi{
} else if (HasParameter("subscriber",Arg) && !Arg.empty()) {
// looking for device(s) for a specific subscriber...
ProvObjects::InventoryTagVec Tags;
DB_.GetRecords(0,100,Tags," subscriber='" + Arg + "'");
DB_.GetRecords(0,100,Tags," subscriber='" + ORM::Escape(Arg) + "'");
if(SerialOnly) {
std::vector<std::string> SerialNumbers;
std::transform(cbegin(Tags), cend(Tags), std::back_inserter(SerialNumbers), [](const auto &T) { return T.serialNumber; });

View File

@@ -194,9 +194,9 @@ namespace OpenWifi {
}
void RESTAPI_signup_handler::DoGet() {
auto EMail = GetParameter("email");
auto EMail = ORM::Escape(GetParameter("email"));
auto SignupUUID = GetParameter("signupUUID");
auto macAddress = GetParameter("macAddress");
auto macAddress = ORM::Escape(GetParameter("macAddress"));
auto List = GetBoolParameter("listOnly",false);
poco_information(Logger(),fmt::format("Looking for signup for {}",EMail));

View File

@@ -9,8 +9,8 @@
namespace OpenWifi {
void RESTAPI_sub_devices_list_handler::DoGet() {
auto operatorId=GetParameter("operatorId");
auto subscriberId=GetParameter("subscriberId");
auto operatorId=ORM::Escape(GetParameter("operatorId"));
auto subscriberId=ORM::Escape(GetParameter("subscriberId"));
if(!operatorId.empty() && !StorageService()->OperatorDB().Exists("id",operatorId)) {
return BadRequest(RESTAPI::Errors::OperatorIdMustExist);