You are here

function ldap_servers_no_enabled_servers_msg in Lightweight Directory Access Protocol (LDAP) 7

Same name and namespace in other branches
  1. 8.2 ldap_servers/ldap_servers.module \ldap_servers_no_enabled_servers_msg()
  2. 7.2 ldap_servers/ldap_servers.module \ldap_servers_no_enabled_servers_msg()
2 calls to ldap_servers_no_enabled_servers_msg()
LdapAuthenticationConfAdmin::drupalForm in ldap_authentication/LdapAuthenticationConfAdmin.class.php
LdapProfileConfAdmin::drupalForm in ldap_profile/LdapProfileConfAdmin.class.php

File

ldap_servers/ldap_servers.module, line 475

Code

function ldap_servers_no_enabled_servers_msg($action) {
  $servers = ldap_servers_get_servers(NULL, 'enabled');
  if (count($servers) == 0) {
    $message = t('At least one ldap server must configured and <em>enabled</em> before') . $action . '. ' . t('Please go to') . ' ' . l('admin/config/people/ldap/servers', 'admin/config/people/ldap/servers') . ' to configure an LDAP server';
    drupal_set_message($message, 'warning');
    return $message;
  }
}