From 86e5f80837ad55932f2469d79d9e6b6bb07cf5ed Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 28 Sep 2009 19:09:22 +0200 Subject: Implemented new ConfigManager --- .../UserConfigBackendKrb5.cpp | 43 +++------------------- .../UserConfigBackendKrb5/UserConfigBackendKrb5.h | 3 +- 2 files changed, 7 insertions(+), 39 deletions(-) (limited to 'src/modules/UserConfigBackendKrb5') 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 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 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); -- cgit v1.2.3