X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Fmv%2Fplugins%2Froundcube_db.rb;fp=lib%2Fmv%2Fplugins%2Froundcube_db.rb;h=0000000000000000000000000000000000000000;hp=fa29aa6a6e67bdda9817bb6e5ee292a68950bc5f;hb=7f8654ed6582062a295e1be75ae70e99de41b323;hpb=bd2dabf89ab277fbe315b05e6dfa839afb5ce5ef diff --git a/lib/mv/plugins/roundcube_db.rb b/lib/mv/plugins/roundcube_db.rb deleted file mode 100644 index fa29aa6..0000000 --- a/lib/mv/plugins/roundcube_db.rb +++ /dev/null @@ -1,41 +0,0 @@ -require 'pg' - -require 'common/roundcube_db_plugin' -require 'mv/mv_plugin' - -class RoundcubeDbMv - - include RoundcubeDbPlugin - include MvPlugin - - - def mv_domain(from, to) - # Roundcube doesn't have a concept of domains. - end - - def mv_account(from, to) - sql_queries = ['UPDATE users SET username = $1 WHERE username = $2;'] - - begin - connection = PGconn.connect(@db_host, - @db_port, - @db_opts, - @db_tty, - @db_name, - @db_user, - @db_pass) - - sql_queries.each do |sql_query| - connection.query(sql_query, [to, from]) - end - - connection.close() - - rescue PGError => e - # Pretend like we're database-agnostic in case we ever are. - raise DatabaseError.new(e) - end - - end - -end