summaryrefslogtreecommitdiffstats
path: root/src/Server/UserManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Server/UserManager.cpp')
-rw-r--r--src/Server/UserManager.cpp80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/Server/UserManager.cpp b/src/Server/UserManager.cpp
index 7101b2c..e38f458 100644
--- a/src/Server/UserManager.cpp
+++ b/src/Server/UserManager.cpp
@@ -66,6 +66,38 @@ boost::shared_ptr<Common::UserInfo> UserManager::getUserInfo(unsigned long uid)
throw e;
}
+boost::shared_ptr<Common::UserInfo> UserManager::getUserInfoByName(const std::string &name) throw(Net::Exception) {
+ Net::Exception e(Net::Exception::NOT_IMPLEMENTED);
+
+ for(std::set<boost::shared_ptr<UserBackend> >::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
+ try {
+ return (*backend)->getUserInfoByName(name);
+ }
+ catch(Net::Exception e2) {
+ if(e.getErrorCode() == Net::Exception::NOT_IMPLEMENTED && e2.getErrorCode() != Net::Exception::NOT_IMPLEMENTED)
+ e = e2;
+ }
+ }
+
+ throw e;
+}
+
+boost::shared_ptr<std::set<unsigned long> > UserManager::getUserGroups(unsigned long uid) throw(Net::Exception) {
+ Net::Exception e(Net::Exception::NOT_IMPLEMENTED);
+
+ for(std::set<boost::shared_ptr<UserBackend> >::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
+ try {
+ return (*backend)->getUserGroups(uid);
+ }
+ catch(Net::Exception e2) {
+ if(e.getErrorCode() == Net::Exception::NOT_IMPLEMENTED && e2.getErrorCode() != Net::Exception::NOT_IMPLEMENTED)
+ e = e2;
+ }
+ }
+
+ throw e;
+}
+
boost::shared_ptr<std::map<unsigned long, Common::GroupInfo> > UserManager::getGroupList() throw(Net::Exception) {
Net::Exception e(Net::Exception::NOT_IMPLEMENTED);
@@ -82,6 +114,54 @@ boost::shared_ptr<std::map<unsigned long, Common::GroupInfo> > UserManager::getG
throw e;
}
+std::string UserManager::getGroupName(unsigned long gid) throw(Net::Exception) {
+ Net::Exception e(Net::Exception::NOT_IMPLEMENTED);
+
+ for(std::set<boost::shared_ptr<UserBackend> >::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
+ try {
+ return (*backend)->getGroupName(gid);
+ }
+ catch(Net::Exception e2) {
+ if(e.getErrorCode() == Net::Exception::NOT_IMPLEMENTED && e2.getErrorCode() != Net::Exception::NOT_IMPLEMENTED)
+ e = e2;
+ }
+ }
+
+ throw e;
+}
+
+unsigned long UserManager::getGroupId(const std::string &name) throw(Net::Exception) {
+ Net::Exception e(Net::Exception::NOT_IMPLEMENTED);
+
+ for(std::set<boost::shared_ptr<UserBackend> >::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
+ try {
+ return (*backend)->getGroupId(name);
+ }
+ catch(Net::Exception e2) {
+ if(e.getErrorCode() == Net::Exception::NOT_IMPLEMENTED && e2.getErrorCode() != Net::Exception::NOT_IMPLEMENTED)
+ e = e2;
+ }
+ }
+
+ throw e;
+}
+
+boost::shared_ptr<std::set<unsigned long> > UserManager::getGroupUsers(unsigned long gid) throw(Net::Exception) {
+ Net::Exception e(Net::Exception::NOT_IMPLEMENTED);
+
+ for(std::set<boost::shared_ptr<UserBackend> >::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
+ try {
+ return (*backend)->getGroupUsers(gid);
+ }
+ catch(Net::Exception e2) {
+ if(e.getErrorCode() == Net::Exception::NOT_IMPLEMENTED && e2.getErrorCode() != Net::Exception::NOT_IMPLEMENTED)
+ e = e2;
+ }
+ }
+
+ throw e;
+}
+
void UserManager::setPassword(unsigned long uid, const std::string &password) throw(Net::Exception) {
Net::Exception e(Net::Exception::NOT_IMPLEMENTED);