summaryrefslogtreecommitdiffstats
path: root/src/Server
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-07-11 01:11:21 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-07-11 01:11:21 +0200
commitbf4c6ec2b7694f1a844eef5989b77e83a8cab362 (patch)
treea407ccab48195d61d4e04ccf8581b1328fd08e72 /src/Server
parentb8aa377d883c316f544274dd24db9f079fb8f02a (diff)
downloadmad-bf4c6ec2b7694f1a844eef5989b77e83a8cab362.tar
mad-bf4c6ec2b7694f1a844eef5989b77e83a8cab362.zip
Befehle add_user_to_group und delete_user_from_group implementiert
Diffstat (limited to 'src/Server')
-rw-r--r--src/Server/RequestHandlers/UserRequestHandlerGroup.cpp17
-rw-r--r--src/Server/RequestHandlers/UserRequestHandlerGroup.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp b/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
index e0c4020..0bb3cfa 100644
--- a/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
+++ b/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
@@ -276,6 +276,20 @@ void UserRequestHandlerGroup::handleUserDeleteRequest(boost::shared_ptr<const Co
ret->setType("OK");
}
+void UserRequestHandlerGroup::handleAddUserToGroupRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
+ Common::Connection *connection _UNUSED_PARAMETER_) {
+ application->getUserManager()->addUserToGroup(packet->get<unsigned long>("uid"), packet->get<unsigned long>("gid"));
+
+ ret->setType("OK");
+}
+
+void UserRequestHandlerGroup::handleDeleteUserFromGroupRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
+ Common::Connection *connection _UNUSED_PARAMETER_) {
+ application->getUserManager()->deleteUserFromGroup(packet->get<unsigned long>("uid"), packet->get<unsigned long>("gid"));
+
+ 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));
@@ -290,6 +304,9 @@ UserRequestHandlerGroup::UserRequestHandlerGroup(Application *application0) : ap
registerHandler("AddUser", boost::bind(&UserRequestHandlerGroup::handleUserAddRequest, this, _1, _2, _3));
registerHandler("UpdateUser", boost::bind(&UserRequestHandlerGroup::handleUserUpdateRequest, this, _1, _2, _3));
registerHandler("DeleteUser", boost::bind(&UserRequestHandlerGroup::handleUserDeleteRequest, this, _1, _2, _3));
+
+ registerHandler("AddUserToGroup", boost::bind(&UserRequestHandlerGroup::handleAddUserToGroupRequest, this, _1, _2, _3));
+ registerHandler("DeleteUserFromGroup", boost::bind(&UserRequestHandlerGroup::handleDeleteUserFromGroupRequest, this, _1, _2, _3));
}
}
diff --git a/src/Server/RequestHandlers/UserRequestHandlerGroup.h b/src/Server/RequestHandlers/UserRequestHandlerGroup.h
index 24a689b..6da97a3 100644
--- a/src/Server/RequestHandlers/UserRequestHandlerGroup.h
+++ b/src/Server/RequestHandlers/UserRequestHandlerGroup.h
@@ -47,6 +47,9 @@ class UserRequestHandlerGroup : public Common::RequestHandlers::SimpleRequestHan
void handleUserUpdateRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret, Common::Connection *connection);
void handleUserDeleteRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret, Common::Connection *connection);
+ void handleAddUserToGroupRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret, Common::Connection *connection);
+ void handleDeleteUserFromGroupRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret, Common::Connection *connection);
+
public:
UserRequestHandlerGroup(Application *application0);
};