From 454cfccd51e2b9ad453fe79df04360fcd6eeb742 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 6 Jun 2009 15:01:07 +0200 Subject: User-RequestHandler zur UserRequestHandlerGroup zusammengefasst --- .../GroupUserListRequestHandler.cpp | 74 ---------------------- 1 file changed, 74 deletions(-) delete mode 100644 src/Server/RequestHandlers/GroupUserListRequestHandler.cpp (limited to 'src/Server/RequestHandlers/GroupUserListRequestHandler.cpp') diff --git a/src/Server/RequestHandlers/GroupUserListRequestHandler.cpp b/src/Server/RequestHandlers/GroupUserListRequestHandler.cpp deleted file mode 100644 index f862e8b..0000000 --- a/src/Server/RequestHandlers/GroupUserListRequestHandler.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * GroupUserListRequestHandler.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 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "GroupUserListRequestHandler.h" -#include "../UserManager.h" -#include -#include - -namespace Mad { -namespace Server { -namespace RequestHandlers { - -void GroupUserListRequestHandler::handlePacket(boost::shared_ptr packet) { - if(packet->getType() != "ListGroupUsers") { - Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); - - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", Net::Exception::UNEXPECTED_PACKET); - - sendPacket(ret); - - signalFinished(); - return; - } - - // TODO Require authentication - - Common::XmlPacket ret; - - try { - boost::shared_ptr > users = UserManager::get()->getGroupUserList((unsigned long)(*packet)["gid"]); - - ret.setType("OK"); - ret.addList("users"); - - for(std::set::iterator user = users->begin(); user != users->end(); ++user) { - ret["users"].addEntry(); - Common::XmlPacket::Entry &entry = ret["users"].back(); - - entry.add("uid", *user); - } - } - catch(Net::Exception e) { - ret.setType("Error"); - ret.add("ErrorCode", e.getErrorCode()); - ret.add("SubCode", e.getSubCode()); - ret.add("SubSubCode", e.getSubSubCode()); - ret.add("Where", e.getWhere()); - } - - sendPacket(ret); - signalFinished(); -} - -} -} -} -- cgit v1.2.3