]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/common/agendav_plugin.rb
Replace 'account' with 'user' everywhere.
[mailshears.git] / lib / common / agendav_plugin.rb
index fad869f95235964884d58635a465d670cde7b455..7522b2cfce630a7340b69fadd5d7279ea4b9ffd9 100644 (file)
@@ -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
@@ -20,13 +19,13 @@ module AgendavPlugin
 
   def describe_domain(domain)
     # AgenDAV doesn't have a concept of domains.
-    return 'N/A'
+    return domain
   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
@@ -35,12 +34,8 @@ module AgendavPlugin
 
   protected;
 
-  def user_exists(account)
-    ad_users = get_agendav_usernames()
-    return ad_users.include?(account)
-  end
 
-  def get_agendav_usernames()
+  def list_users()
     usernames = []
 
     # Just assume PostgreSQL for now.