You are here

function _ldap_servers_get_simpletest_servers in Lightweight Directory Access Protocol (LDAP) 7

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

see ldap_servers_get_servers()

1 call to _ldap_servers_get_simpletest_servers()
ldap_servers_get_servers in ldap_servers/ldap_servers.module
return ldap server conf objects

File

ldap_servers/ldap_servers.inc, line 66
collection of functions that don't belong in server object

Code

function _ldap_servers_get_simpletest_servers($sid, $type = NULL, $flatten, $reset = TRUE) {
  if (!$type) {
    $type = 'all';
  }
  ldap_server_module_load_include('php', 'ldap_servers', 'tests/LdapServerTest.class');
  $servers['all'] = LdapServerTest::getLdapServerObjects('all', NULL, 'LdapServer', $reset);
  foreach ($servers['all'] as $_sid => $ldap_server) {
    if ($ldap_server->status == 1) {
      $servers['enabled'][$_sid] = $ldap_server;
    }
  }
  if ($sid) {
    if (!isset($servers[$type][$sid])) {
      return FALSE;
    }
    return $flatten ? $servers[$type][$sid] : array(
      $sid => $servers[$type][$sid],
    );
  }
  if (isset($servers[$type])) {
    return $servers[$type];
  }
}