function _ldapdata_ldap_init in LDAP integration 5
Same name and namespace in other branches
- 5.2 ldapdata.module \_ldapdata_ldap_init()
1 call to _ldapdata_ldap_init()
File
- ./
ldapdata.module, line 873
Code
function _ldapdata_ldap_init(&$user) {
global $ldapdata_ldap;
if ($row = db_fetch_object(db_query("SELECT * FROM {ldapauth} WHERE status = '%s' AND name = '%s'", 1, $user->ldap_config))) {
$ldapdata_ldap = new LDAPInterface();
$ldapdata_ldap
->setOption('name', $row->name);
$ldapdata_ldap
->setOption('server', $row->server);
$ldapdata_ldap
->setOption('port', $row->port);
$ldapdata_ldap
->setOption('tls', $row->tls);
$ldapdata_ldap
->setOption('encrypted', $row->encrypted);
$ldapdata_ldap
->setOption('basedn', $row->basedn);
$ldapdata_ldap
->setOption('user_attr', $row->user_attr);
return $ldapdata_ldap;
}
else {
return;
}
}