diff options
Diffstat (limited to 'src/Common/Backends')
-rw-r--r-- | src/Common/Backends/NetworkUserBackend.cpp | 20 | ||||
-rw-r--r-- | src/Common/Backends/NetworkUserBackend.h | 2 |
2 files changed, 22 insertions, 0 deletions
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<const std::set<unsigned long> > NetworkUserBackend::getGroupUs return userList; } +boost::shared_ptr<const std::multimap<unsigned long, unsigned long> > NetworkUserBackend::getFullUserGroupList() throw(Core::Exception) { + boost::shared_ptr<SimpleUserRequest> request(new SimpleUserRequest(application, "GetFullUserGroupList")); + application->getRequestManager()->sendRequest(connection, request); + request->wait(); + + std::pair<boost::shared_ptr<const XmlPacket>, Core::Exception> result = request->getResult(); + if(!result.first || result.second) + throw result.second; + + boost::shared_ptr<std::multimap<unsigned long, unsigned long> > ret(new std::multimap<unsigned long, unsigned long>); + + 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<unsigned long>("uid"), entry->get<unsigned long>("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<const GroupInfo> getGroupInfoByName(const std::string &name) throw(Core::Exception); virtual boost::shared_ptr<const std::set<unsigned long> > getGroupUserList(unsigned long gid) throw(Core::Exception); + virtual boost::shared_ptr<const std::multimap<unsigned long, unsigned long> > 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); |