You are here

function simplesamlphp_auth_uninstall in simpleSAMLphp Authentication 6.2

Same name and namespace in other branches
  1. 8.3 simplesamlphp_auth.install \simplesamlphp_auth_uninstall()
  2. 6.3 simplesamlphp_auth.install \simplesamlphp_auth_uninstall()
  3. 7.3 simplesamlphp_auth.install \simplesamlphp_auth_uninstall()
  4. 7 simplesamlphp_auth.install \simplesamlphp_auth_uninstall()
  5. 7.2 simplesamlphp_auth.install \simplesamlphp_auth_uninstall()

Implementation of hook_uninstall().

File

./simplesamlphp_auth.install, line 47
the install file for the simplesamlphp_auth module

Code

function simplesamlphp_auth_uninstall() {

  //Show Login block by default
  $query1 = db_query("UPDATE {blocks} SET status='1' WHERE module='user' AND delta='0'");

  //Restore Logout from the menu by default

  //$query2 = db_query("UPDATE {menu} SET type=54 WHERE path='logout'");

  //Restore the original user registration directive
  $original = variable_get("simplesamlphp_auth_user_register_original", "1");
  variable_set("user_register", $original);
  variable_del("simplesamlphp_auth_user_register_original");

  //Remove the created system variables
  variable_del('simplesamlphp_auth_activate');
  variable_del("simplesamlphp_auth_installdir");
  variable_del("simplesamlphp_auth_logout_page");
  variable_del("simplesamlphp_auth_mailattr");
  variable_del("simplesamlphp_auth_unique_id");
  variable_del("simplesamlphp_auth_user_name");
  variable_del("simplesamlphp_auth_authsource");
  variable_del("simplesamlphp_auth_rolepopulation");
  variable_del("simplesamlphp_auth_roleevaleverytime");
  variable_del("simplesamlphp_auth_forcehttps");
  variable_del("simplesamlphp_auth_registerusers");
  variable_del("simplesamlphp_auth_allowdefaultlogin");
  variable_del("simplesamlphp_auth_allowdefaultloginusers");
  if ($query1) {
    drupal_set_message('The simpleSAMLphp authentication module was uninstalled successfully.');
  }
  else {
    drupal_set_message('There was an error removing the simpleSAMLphp authentication database tables.', 'error');
  }
}