diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-07-10 01:37:53 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-07-10 01:37:53 +0200 |
commit | 5bf8b6ce656ffe0740ec116057577044e3925887 (patch) | |
tree | 90a7563d5a51b87a82c4fdb8f0a0c8b45ef6e8d0 /src/Common/UserManager.cpp | |
parent | 1afb432ee5c55181bd918c038d0372479355f04b (diff) | |
download | mad-5bf8b6ce656ffe0740ec116057577044e3925887.tar mad-5bf8b6ce656ffe0740ec116057577044e3925887.zip |
UserManager, UserBackend, UserCache: deleteUser und deleteGroup hinzugefügt
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 ae8f3b2..14451aa 100644 --- a/src/Common/UserManager.cpp +++ b/src/Common/UserManager.cpp @@ -258,6 +258,23 @@ void UserManager::updateUser(unsigned long uid, const UserInfo &userInfo) throw( throw Core::Exception(Core::Exception::NOT_IMPLEMENTED); } +void UserManager::deleteUser(unsigned long uid) throw(Core::Exception) { + boost::lock_guard<boost::shared_mutex> lock(mutex); + + for(BackendMap::iterator backend = backends.begin(); backend != backends.end(); ++backend) { + try { + backend->second->deleteUser(uid); + return; + } + catch(Core::Exception e) { + if(e.getErrorCode() != Core::Exception::NOT_IMPLEMENTED) + throw e; + } + } + + throw Core::Exception(Core::Exception::NOT_IMPLEMENTED); +} + void UserManager::addGroup(const GroupInfo &groupInfo) throw(Core::Exception) { boost::lock_guard<boost::shared_mutex> lock(mutex); @@ -292,5 +309,22 @@ void UserManager::updateGroup(unsigned long gid, const GroupInfo &groupInfo) thr throw Core::Exception(Core::Exception::NOT_IMPLEMENTED); } +void UserManager::deleteGroup(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->deleteGroup(gid); + return; + } + catch(Core::Exception e) { + if(e.getErrorCode() != Core::Exception::NOT_IMPLEMENTED) + throw e; + } + } + + throw Core::Exception(Core::Exception::NOT_IMPLEMENTED); +} + } } |