You are here

function multiple_registration_uninstall in Multiple Registration 7

Implements hook_uninstall().

File

./multiple_registration.install, line 10
Installation file multiple_registration.

Code

function multiple_registration_uninstall() {
  $roles = user_roles();
  ksort($roles);

  // Include only custom created roles.
  $allowed_roles = array_keys(array_slice($roles, 3, NULL, TRUE));
  if ($allowed_roles) {
    foreach ($allowed_roles as $rid) {
      if ($source = variable_get('multiple_registration_url_' . $rid, '')) {
        db_delete('url_alias')
          ->condition('source', $source)
          ->execute();
        variable_del('multiple_registration_url_registration_path_' . $rid);
        variable_del('multiple_registration_url_' . $rid);
      }
    }
  }
}