summaryrefslogtreecommitdiffstats
path: root/src/Server
diff options
context:
space:
mode:
Diffstat (limited to 'src/Server')
-rw-r--r--src/Server/RequestHandlers/UserRequestHandlerGroup.cpp13
-rw-r--r--src/Server/RequestHandlers/UserRequestHandlerGroup.h2
2 files changed, 15 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));
}
}
diff --git a/src/Server/RequestHandlers/UserRequestHandlerGroup.h b/src/Server/RequestHandlers/UserRequestHandlerGroup.h
index a55a34f..bc57234 100644
--- a/src/Server/RequestHandlers/UserRequestHandlerGroup.h
+++ b/src/Server/RequestHandlers/UserRequestHandlerGroup.h
@@ -43,6 +43,8 @@ class UserRequestHandlerGroup : public Common::RequestHandlers::SimpleRequestHan
void handleFullUserGroupListRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret, Common::Connection *connection);
+ void handleUserAddRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret, Common::Connection *connection);
+
public:
UserRequestHandlerGroup(Application *application0);
};