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()
def get_davical_usernames()
usernames = []
- # Just assume PostgreSQL for now.
begin
connection = PGconn.connect(@db_host,
@db_port,
@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')