You are here

function ldapauth_server_load in LDAP integration 6

Retrieve server setting object by sid or machine_name ( menu load function too)

Parameters

Mixed $sid Either the sid number or the machine name:

boolean $reset Cache is cleared if true.:

Return value

The server object or FALSE

22 calls to ldapauth_server_load()
hook_ldap_drupal_user_name_alter in ./ldapauth.api.php
Called after LDAP user has been authenticated but before the drupal user mapping/creation done.
ldapauth_admin_form in ./ldapauth.admin.inc
Implements the LDAP server edit page.
ldapauth_admin_form_validate_field in ./ldapauth.admin.inc
Validation for machine name field.
ldapauth_admin_import_form_validate in ./ldapauth.admin.inc
Validate a server settings import.
ldapauth_drupal_user_lookup in includes/ldap.core.inc
Map an LDAP user to a Drupal user account if one exists.

... See full list

1 string reference to 'ldapauth_server_load'
_ldapdata_init in ./ldapdata.module
Initiates the LDAPInterfase class.

File

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

Code

function ldapauth_server_load($sid, $reset = FALSE) {
  static $servers = array();
  if ($reset) {
    $servers = array();
  }
  if (isset($servers[$sid])) {
    return $servers[$sid];
  }
  if (is_numeric($sid)) {
    $where = "sid = %d";
  }
  else {
    $where = "machine_name = '%s'";
  }
  $server = db_fetch_object(db_query("SELECT * FROM {ldapauth} WHERE " . $where, $sid));
  $servers[$sid] = $server;
  return $server;
}