You are here

function _get_ldap_config_name in CAS 5

Same name and namespace in other branches
  1. 5.4 cas.module \_get_ldap_config_name()
  2. 5.3 cas.module \_get_ldap_config_name()
  3. 6 cas.module \_get_ldap_config_name()
  4. 6.2 cas.module \_get_ldap_config_name()

LDAP Auxiliary functions

2 calls to _get_ldap_config_name()
cas_form_alter in ./cas.module
implementation of hook_form_alter Overrides specific from settings based on user policy.
cas_login_check in ./cas.module
Implementation of hook_init Traps a page load to see if authentication is required.

File

./cas.module, line 788

Code

function _get_ldap_config_name($user_name) {
  include_once 'modules/ldap_integration/ldapauth.module';
  $user_found = false;
  $result = db_query("SELECT name FROM {ldapauth} WHERE status = '%d' ORDER BY sid", 1);
  while ($row = db_fetch_object($result)) {

    // cycle thru the authentication schemes - first successful one wins
    // instantiate ldap
    _ldapauth_init($row->name);
    $ldap_user_entry = _ldapauth_user_lookup($user_name);
    if ($ldap_user_entry) {
      $user_found = true;
      break;
    }
  }
  if ($user_found) {
    return $row->name;
  }
  else {
    return false;
  }
}