You are here

function cleantalk_uninstall in Anti Spam by CleanTalk 7.2

Same name and namespace in other branches
  1. 8.4 cleantalk.install \cleantalk_uninstall()
  2. 8 cleantalk.install \cleantalk_uninstall()
  3. 8.3 cleantalk.install \cleantalk_uninstall()
  4. 7.5 cleantalk.install \cleantalk_uninstall()
  5. 7 cleantalk.install \cleantalk_uninstall()
  6. 7.4 cleantalk.install \cleantalk_uninstall()
  7. 9.1.x cleantalk.install \cleantalk_uninstall()

Implements hook_uninstall().

File

./cleantalk.install, line 168
Install and uninstall functions for the CleanTalk module.

Code

function cleantalk_uninstall() {
  $myRoles = array(
    'spammer',
  );
  $roles = user_roles();
  foreach ($myRoles as $r) {
    if (in_array($r, $roles)) {
      user_role_delete($r);
    }
  }
  variable_del('cleantalk_automod');
  variable_del('cleantalk_comments');
  variable_del('cleantalk_authkey');
  variable_del('cleantalk_ccf');
  variable_get('cleantalk_work_url');
  variable_get('cleantalk_server_url');
  variable_get('cleantalk_server_ttl');
  variable_get('cleantalk_server_changed');
  variable_del('ct_sfw_last_logs_sent');
  variable_del('ct_sfw_last_updated');
  db_drop_table('cleantalk_timelabels');
  db_drop_table('cleantalk_cids');
  db_drop_table('cleantalk_uids');
  db_drop_table('cleantalk_sfw');
  db_drop_table('cleantalk_sfw_logs');
}