summaryrefslogtreecommitdiffstats
path: root/src/modules/UserConfigBackendKrb5
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-09-28 19:09:22 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-09-28 19:09:22 +0200
commit86e5f80837ad55932f2469d79d9e6b6bb07cf5ed (patch)
tree818ab757a8ae964751190daad5a7fd2cd8f21a04 /src/modules/UserConfigBackendKrb5
parenta7a285eb61dd83afc892bc1d64ffe14b9f1426a3 (diff)
downloadmad-86e5f80837ad55932f2469d79d9e6b6bb07cf5ed.tar
mad-86e5f80837ad55932f2469d79d9e6b6bb07cf5ed.zip
Implemented new ConfigManager
Diffstat (limited to 'src/modules/UserConfigBackendKrb5')
-rw-r--r--src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp43
-rw-r--r--src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h3
2 files changed, 7 insertions, 39 deletions
diff --git a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp
index f0c65b1..61ad996 100644
--- a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp
+++ b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp
@@ -93,46 +93,15 @@ void UserConfigBackendKrb5::_connect() {
return;
}
-bool UserConfigBackendKrb5::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handled*/) {
- if(!entry[0].getKey().matches("UserManager"))
- return false;
-
- if(entry[1].isEmpty())
- return true;
-
- if(!entry[1].getKey().matches("Krb5"))
- return false;
-
+void UserConfigBackendKrb5::configure() {
boost::lock_guard<boost::mutex> lock(mutex);
- if(entry[2].getKey().matches("Realm")) {
- if(entry[3].isEmpty())
- realm = entry[2][0];
- }
- else if(entry[2].getKey().matches("Principal")) {
- if(entry[3].isEmpty())
- principal = entry[2][0];
- }
- else if(entry[2].getKey().matches("Server")) {
- if(entry[3].isEmpty())
- server = entry[2][0];
- }
- else if(entry[2].getKey().matches("Password")) {
- if(entry[3].isEmpty())
- password = entry[2][0];
- }
- else if(entry[2].getKey().matches("Keytab")) {
- if(entry[3].isEmpty())
- keytab = entry[2][0];
- }
- else if(!entry[2].isEmpty())
- return false;
+ realm = application->getConfigManager()->get("UserManager.Krb5.Realm", realm);
+ principal = application->getConfigManager()->get("UserManager.Krb5.Principal");
+ server = application->getConfigManager()->get("UserManager.Krb5.Server");
+ password = application->getConfigManager()->get("UserManager.Krb5.Password");
+ keytab = application->getConfigManager()->get("UserManager.Krb5.Keytab");
- return true;
-}
-
-void UserConfigBackendKrb5::configFinished() {
- boost::lock_guard<boost::mutex> lock(mutex);
_connect();
}
diff --git a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h
index eab8be4..64f8501 100644
--- a/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h
+++ b/src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h
@@ -50,8 +50,7 @@ class UserConfigBackendKrb5 : public Common::UserConfigBackend, private Core::Co
void _connect();
protected:
- virtual bool handleConfigEntry(const Core::ConfigEntry &entry, bool handled);
- virtual void configFinished();
+ virtual void configure();
virtual void checkUserInfo(const Common::UserInfo &userInfo) throw(Core::Exception);