You are here

function ldapauth_server_load_all in LDAP integration 6

Retrieve all servers from database.

Parameters

Boolean $reset Clear the static cache if TRUE:

Return value

An array of server objects ordered by weight with sid as key.

4 calls to ldapauth_server_load_all()
ldapgroups_user_test in ./ldapgroups.admin.inc
Test users against the current ldapgroups settings
ldap_servers_features_export_options in ./ldapauth.features.inc
Implementation of hook_features_export_options. [component_hook]
ldap_servers_features_export_render in ./ldapauth.features.inc
Implementation of hook_features_export_render. [component hook]
ldap_servers_features_revert in ./ldapauth.features.inc
Implementation of hook_features_revert(). [component_hook]

File

includes/ldap.core.inc, line 61
The core functions that ldapauth supplies for submodules. Will be included by default by ldapauth.

Code

function ldapauth_server_load_all($reset = FALSE) {
  static $servers = array();
  if ($reset) {
    $servers = array();
  }
  if (empty($servers) || $reset) {
    $results = db_query("SELECT * FROM {ldapauth} ORDER BY weight");
    while ($server = db_fetch_object($results)) {
      $servers[$server->sid] = $server;
    }
  }
  return $servers;
}