Comparison

plugins/mod_storage_sql.lua @ 5040:685403a6fee1

mod_storage_sql: Add method for removing all data belonging to a user
author Kim Alvefur <zash@zash.se>
date Sat, 28 Jul 2012 21:36:42 +0200
parent 5035:874cab7b4b3e
child 5054:97385c45e670
comparison
equal deleted inserted replaced
5039:656ce68c4781 5040:685403a6fee1
368 stores[#stores+1] = row[1]; 368 stores[#stores+1] = row[1];
369 end 369 end
370 return stores; 370 return stores;
371 end 371 end
372 372
373 function driver:purge(username)
374 local stmt, err = dosql("DELETE FROM `prosody` WHERE `host`=? AND `user`=?", host, username);
375 if not stmt then return stmt, err; end
376 local changed, err = stmt:affected();
377 if not changed then return changed, err; end
378 return true, changed;
379 end
380
373 module:add_item("data-driver", driver); 381 module:add_item("data-driver", driver);