]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/common/roundcube_plugin.rb
Replace 'account' with 'user' everywhere.
[mailshears.git] / lib / common / roundcube_plugin.rb
index 8e9d62259d78fd9819bc2ef77bc97c3c2b0fa96c..0f80f72dd5ab33bad582fe15298aa4287f7e4ed7 100644 (file)
@@ -5,8 +5,7 @@ module RoundcubePlugin
   # That is, we implement the Plugin interface.
   include Plugin
 
   # That is, we implement the Plugin interface.
   include Plugin
 
-  def initialize()
-    cfg = Configuration.new()
+  def initialize(cfg)
     @db_host = cfg.roundcube_dbhost
     @db_port = cfg.roundcube_dbport
     @db_opts = cfg.roundcube_dbopts
     @db_host = cfg.roundcube_dbhost
     @db_port = cfg.roundcube_dbport
     @db_opts = cfg.roundcube_dbopts
@@ -22,8 +21,8 @@ module RoundcubePlugin
     return domain
   end
 
     return domain
   end
 
-  def describe_account(account)
-    user_id = self.get_user_id(account)
+  def describe_user(user)
+    user_id = self.get_user_id(user)
 
     if user_id.nil?
       return 'User not found'
 
     if user_id.nil?
       return 'User not found'
@@ -35,7 +34,7 @@ module RoundcubePlugin
 
   protected;
 
 
   protected;
 
-  def get_user_id(account)
+  def get_user_id(user)
     user_id = nil
 
     begin
     user_id = nil
 
     begin
@@ -49,7 +48,7 @@ module RoundcubePlugin
 
       sql_query = "SELECT user_id FROM users WHERE username = $1;"
 
 
       sql_query = "SELECT user_id FROM users WHERE username = $1;"
 
-      connection.query(sql_query, [account]) do |result|
+      connection.query(sql_query, [user]) do |result|
         if result.num_tuples > 0
           user_id = result[0]['user_id']
         end
         if result.num_tuples > 0
           user_id = result[0]['user_id']
         end