diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-07-11 01:11:21 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-07-11 01:11:21 +0200 |
commit | bf4c6ec2b7694f1a844eef5989b77e83a8cab362 (patch) | |
tree | a407ccab48195d61d4e04ccf8581b1328fd08e72 /src/Common/UserManager.cpp | |
parent | b8aa377d883c316f544274dd24db9f079fb8f02a (diff) | |
download | mad-bf4c6ec2b7694f1a844eef5989b77e83a8cab362.tar mad-bf4c6ec2b7694f1a844eef5989b77e83a8cab362.zip |
Befehle add_user_to_group und delete_user_from_group implementiert
Diffstat (limited to 'src/Common/UserManager.cpp')
-rw-r--r-- | src/Common/UserManager.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Common/UserManager.cpp b/src/Common/UserManager.cpp index 14451aa..928289b 100644 --- a/src/Common/UserManager.cpp +++ b/src/Common/UserManager.cpp @@ -326,5 +326,39 @@ void UserManager::deleteGroup(unsigned long gid) throw(Core::Exception) { throw Core::Exception(Core::Exception::NOT_IMPLEMENTED); } +void UserManager::addUserToGroup(unsigned long uid, unsigned long gid) throw(Core::Exception) { + boost::lock_guard<boost::shared_mutex> lock(mutex); + + for(BackendMap::iterator backend = backends.begin(); backend != backends.end(); ++backend) { + try { + backend->second->addUserToGroup(uid, gid); + return; + } + catch(Core::Exception e) { + if(e.getErrorCode() != Core::Exception::NOT_IMPLEMENTED) + throw e; + } + } + + throw Core::Exception(Core::Exception::NOT_IMPLEMENTED); +} + +void UserManager::deleteUserFromGroup(unsigned long uid, unsigned long gid) throw(Core::Exception) { + boost::lock_guard<boost::shared_mutex> lock(mutex); + + for(BackendMap::iterator backend = backends.begin(); backend != backends.end(); ++backend) { + try { + backend->second->deleteUserFromGroup(uid, gid); + return; + } + catch(Core::Exception e) { + if(e.getErrorCode() != Core::Exception::NOT_IMPLEMENTED) + throw e; + } + } + + throw Core::Exception(Core::Exception::NOT_IMPLEMENTED); +} + } } |