You are here

function ldap_user_update_8302 in Lightweight Directory Access Protocol (LDAP) 8.3

Same name and namespace in other branches
  1. 8.4 ldap_user/ldap_user.install \ldap_user_update_8302()

Drop ldap_user_identities table.

File

ldap_user/ldap_user.install, line 75
Install, update and uninstall functions for the LDAP User module.

Code

function ldap_user_update_8302(&$sandbox) {

  // Check for externalauth module (which has been a dependency for ages).
  if (!\Drupal::moduleHandler()
    ->moduleExists('externalauth')) {
    $external_link = Url::fromUri('https://drupal.org/project/externalauth');
    $message = t('Please install the 8301 %external_link module.', [
      '%external_link' => \Drupal::l('External Auth', $external_link),
    ]);
    drupal_set_message($message, "error");
    throw new UpdateException($message);
  }

  // Drop the table if it exists.
  try {
    db_query("DROP TABLE {ldap_user_identities}");
  } catch (Exception $e) {
    drupal_set_message(t("Couldn't drop the table 'ldap_user_identities'. Maybe it's been dropped already?"), "warning");
  }
}