diff --git a/build b/build index 7c6ba0f..2ebc651 100644 --- a/build +++ b/build @@ -1 +1 @@ -55 \ No newline at end of file +56 \ No newline at end of file diff --git a/src/MicroService.h b/src/MicroService.h index 1dbf62a..f99afda 100644 --- a/src/MicroService.h +++ b/src/MicroService.h @@ -39,6 +39,8 @@ namespace OpenWifi { static const std::string uSERVICE_TOPOLOGY{ "owtopo"}; static const std::string uSERVICE_PROVISIONING{ "owprov"}; static const std::string uSERVICE_OWLS{ "owls"}; + static const std::string uSERVICE_SUBCRIBER{ "owsub"}; + static const std::string uSERVICE_INSTALLER{ "owinst"}; class MyErrorHandler : public Poco::ErrorHandler { public: diff --git a/src/RESTAPI_user_handler.cpp b/src/RESTAPI_user_handler.cpp index 80dbdf4..5059a39 100644 --- a/src/RESTAPI_user_handler.cpp +++ b/src/RESTAPI_user_handler.cpp @@ -17,8 +17,12 @@ namespace OpenWifi { return BadRequest(RESTAPI::Errors::MissingUserID); } + Poco::toLowerInPlace(Id); + std::string Arg; SecurityObjects::UserInfo UInfo; - if(!Storage()->GetUserById(Id,UInfo)) { + if(HasParameter("byEmail",Arg) && Arg=="true" && !Storage()->GetUserByEmail(Id,UInfo)) { + return NotFound(); + } else if(!Storage()->GetUserById(Id,UInfo)) { return NotFound(); } Poco::JSON::Object UserInfoObject;