From: Michael Orlitzky Date: Mon, 18 Mar 2013 23:50:59 +0000 (-0400) Subject: Ignore the DAViCal superuser. X-Git-Tag: 0.0.1~99 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=193830c933ffd45001bc52849d0068d435303fa6;p=mailshears.git Ignore the DAViCal superuser. --- diff --git a/lib/mailshears/plugins/davical.rb b/lib/mailshears/plugins/davical.rb index 8f6be66..964bcb0 100644 --- a/lib/mailshears/plugins/davical.rb +++ b/lib/mailshears/plugins/davical.rb @@ -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')