diff options
Diffstat (limited to 'src/Server/RequestHandlers/UserRequestHandlerGroup.cpp')
-rw-r--r-- | src/Server/RequestHandlers/UserRequestHandlerGroup.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp b/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp index 292e887..584b3cc 100644 --- a/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp +++ b/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp @@ -247,6 +247,17 @@ void UserRequestHandlerGroup::handleFullUserGroupListRequest(boost::shared_ptr<c } } +void UserRequestHandlerGroup::handleUserAddRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret, + Common::Connection *connection _UNUSED_PARAMETER_) { + Common::UserInfo userInfo(packet->get<unsigned long>("uid"), packet->get<const std::string&>("username")); + userInfo.setGid(packet->get<unsigned long>("gid")); + userInfo.setFullName(packet->get<const std::string&>("fullName")); + + application->getUserManager()->addUser(userInfo); + + ret->setType("OK"); +} + UserRequestHandlerGroup::UserRequestHandlerGroup(Application *application0) : application(application0) { registerHandler("ListUsers", boost::bind(&UserRequestHandlerGroup::handleUserListRequest, this, _1, _2, _3)); registerHandler("GetUserInfo", boost::bind(&UserRequestHandlerGroup::handleUserInfoRequest, this, _1, _2, _3)); @@ -257,6 +268,8 @@ UserRequestHandlerGroup::UserRequestHandlerGroup(Application *application0) : ap registerHandler("ListGroupUsers", boost::bind(&UserRequestHandlerGroup::handleGroupUserListRequest, this, _1, _2, _3)); registerHandler("GetFullUserGroupList", boost::bind(&UserRequestHandlerGroup::handleFullUserGroupListRequest, this, _1, _2, _3)); + + registerHandler("AddUser", boost::bind(&UserRequestHandlerGroup::handleUserAddRequest, this, _1, _2, _3)); } } |