You are here

function restrict_by_ip_uninstall in Restrict Login or Role Access by IP Address 5

Same name and namespace in other branches
  1. 6.3 restrict_by_ip.install \restrict_by_ip_uninstall()
  2. 6 restrict_by_ip.install \restrict_by_ip_uninstall()
  3. 6.2 restrict_by_ip.install \restrict_by_ip_uninstall()
  4. 7.3 restrict_by_ip.install \restrict_by_ip_uninstall()

Implementation of hook_uninstall().

File

./restrict_by_ip.install, line 35

Code

function restrict_by_ip_uninstall() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("DROP TABLE {restrict_by_ip}");
      break;
    case 'pgsql':
      db_query("DROP TABLE {restrict_by_ip}");
      break;
  }

  // clear the cache tables (see http://drupal.org/node/64279#comment-211282)
  cache_clear_all('*', 'cache', TRUE);
  cache_clear_all('*', 'cache_filter', TRUE);
  cache_clear_all('*', 'cache_menu', TRUE);
  cache_clear_all('*', 'cache_page', TRUE);
  watchdog('restrict_by_ip', 'restrict_by_ip module removed');
}