You are here

function userprotect_uninstall in User protect 5

Same name and namespace in other branches
  1. 6 userprotect.install \userprotect_uninstall()
  2. 7 userprotect.install \userprotect_uninstall()

Implementation of hook_uninstall().

File

./userprotect.install, line 69

Code

function userprotect_uninstall() {
  if (db_table_exists('userprotect')) {
    $query1 = db_query('DROP TABLE {userprotect}');
  }
  variable_del('userprotect_protection_defaults');
  variable_del('userprotect_autoprotect');
  variable_del('userprotect_administrator_bypass_defaults');
  variable_del('userprotect_role_protections');
  if ($query1) {
    drupal_set_message('The User Protect module was uninstalled successfully.');
  }
  else {
    drupal_set_message('There was an error removing the User Protect database tables.', 'error');
  }
}