function disable() { global $db; require_once mnminclude . 'avatars.php'; require_once mnminclude . 'geo.php'; avatars_db_remove($this->id); avatars_remove_user_files($this->id); geo_delete('user', $this->id); // Delete relationships $db->query("DELETE FROM friends WHERE friend_type='manual' and (friend_from = {$this->id} or friend_to = {$this->id})"); // Delete preferences $db->query("DELETE FROM prefs WHERE pref_user_id = {$this->id}"); $this->username = '******' . $this->id . '--'; $this->email = "{$this->id}@disabled"; $this->url = ''; $this->level = 'disabled'; $this->names = 'disabled'; $this->public_info = ''; $this->adcode = ''; $this->adchannel = ''; $this->phone = ''; $this->avatar = 0; $this->karma = 6; return $this->store(); }
function disable($auto = false) { global $db; require_once mnminclude . 'avatars.php'; require_once mnminclude . 'geo.php'; avatars_remove($this->id); geo_delete('user', $this->id); $this->username = '******' . $this->id . '--'; $this->email = "{$this->id}@disabled"; $this->url = ''; if ($auto) { $this->level = 'autodisabled'; } else { $this->level = 'disabled'; } $this->names = 'disabled'; $this->public_info = ''; $this->adcode = ''; $this->adchannel = ''; $this->phone = ''; $this->avatar = 0; $this->karma = 6; $this->store(); syslog(LOG_INFO, "User disabled: {$this->id}"); // Delete relationships $db->query("DELETE FROM friends WHERE friend_type='manual' and (friend_from = {$this->id} or friend_to = {$this->id})"); /* // Delete posts' conversations $db->query("delete from conversations where conversation_type = 'post' and conversation_user_to = $this->id"); $db->transaction(); $conv = $db->get_col("select post_id from posts where post_user_id = $this->id"); if ($conv) { foreach ($conv as $id) { $db->query("delete from conversations where conversation_type = 'post' and conversation_from = $id"); } } $db->commit(); */ // Delete posts $db->query("delete from posts where post_user_id = {$this->id}"); // Delete user's meta $db->query("delete from annotations where annotation_key = 'user_meta-{$this->id}'"); // Delete preferences $db->query("DELETE FROM prefs WHERE pref_user_id = {$this->id}"); return true; }
function disable($auto = false) { global $db; require_once(mnminclude.'avatars.php'); require_once(mnminclude.'geo.php'); avatars_remove($this->id); geo_delete('user', $this->id); // Delete relationships $db->query("DELETE FROM friends WHERE friend_type='manual' and (friend_from = $this->id or friend_to = $this->id)"); // Delete preferences $db->query("DELETE FROM prefs WHERE pref_user_id = $this->id"); // Delete posts $db->query("delete from posts where post_user_id = $this->id"); $this->username = '******'.$this->id.'--'; $this->email = "$this->id@disabled"; $this->url = ''; if ($auto) $this->level = 'autodisabled'; else $this->level = 'disabled'; $this->names = 'disabled'; $this->public_info = ''; $this->adcode = ''; $this->adchannel = ''; $this->phone = ''; $this->avatar = 0; $this->karma = 6; return $this->store(); }
stats_increment('ajax'); if (!($id = intval($_REQUEST['id']))) { error(_('falta el id') . " {$link}"); } $type = $_REQUEST['type']; if ($type == 'user') { if ($id != $current_user->user_id) { error(_('usuario incorrecto')); } } elseif ($type == 'link') { $link = new Link(); $link->id = $id; if (!$link->read()) { error(_('Artículo inexistente')); } if (!$link->is_map_editable()) { error(_("noticia no modificable")); } } else { error(_('tipo incorrecto')); } if (geo_delete($type, $id)) { echo "OK"; } else { error(_('borrado anteriormente')); } function error($mess) { echo "ERROR: {$mess}\n"; die; }