forlifeEmail()); // TODO: clear profile. $tables_to_clear = array('uid' => array('profile_skills', 'profile_job', 'profile_langskills', 'profile_mentor_country', 'profile_mentor_sector', 'profile_mentor', 'perte_pass', 'watch_sub'), 'user_id' => array('requests', 'user_changes')); if ($really_del) { array_push($tables_to_clear['uid'], 'emails', 'group_members', 'contacts', 'adresses', 'profile_phones', 'photo', 'perte_pass', 'profile_langskills', 'forum_subs', 'forum_profiles'); array_push($tables_to_clear['user_id'], 'newsletter_ins', 'profile_binets'); $tables_to_clear['id'] = array('aliases'); $tables_to_clear['contact'] = array('contacts'); XDB::execute("UPDATE accounts SET registration_date = 0, state = 'pending', password = NULL, weak_password = NULL, token = NULL, is_admin = 0 WHERE uid = {?}", $uid); XDB::execute("DELETE virtual.* FROM virtual INNER JOIN virtual_redirect AS r USING(vid) WHERE redirect = {?}", $alias.'@'.$globals->mail->domain); XDB::execute("DELETE virtual.* FROM virtual INNER JOIN virtual_redirect AS r USING(vid) WHERE redirect = {?}", $alias.'@'.$globals->mail->domain2); } else { XDB::execute("UPDATE accounts SET password = NULL, weak_password = NULL, token = NULL WHERE uid = {?}", $uid); } XDB::execute("DELETE FROM virtual_redirect WHERE redirect = {?}", $alias.'@'.$globals->mail->domain); XDB::execute("DELETE FROM virtual_redirect WHERE redirect = {?}", $alias.'@'.$globals->mail->domain2); /* TODO: handle both account and profile foreach ($tables_to_clear as $key=>&$tables) { foreach ($tables as $table) { XDB::execute("DELETE FROM $table WHERE $key={?}", $uid); } }*/ $mmlist = new MMList($user); $mmlist->kill($alias, $really_del); // Deactivates, when available, the Google Apps account of the user. if ($globals->mailstorage->googleapps_domain) { require_once 'googleapps.inc.php'; if (GoogleAppsAccount::account_status($uid)) { $account = new GoogleAppsAccount($user); $account->suspend(); } } } // }}} // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>