summaryrefslogtreecommitdiffstats
path: root/src/Server
diff options
context:
space:
mode:
Diffstat (limited to 'src/Server')
-rw-r--r--src/Server/RequestHandlers/UserRequestHandlerGroup.cpp9
-rw-r--r--src/Server/RequestHandlers/UserRequestHandlerGroup.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp b/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
index c0de46a..a1aa829 100644
--- a/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
+++ b/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
@@ -331,6 +331,13 @@ void UserRequestHandlerGroup::handleDeleteUserFromGroupRequest(boost::shared_ptr
ret->setType("OK");
}
+void UserRequestHandlerGroup::handlePasswordSetRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
+ Common::Connection* /*connection*/) {
+ application->getUserManager()->setPassword(packet->get<unsigned long>("uid"), packet->get<const std::string&>("password"));
+
+ 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));
@@ -354,6 +361,8 @@ UserRequestHandlerGroup::UserRequestHandlerGroup(Application *application0) : ap
registerHandler("AddUserToGroup", boost::bind(&UserRequestHandlerGroup::handleAddUserToGroupRequest, this, _1, _2, _3));
registerHandler("DeleteUserFromGroup", boost::bind(&UserRequestHandlerGroup::handleDeleteUserFromGroupRequest, this, _1, _2, _3));
+
+ registerHandler("SetPassword", boost::bind(&UserRequestHandlerGroup::handlePasswordSetRequest, this, _1, _2, _3));
}
}
diff --git a/src/Server/RequestHandlers/UserRequestHandlerGroup.h b/src/Server/RequestHandlers/UserRequestHandlerGroup.h
index c1338c4..ee4b7f4 100644
--- a/src/Server/RequestHandlers/UserRequestHandlerGroup.h
+++ b/src/Server/RequestHandlers/UserRequestHandlerGroup.h
@@ -56,6 +56,8 @@ class UserRequestHandlerGroup : public Common::RequestHandlers::SimpleRequestHan
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);
+ void handlePasswordSetRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret, Common::Connection *connection);
+
public:
UserRequestHandlerGroup(Application *application0);
};