From c9c2e1401bae1938fe392f6ee0903939b63b050c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 30 Jun 2009 22:57:29 +0200 Subject: =?UTF-8?q?UserManager=20erweitert=20Erm=C3=B6gliche=20Caching=20d?= =?UTF-8?q?er=20User-Group-Zuordnungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/Backends/NetworkUserBackend.cpp | 20 ++++++++++++++++++++ src/Common/Backends/NetworkUserBackend.h | 2 ++ 2 files changed, 22 insertions(+) (limited to 'src/Common/Backends') diff --git a/src/Common/Backends/NetworkUserBackend.cpp b/src/Common/Backends/NetworkUserBackend.cpp index 81fc94a..f75783c 100644 --- a/src/Common/Backends/NetworkUserBackend.cpp +++ b/src/Common/Backends/NetworkUserBackend.cpp @@ -188,6 +188,26 @@ boost::shared_ptr > NetworkUserBackend::getGroupUs return userList; } +boost::shared_ptr > NetworkUserBackend::getFullUserGroupList() throw(Core::Exception) { + boost::shared_ptr request(new SimpleUserRequest(application, "GetFullUserGroupList")); + application->getRequestManager()->sendRequest(connection, request); + request->wait(); + + std::pair, Core::Exception> result = request->getResult(); + if(!result.first || result.second) + throw result.second; + + boost::shared_ptr > ret(new std::multimap); + + const XmlPacket::List *list = result.first->getList("userGroupList"); + if(list) { + for(XmlPacket::List::const_iterator entry = list->begin(); entry != list->end(); ++entry) + ret->insert(std::make_pair(entry->get("uid"), entry->get("gid"))); + } + + return ret; +} + /*void NetworkUserBackend::setPassword(unsigned long uid, const std::string &password) throw(Core::Exception) { diff --git a/src/Common/Backends/NetworkUserBackend.h b/src/Common/Backends/NetworkUserBackend.h index c569ab6..66be909 100644 --- a/src/Common/Backends/NetworkUserBackend.h +++ b/src/Common/Backends/NetworkUserBackend.h @@ -77,6 +77,8 @@ class NetworkUserBackend : public UserBackend { virtual boost::shared_ptr getGroupInfoByName(const std::string &name) throw(Core::Exception); virtual boost::shared_ptr > getGroupUserList(unsigned long gid) throw(Core::Exception); + virtual boost::shared_ptr > getFullUserGroupList() throw(Core::Exception); + //virtual void setPassword(unsigned long uid, const std::string &password) throw(Core::Exception); //virtual void addUser(const UserInfo &userInfo) throw(Core::Exception); -- cgit v1.2.3