]>
gitweb.michael.orlitzky.com - mailshears.git/blob - lib/rm/plugins/agendav.rb
3 require 'common/agendav_plugin'
7 # Handle the removal of Agendav users from its database. Agendav has
8 # no concept of domains.
16 # Remove *user* from the Agendav database. This should remove him
17 # from _every_ table in which he is referenced.
19 # @param user [User] the user to remove.
22 raise NonexistentUserError
.new(user
.to_s()) if not user_exists(user
)
24 sql_queries
= ['DELETE FROM prefs WHERE username = $1;']
25 sql_queries
<< 'DELETE FROM shared WHERE user_from = $1;'
27 connection
= PG
::Connection.new(@db_hash)
29 sql_queries
.each
do |sql_query
|
30 connection
.query(sql_query
, [user
.to_s()])
33 # Make sure the connection gets closed even if a query explodes.