summaryrefslogtreecommitdiffstats
path: root/src/Server/RequestHandlers
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-08-31 18:11:46 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-08-31 18:11:46 +0200
commit053843f893dd5c96a88e285cf2a5b35419f7dfca (patch)
tree532fbd3d8fb4c86b00427a07907a89f6ef8512a1 /src/Server/RequestHandlers
parentbbb8e9176ced8b4079fcbb208137042ec56c1433 (diff)
downloadmad-053843f893dd5c96a88e285cf2a5b35419f7dfca.tar
mad-053843f893dd5c96a88e285cf2a5b35419f7dfca.zip
Immer Authentifizierung fordern
Diffstat (limited to 'src/Server/RequestHandlers')
-rw-r--r--src/Server/RequestHandlers/ConnectionRequestHandlerGroup.cpp2
-rw-r--r--src/Server/RequestHandlers/DaemonRequestHandlerGroup.cpp6
-rw-r--r--src/Server/RequestHandlers/UserRequestHandlerGroup.cpp36
3 files changed, 22 insertions, 22 deletions
diff --git a/src/Server/RequestHandlers/ConnectionRequestHandlerGroup.cpp b/src/Server/RequestHandlers/ConnectionRequestHandlerGroup.cpp
index 2a091e6..2171deb 100644
--- a/src/Server/RequestHandlers/ConnectionRequestHandlerGroup.cpp
+++ b/src/Server/RequestHandlers/ConnectionRequestHandlerGroup.cpp
@@ -74,7 +74,7 @@ void ConnectionRequestHandlerGroup::handleAuthRequest(boost::shared_ptr<const Co
void ConnectionRequestHandlerGroup::handleDaemonListRequest(boost::shared_ptr<const Common::XmlPacket> /*packet*/, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
ret->setType("OK");
diff --git a/src/Server/RequestHandlers/DaemonRequestHandlerGroup.cpp b/src/Server/RequestHandlers/DaemonRequestHandlerGroup.cpp
index ee79ff2..35e167e 100644
--- a/src/Server/RequestHandlers/DaemonRequestHandlerGroup.cpp
+++ b/src/Server/RequestHandlers/DaemonRequestHandlerGroup.cpp
@@ -44,12 +44,12 @@ void DaemonRequestHandlerGroup::DaemonRequestHandler::handlePacket(boost::shared
return;
}
- ConnectionManager *connectionManager = dynamic_cast<Application&>(*getApplication()).getConnectionManager();
-
- if(!connectionManager->isAuthenticated(getConnection()))
+ if(!getConnection()->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
try {
+ ConnectionManager *connectionManager = dynamic_cast<Application&>(*getApplication()).getConnectionManager();
+
boost::shared_ptr<Common::Connection> daemonCon = connectionManager->getDaemonConnection(packet->get<const std::string&>("daemon"));
boost::shared_ptr<Common::Request> request;
diff --git a/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp b/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
index ea6f6c1..d5f97a9 100644
--- a/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
+++ b/src/Server/RequestHandlers/UserRequestHandlerGroup.cpp
@@ -31,7 +31,7 @@ namespace RequestHandlers {
void UserRequestHandlerGroup::handleUserListRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
@@ -67,7 +67,7 @@ void UserRequestHandlerGroup::handleUserListRequest(boost::shared_ptr<const Comm
void UserRequestHandlerGroup::handleUserInfoRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
@@ -103,7 +103,7 @@ void UserRequestHandlerGroup::handleUserInfoRequest(boost::shared_ptr<const Comm
void UserRequestHandlerGroup::handleUserGroupListRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
@@ -136,7 +136,7 @@ void UserRequestHandlerGroup::handleUserGroupListRequest(boost::shared_ptr<const
void UserRequestHandlerGroup::handleGroupListRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
@@ -170,7 +170,7 @@ void UserRequestHandlerGroup::handleGroupListRequest(boost::shared_ptr<const Com
void UserRequestHandlerGroup::handleGroupInfoRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
@@ -204,7 +204,7 @@ void UserRequestHandlerGroup::handleGroupInfoRequest(boost::shared_ptr<const Com
void UserRequestHandlerGroup::handleGroupUserListRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
@@ -235,7 +235,7 @@ void UserRequestHandlerGroup::handleGroupUserListRequest(boost::shared_ptr<const
void UserRequestHandlerGroup::handleFullUserGroupListRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
boost::posix_time::ptime timestamp(boost::posix_time::not_a_date_time);
@@ -270,7 +270,7 @@ void UserRequestHandlerGroup::handleFullUserGroupListRequest(boost::shared_ptr<c
void UserRequestHandlerGroup::handleUserInfoCheckRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
Common::UserInfo userInfo(packet->get<unsigned long>("uid"), packet->get<const std::string&>("username"));
@@ -284,7 +284,7 @@ void UserRequestHandlerGroup::handleUserInfoCheckRequest(boost::shared_ptr<const
void UserRequestHandlerGroup::handleUserAddRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
Common::UserInfo userInfo(packet->get<unsigned long>("uid"), packet->get<const std::string&>("username"));
@@ -298,7 +298,7 @@ void UserRequestHandlerGroup::handleUserAddRequest(boost::shared_ptr<const Commo
void UserRequestHandlerGroup::handleUserUpdateRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
Common::UserInfo userInfo(packet->get<unsigned long>("uid"), packet->get<const std::string&>("username"));
@@ -312,7 +312,7 @@ void UserRequestHandlerGroup::handleUserUpdateRequest(boost::shared_ptr<const Co
void UserRequestHandlerGroup::handleUserDeleteRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
application->getUserManager()->deleteUser(packet->get<unsigned long>("uid"));
@@ -323,7 +323,7 @@ void UserRequestHandlerGroup::handleUserDeleteRequest(boost::shared_ptr<const Co
void UserRequestHandlerGroup::handleGroupInfoCheckRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
application->getUserManager()->checkGroupInfo(Common::GroupInfo(packet->get<unsigned long>("gid"), packet->get<const std::string&>("name")));
@@ -333,7 +333,7 @@ void UserRequestHandlerGroup::handleGroupInfoCheckRequest(boost::shared_ptr<cons
void UserRequestHandlerGroup::handleGroupAddRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
application->getUserManager()->addGroup(Common::GroupInfo(packet->get<unsigned long>("gid"), packet->get<const std::string&>("name")));
@@ -343,7 +343,7 @@ void UserRequestHandlerGroup::handleGroupAddRequest(boost::shared_ptr<const Comm
void UserRequestHandlerGroup::handleGroupUpdateRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
application->getUserManager()->updateGroup(packet->get<unsigned long>("origGid"),
@@ -354,7 +354,7 @@ void UserRequestHandlerGroup::handleGroupUpdateRequest(boost::shared_ptr<const C
void UserRequestHandlerGroup::handleGroupDeleteRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
application->getUserManager()->deleteGroup(packet->get<unsigned long>("gid"));
@@ -365,7 +365,7 @@ void UserRequestHandlerGroup::handleGroupDeleteRequest(boost::shared_ptr<const C
void UserRequestHandlerGroup::handleAddUserToGroupRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
application->getUserManager()->addUserToGroup(packet->get<unsigned long>("uid"), packet->get<unsigned long>("gid"));
@@ -375,7 +375,7 @@ void UserRequestHandlerGroup::handleAddUserToGroupRequest(boost::shared_ptr<cons
void UserRequestHandlerGroup::handleDeleteUserFromGroupRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
application->getUserManager()->deleteUserFromGroup(packet->get<unsigned long>("uid"), packet->get<unsigned long>("gid"));
@@ -385,7 +385,7 @@ void UserRequestHandlerGroup::handleDeleteUserFromGroupRequest(boost::shared_ptr
void UserRequestHandlerGroup::handlePasswordSetRequest(boost::shared_ptr<const Common::XmlPacket> packet, Common::XmlPacket *ret,
Common::Connection *connection) {
- if(!application->getConnectionManager()->isAuthenticated(connection))
+ if(!connection->isAuthenticated())
throw(Core::Exception(Core::Exception::PERMISSION));
application->getUserManager()->setPassword(packet->get<unsigned long>("uid"), packet->get<const std::string&>("password"));