]>
gitweb.michael.orlitzky.com - mailshears.git/blob - lib/rm/plugins/agendav.rb
3 require 'common/agendav_plugin'
12 def delete_domain(domain
)
13 # AgenDAV doesn't have a concept of domains.
16 def delete_account(account
)
17 # Delete the given username and any records in other tables
20 sql_queries
= ['DELETE FROM prefs WHERE username = $1;']
21 sql_queries
<< 'DELETE FROM shared WHERE user_from = $1;'
24 connection
= PGconn
.connect(@db_host,
32 sql_queries
.each
do |sql_query
|
33 connection
.query(sql_query
, [account
])
39 # Pretend like we're database-agnostic in case we ever are.
40 raise DatabaseError
.new(e
)
46 def get_domain_usernames(domain
)
47 usernames
= get_agendav_usernames();
48 matches
= usernames
.select
do |username
|
49 username
=~
/@#{domain}$/