summaryrefslogtreecommitdiffstats
path: root/src/Common/UserManager.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-07-09 20:56:25 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-07-09 20:56:25 +0200
commit912886f565f13bfb678232b3098543a6b9d3af1f (patch)
treed2bbc716b87ccb2492cc9e8703e00025cf27ff33 /src/Common/UserManager.cpp
parent16904a791b67b8486afabf467719d6900a1b77d2 (diff)
downloadmad-912886f565f13bfb678232b3098543a6b9d3af1f.tar
mad-912886f565f13bfb678232b3098543a6b9d3af1f.zip
UserManager, UserBackend, UserCache: updateUser, addGroup und updateGroup hinzugefügt
Diffstat (limited to 'src/Common/UserManager.cpp')
-rw-r--r--src/Common/UserManager.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/Common/UserManager.cpp b/src/Common/UserManager.cpp
index 0ccf314..c53a2af 100644
--- a/src/Common/UserManager.cpp
+++ b/src/Common/UserManager.cpp
@@ -241,5 +241,56 @@ void UserManager::addUser(const UserInfo &userInfo) throw(Core::Exception) {
throw Core::Exception(Core::Exception::NOT_IMPLEMENTED);
}
+void UserManager::updateUser(unsigned long uid, const UserInfo &userInfo) throw(Core::Exception) {
+ boost::lock_guard<boost::shared_mutex> lock(mutex);
+
+ for(BackendMap::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
+ try {
+ backend->second->updateUser(uid, userInfo);
+ 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);
+
+ for(BackendMap::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
+ try {
+ backend->second->addGroup(groupInfo);
+ return;
+ }
+ catch(Core::Exception e) {
+ if(e.getErrorCode() != Core::Exception::NOT_IMPLEMENTED)
+ throw e;
+ }
+ }
+
+ throw Core::Exception(Core::Exception::NOT_IMPLEMENTED);
+}
+
+void UserManager::updateGroup(unsigned long gid, const GroupInfo &groupInfo) throw(Core::Exception) {
+ boost::lock_guard<boost::shared_mutex> lock(mutex);
+
+ for(BackendMap::iterator backend = backends.begin(); backend != backends.end(); ++backend) {
+ try {
+ backend->second->updateGroup(gid, groupInfo);
+ return;
+ }
+ catch(Core::Exception e) {
+ if(e.getErrorCode() != Core::Exception::NOT_IMPLEMENTED)
+ throw e;
+ }
+ }
+
+ throw Core::Exception(Core::Exception::NOT_IMPLEMENTED);
+}
+
}
}