From 0eddc28a331437ef95a60418ed1fc6de4e9b63c1 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 23 Sep 2009 09:44:02 +0200 Subject: UserListManager: Moved module into libCommon and libServer --- .../UserListUploadRequestHandler.cpp | 83 ---------------------- 1 file changed, 83 deletions(-) delete mode 100644 src/modules/UserListManager/RequestHandlers/UserListUploadRequestHandler.cpp (limited to 'src/modules/UserListManager/RequestHandlers/UserListUploadRequestHandler.cpp') diff --git a/src/modules/UserListManager/RequestHandlers/UserListUploadRequestHandler.cpp b/src/modules/UserListManager/RequestHandlers/UserListUploadRequestHandler.cpp deleted file mode 100644 index 9d01b5e..0000000 --- a/src/modules/UserListManager/RequestHandlers/UserListUploadRequestHandler.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * UserListUploadRequestHandler.cpp - * - * Copyright (C) 2009 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License along - * with this program. If not, see . - */ - -#include "UserListUploadRequestHandler.h" -#include "../UserListManager.h" -#include "../Util.h" - -#include - - -namespace Mad { -namespace Modules { -namespace UserListManager { -namespace RequestHandlers { - -void UserListUploadRequestHandler::handlePacket(boost::shared_ptr packet) { - if(packet->getType() == "Cancel") { - Common::XmlData ret; - ret.setType("OK"); - sendPacket(ret); - - signalFinished(); - return; - } - else if(packet->getType() != "UploadUserList") { - getApplication()->log(Core::Logger::LOG_ERROR, "Received an unexpected packet."); - - Common::XmlData ret; - ret.setType("Error"); - ret.set("ErrorCode", Core::Exception::UNEXPECTED_PACKET); - - sendPacket(ret); - - signalFinished(); - return; - } - - if(!getConnection()->isAuthenticated()) - throw(Core::Exception(Core::Exception::PERMISSION)); - - if(name.empty()) { // Request - name = packet->get("name"); - - if(name.empty()) - name = boost::posix_time::to_simple_string(boost::posix_time::second_clock::universal_time()); - - Common::XmlData ret; - ret.setType("Continue"); - ret.set("exists", userListManager->existsUserList(name)); - sendPacket(ret); - } - else { // Upload - boost::shared_ptr userList = Util::deserializeUserList(packet.get()); - userListManager->storeUserList(name, userList.get()); - - Common::XmlData ret; - ret.setType("OK"); - sendPacket(ret); - - signalFinished(); - } -} - -} -} -} -} -- cgit v1.2.3