]> gitweb.michael.orlitzky.com - mailshears.git/commitdiff
Ignore the DAViCal superuser.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 18 Mar 2013 23:50:59 +0000 (19:50 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 18 Mar 2013 23:50:59 +0000 (19:50 -0400)
lib/mailshears/plugins/davical.rb

index 8f6be66959da76d31d6a0e2b26db59ecd613a6f5..964bcb07eeb81a3018b5eacc3d680716e53f0e9a 100644 (file)
@@ -1,7 +1,10 @@
 require 'pg'
 
 class DavicalDb
-
+  #
+  # DAViCal only supports Postgres, so even if we ever are
+  # database-agnostic, this plugin can't be.
+  #
   include Plugin
 
   def initialize()
@@ -116,7 +119,6 @@ class DavicalDb
   def get_davical_usernames()
     usernames = []
 
-    # Just assume PostgreSQL for now.
     begin
       connection = PGconn.connect(@db_host,
                                   @db_port,
@@ -126,7 +128,8 @@ class DavicalDb
                                   @db_user,
                                   @db_pass)
 
-      sql_query  = 'SELECT username FROM usr;'
+      # User #1 is the super-user, and not tied to an email address.
+      sql_query  = 'SELECT username FROM usr WHERE user_no > 1;'
 
       connection.query(sql_query) do |result|
         usernames = result.field_values('username')