mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-02 03:27:51 +00:00
trimming incoming values.
This commit is contained in:
@@ -11,11 +11,19 @@ namespace OpenWifi {
|
|||||||
void RESTAPI_signup_handler::DoPost() {
|
void RESTAPI_signup_handler::DoPost() {
|
||||||
auto UserName = GetParameter("email");
|
auto UserName = GetParameter("email");
|
||||||
Poco::toLowerInPlace(UserName);
|
Poco::toLowerInPlace(UserName);
|
||||||
|
Poco::trimInPlace(UserName);
|
||||||
|
|
||||||
auto macAddress = GetParameter("macAddress");
|
auto macAddress = GetParameter("macAddress");
|
||||||
Poco::toLowerInPlace(macAddress);
|
Poco::toLowerInPlace(macAddress);
|
||||||
|
Poco::trimInPlace(macAddress);
|
||||||
|
|
||||||
auto deviceID = GetParameter("deviceID");
|
auto deviceID = GetParameter("deviceID");
|
||||||
|
Poco::toLowerInPlace(deviceID);
|
||||||
|
Poco::trimInPlace(deviceID);
|
||||||
|
|
||||||
auto registrationId = GetParameter("registrationId");
|
auto registrationId = GetParameter("registrationId");
|
||||||
Poco::toLowerInPlace(registrationId);
|
Poco::toLowerInPlace(registrationId);
|
||||||
|
Poco::trimInPlace(registrationId);
|
||||||
|
|
||||||
if(UserName.empty() || macAddress.empty() || registrationId.empty()) {
|
if(UserName.empty() || macAddress.empty() || registrationId.empty()) {
|
||||||
return BadRequest(RESTAPI::Errors::MissingOrInvalidParameters);
|
return BadRequest(RESTAPI::Errors::MissingOrInvalidParameters);
|
||||||
@@ -59,10 +67,6 @@ namespace OpenWifi {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!StorageService()->OperatorDB().Exists("registrationId",registrationId)) {
|
|
||||||
return BadRequest(RESTAPI::Errors::InvalidRegistrationOperatorName);
|
|
||||||
}
|
|
||||||
|
|
||||||
// So we do not have an outstanding signup...
|
// So we do not have an outstanding signup...
|
||||||
// Can we actually claim this serial number??? if not, we need to return an error
|
// Can we actually claim this serial number??? if not, we need to return an error
|
||||||
ProvObjects::InventoryTag IT;
|
ProvObjects::InventoryTag IT;
|
||||||
|
|||||||
Reference in New Issue
Block a user