summaryrefslogtreecommitdiffstats
path: root/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Server/RequestHandlers/UserRequestHandlerGroup.cpp')
-rw-r--r--src/Server/RequestHandlers/UserRequestHandlerGroup.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp b/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
index 1d99c2e..f43ec86 100644
--- a/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
+++ b/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
@@ -36,10 +36,10 @@ void UserRequestHandlerGroup::handleUserListRequest(boost::shared_ptr<const Comm
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
- const std::string &timestr = packet->get<const std::string&>("timestamp");
- if(!timestr.empty()) {
+ const Core::String &timestr = packet->get<const Core::String&>("timestamp");
+ if(!timestr.isEmpty()) {
try {
- timestamp = boost::posix_time::from_iso_string(timestr);
+ timestamp = boost::posix_time::from_iso_string(timestr.extract());
}
catch(...) {}
}
@@ -49,7 +49,7 @@ void UserRequestHandlerGroup::handleUserListRequest(boost::shared_ptr<const Comm
ret->setType("OK");
if(!timestamp.is_not_a_date_time())
- ret->set("timestamp", boost::posix_time::to_iso_string(timestamp));
+ ret->set("timestamp", boost::posix_time::to_iso_string(timestamp).c_str());
if(users) {
Common::XmlData::List *list = ret->createList("users");
@@ -72,10 +72,10 @@ void UserRequestHandlerGroup::handleUserInfoRequest(boost::shared_ptr<const Comm
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
- const std::string &timestr = packet->get<const std::string&>("timestamp");
- if(!timestr.empty()) {
+ const Core::String &timestr = packet->get<const Core::String&>("timestamp");
+ if(!timestr.isEmpty()) {
try {
- timestamp = boost::posix_time::from_iso_string(timestr);
+ timestamp = boost::posix_time::from_iso_string(timestr.extract());
}
catch(...) {}
}
@@ -86,12 +86,12 @@ void UserRequestHandlerGroup::handleUserInfoRequest(boost::shared_ptr<const Comm
if(uid)
info = application->getUserManager()->getUserInfo(uid, &timestamp);
else
- info = application->getUserManager()->getUserInfoByName(packet->get<const std::string&>("name"), &timestamp);
+ info = application->getUserManager()->getUserInfoByName(packet->get<const Core::String&>("name"), &timestamp);
ret->setType("OK");
if(!timestamp.is_not_a_date_time())
- ret->set("timestamp", boost::posix_time::to_iso_string(timestamp));
+ ret->set("timestamp", boost::posix_time::to_iso_string(timestamp).c_str());
if(info) {
ret->set("uid", info->getUid());
@@ -108,10 +108,10 @@ void UserRequestHandlerGroup::handleUserGroupListRequest(boost::shared_ptr<const
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
- const std::string &timestr = packet->get<const std::string&>("timestamp");
- if(!timestr.empty()) {
+ const Core::String &timestr = packet->get<const Core::String&>("timestamp");
+ if(!timestr.isEmpty()) {
try {
- timestamp = boost::posix_time::from_iso_string(timestr);
+ timestamp = boost::posix_time::from_iso_string(timestr.extract());
}
catch(...) {}
}
@@ -121,7 +121,7 @@ void UserRequestHandlerGroup::handleUserGroupListRequest(boost::shared_ptr<const
ret->setType("OK");
if(!timestamp.is_not_a_date_time())
- ret->set("timestamp", boost::posix_time::to_iso_string(timestamp));
+ ret->set("timestamp", boost::posix_time::to_iso_string(timestamp).c_str());
if(groups) {
Common::XmlData::List *list = ret->createList("groups");
@@ -141,10 +141,10 @@ void UserRequestHandlerGroup::handleGroupListRequest(boost::shared_ptr<const Com
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
- const std::string &timestr = packet->get<const std::string&>("timestamp");
- if(!timestr.empty()) {
+ const Core::String &timestr = packet->get<const Core::String&>("timestamp");
+ if(!timestr.isEmpty()) {
try {
- timestamp = boost::posix_time::from_iso_string(timestr);
+ timestamp = boost::posix_time::from_iso_string(timestr.extract());
}
catch(...) {}
}
@@ -154,7 +154,7 @@ void UserRequestHandlerGroup::handleGroupListRequest(boost::shared_ptr<const Com
ret->setType("OK");
if(!timestamp.is_not_a_date_time())
- ret->set("timestamp", boost::posix_time::to_iso_string(timestamp));
+ ret->set("timestamp", boost::posix_time::to_iso_string(timestamp).c_str());
if(groups) {
Common::XmlData::List *list = ret->createList("groups");
@@ -175,10 +175,10 @@ void UserRequestHandlerGroup::handleGroupInfoRequest(boost::shared_ptr<const Com
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
- const std::string &timestr = packet->get<const std::string&>("timestamp");
- if(!timestr.empty()) {
+ const Core::String &timestr = packet->get<const Core::String&>("timestamp");
+ if(!timestr.isEmpty()) {
try {
- timestamp = boost::posix_time::from_iso_string(timestr);
+ timestamp = boost::posix_time::from_iso_string(timestr.extract());
}
catch(...) {}
}
@@ -189,12 +189,12 @@ void UserRequestHandlerGroup::handleGroupInfoRequest(boost::shared_ptr<const Com
if(gid)
info = application->getUserManager()->getGroupInfo(gid, &timestamp);
else
- info = application->getUserManager()->getGroupInfoByName(packet->get<const std::string&>("name"), &timestamp);
+ info = application->getUserManager()->getGroupInfoByName(packet->get<const Core::String&>("name"), &timestamp);
ret->setType("OK");
if(!timestamp.is_not_a_date_time())
- ret->set("timestamp", boost::posix_time::to_iso_string(timestamp));
+ ret->set("timestamp", boost::posix_time::to_iso_string(timestamp).c_str());
if(info) {
ret->set("gid", info->getGid());
@@ -209,10 +209,10 @@ void UserRequestHandlerGroup::handleGroupUserListRequest(boost::shared_ptr<const
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
- const std::string &timestr = packet->get<const std::string&>("timestamp");
- if(!timestr.empty()) {
+ const Core::String &timestr = packet->get<const Core::String&>("timestamp");
+ if(!timestr.isEmpty()) {
try {
- timestamp = boost::posix_time::from_iso_string(timestr);
+ timestamp = boost::posix_time::from_iso_string(timestr.extract());
}
catch(...) {}
}
@@ -222,7 +222,7 @@ void UserRequestHandlerGroup::handleGroupUserListRequest(boost::shared_ptr<const
ret->setType("OK");
if(!timestamp.is_not_a_date_time())
- ret->set("timestamp", boost::posix_time::to_iso_string(timestamp));
+ ret->set("timestamp", boost::posix_time::to_iso_string(timestamp).c_str());
Common::XmlData::List *list = ret->createList("users");
@@ -240,10 +240,10 @@ void UserRequestHandlerGroup::handleFullUserGroupListRequest(boost::shared_ptr<c
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
- const std::string &timestr = packet->get<const std::string&>("timestamp");
- if(!timestr.empty()) {
+ const Core::String &timestr = packet->get<const Core::String&>("timestamp");
+ if(!timestr.isEmpty()) {
try {
- timestamp = boost::posix_time::from_iso_string(timestr);
+ timestamp = boost::posix_time::from_iso_string(timestr.extract());
}
catch(...) {}
}
@@ -253,7 +253,7 @@ void UserRequestHandlerGroup::handleFullUserGroupListRequest(boost::shared_ptr<c
ret->setType("OK");
if(!timestamp.is_not_a_date_time())
- ret->set("timestamp", boost::posix_time::to_iso_string(timestamp));
+ ret->set("timestamp", boost::posix_time::to_iso_string(timestamp).c_str());
if(userGroups) {
Common::XmlData::List *list = ret->createList("userGroupList");
@@ -273,9 +273,9 @@ void UserRequestHandlerGroup::handleUserInfoCheckRequest(boost::shared_ptr<const
if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
- Common::UserInfo userInfo(packet->get<unsigned long>("uid"), packet->get<const std::string&>("username"));
+ Common::UserInfo userInfo(packet->get<unsigned long>("uid"), packet->get<const Core::String&>("username"));
userInfo.setGid(packet->get<unsigned long>("gid"));
- userInfo.setFullName(packet->get<const std::string&>("fullName"));
+ userInfo.setFullName(packet->get<const Core::String&>("fullName"));
application->getUserManager()->checkUserInfo(userInfo);
@@ -287,9 +287,9 @@ void UserRequestHandlerGroup::handleUserAddRequest(boost::shared_ptr<const Commo
if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
- Common::UserInfo userInfo(packet->get<unsigned long>("uid"), packet->get<const std::string&>("username"));
+ Common::UserInfo userInfo(packet->get<unsigned long>("uid"), packet->get<const Core::String&>("username"));
userInfo.setGid(packet->get<unsigned long>("gid"));
- userInfo.setFullName(packet->get<const std::string&>("fullName"));
+ userInfo.setFullName(packet->get<const Core::String&>("fullName"));
application->getUserManager()->addUser(userInfo);
@@ -301,9 +301,9 @@ void UserRequestHandlerGroup::handleUserUpdateRequest(boost::shared_ptr<const Co
if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
- Common::UserInfo userInfo(packet->get<unsigned long>("uid"), packet->get<const std::string&>("username"));
+ Common::UserInfo userInfo(packet->get<unsigned long>("uid"), packet->get<const Core::String&>("username"));
userInfo.setGid(packet->get<unsigned long>("gid"));
- userInfo.setFullName(packet->get<const std::string&>("fullName"));
+ userInfo.setFullName(packet->get<const Core::String&>("fullName"));
application->getUserManager()->updateUser(packet->get<unsigned long>("origUid"), userInfo);
@@ -326,7 +326,7 @@ void UserRequestHandlerGroup::handleGroupInfoCheckRequest(boost::shared_ptr<cons
if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
- application->getUserManager()->checkGroupInfo(Common::GroupInfo(packet->get<unsigned long>("gid"), packet->get<const std::string&>("name")));
+ application->getUserManager()->checkGroupInfo(Common::GroupInfo(packet->get<unsigned long>("gid"), packet->get<const Core::String&>("name")));
ret->setType("OK");
}
@@ -336,7 +336,7 @@ void UserRequestHandlerGroup::handleGroupAddRequest(boost::shared_ptr<const Comm
if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
- application->getUserManager()->addGroup(Common::GroupInfo(packet->get<unsigned long>("gid"), packet->get<const std::string&>("name")));
+ application->getUserManager()->addGroup(Common::GroupInfo(packet->get<unsigned long>("gid"), packet->get<const Core::String&>("name")));
ret->setType("OK");
}
@@ -347,7 +347,7 @@ void UserRequestHandlerGroup::handleGroupUpdateRequest(boost::shared_ptr<const C
throw(Core::Exception(Core::Exception::PERMISSION));
application->getUserManager()->updateGroup(packet->get<unsigned long>("origGid"),
- Common::GroupInfo(packet->get<unsigned long>("gid"), packet->get<const std::string&>("name")));
+ Common::GroupInfo(packet->get<unsigned long>("gid"), packet->get<const Core::String&>("name")));
ret->setType("OK");
}
@@ -388,7 +388,7 @@ void UserRequestHandlerGroup::handlePasswordSetRequest(boost::shared_ptr<const C
if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
- application->getUserManager()->setPassword(packet->get<unsigned long>("uid"), packet->get<const std::string&>("password"));
+ application->getUserManager()->setPassword(packet->get<unsigned long>("uid"), packet->get<const Core::String&>("password"));
ret->setType("OK");
}