You are here

function ldap_authorization_ldap_server_in_use in Lightweight Directory Access Protocol (LDAP) 7

Same name and namespace in other branches
  1. 8.2 ldap_authorization/ldap_authorization.module \ldap_authorization_ldap_server_in_use()
  2. 7.2 ldap_authorization/ldap_authorization.module \ldap_authorization_ldap_server_in_use()

Implements hook_ldap_ldap_server_in_use().

File

ldap_authorization/ldap_authorization.module, line 118
ldap authorization module

Code

function ldap_authorization_ldap_server_in_use($sid, $server_name) {
  $use_warnings = array();
  $consumers = ldap_authorization_get_consumers();
  foreach (ldap_authorization_get_consumers() as $consumer_type => $consumer_conf) {
    $consumer_conf['%server_name'] = $server_name;
    $consumer_obj = ldap_authorization_get_consumer_object($consumer_type);
    if ($sid == $consumer_obj->consumerConf->sid) {
      $use_warnings[] = t('This server (%server_name) may not
        be deleted or disabled because it is being used by the module consumer_module to
        authorize consumer_name_plural.', $consumer_conf);
    }
  }
  return $use_warnings;
}