mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-10-30 18:27:49 +00:00
Added the ability to get user by email
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user