diff options
Diffstat (limited to 'src/modules/UserConfigBackendKrb5')
-rw-r--r-- | src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.cpp | 43 | ||||
-rw-r--r-- | src/modules/UserConfigBackendKrb5/UserConfigBackendKrb5.h | 3 |
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); |