<?php
+// Included here for completeness, but this is a very dangerous operation.
+// It is the caller's responsibility to confirm the requestor's intent and
+// authorisation to do this.
+
+function user_remove($uid) {
+ q("DELETE FROM `contact` WHERE `uid` = %d", intval($uid));
+ q("DELETE FROM `group` WHERE `uid` = %d", intval($uid));
+ q("DELETE FROM `group_member` WHERE `uid` = %d", intval($uid));
+ q("DELETE FROM `intro` WHERE `uid` = %d", intval($uid));
+ q("DELETE FROM `item` WHERE `uid` = %d", intval($uid));
+ q("DELETE FROM `mail` WHERE `uid` = %d", intval($uid));
+ q("DELETE FROM `photo` WHERE `uid` = %d", intval($uid));
+ q("DELETE FROM `profile` WHERE `uid` = %d", intval($uid));
+ q("DELETE FROM `profile_check` WHERE `uid` = %d", intval($uid));
+ q("DELETE FROM `user` WHERE `uid` = %d", intval($uid));
+ if($uid == local_user()) {
+ unset($_SESSION['authenticated']);
+ unset($_SESSION['uid']);
+ killme();
+ }
+}
function contact_remove($id) {
q("DELETE FROM `photo` WHERE `contact-id` = %d ",
intval($id)
);
+ q("DELETE FROM `mail` WHERE `contact-id` = %d ",
+ intval($id)
+ );
}
if(! function_exists('unmark_for_death')) {
function unmark_for_death($contact) {
// It's a miracle. Our dead contact has inexplicably come back to life.
- q("UPDATE `contact` SET `term-date = '%s' WHERE `id` = %d LIMIT 1",
+ q("UPDATE `contact` SET `term-date` = '%s' WHERE `id` = %d LIMIT 1",
dbesc('0000-00-00 00:00:00'),
intval($contact['id'])
);