X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Fcommon%2Fagendav_plugin.rb;h=ae9b11c0b05d89874ebdc6dedbc2e85af36c6b89;hp=cb445bed817d853c3b91c3e3c75c2735330614cc;hb=861e51dd6a409cb41fa6fdac3f49195acccc6541;hpb=483d14dc8228a81d12fb109d3ed6510e2d2b03c1 diff --git a/lib/common/agendav_plugin.rb b/lib/common/agendav_plugin.rb index cb445be..ae9b11c 100644 --- a/lib/common/agendav_plugin.rb +++ b/lib/common/agendav_plugin.rb @@ -6,8 +6,7 @@ module AgendavPlugin include Plugin - def initialize() - cfg = Configuration.new() + def initialize(cfg) @db_host = cfg.agendav_dbhost @db_port = cfg.agendav_dbport @db_opts = cfg.agendav_dbopts @@ -24,23 +23,20 @@ module AgendavPlugin end - def describe_account(account) - if self.user_exists(account) - return "Username: #{account}" + def describe_user(user) + if self.user_exists(user) + return "Username: #{user}" else return 'User not found' end end - protected; - - def user_exists(account) - ad_users = list_users() - return ad_users.include?(account) - end - def list_users() + # + # Produce a list of AgenDAV users. This is public because it's + # useful in testing. + # usernames = [] # Just assume PostgreSQL for now.