function _ldapsync_init in LDAP integration 6
Initiates the LDAPInterfase class.
Parameters
$sid: An ID of the LDAP server configuration.
1 call to _ldapsync_init()
- _ldapsync_search in ./
ldapsync.module - Find all LDAP users from servers and OUs specified in ldapauth settings and create or update existing users as needed.
File
- ./
ldapsync.module, line 386 - ldapsync keeps LDAP and Drupal user lists synchronized.
Code
function _ldapsync_init($sid) {
global $_ldapsync_ldap;
$server = ldapauth_server_load($sid);
if (!empty($server)) {
$_ldapsync_ldap = new LDAPInterface();
$_ldapsync_ldap
->setOption('sid', $server->sid);
$_ldapsync_ldap
->setOption('name', $server->name);
$_ldapsync_ldap
->setOption('machine_name', $server->machine_name);
$_ldapsync_ldap
->setOption('server', $server->server);
$_ldapsync_ldap
->setOption('port', $server->port);
$_ldapsync_ldap
->setOption('tls', $server->tls);
$_ldapsync_ldap
->setOption('enc_type', $server->enc_type);
$_ldapsync_ldap
->setOption('basedn', $server->basedn);
$_ldapsync_ldap
->setOption('user_attr', $server->user_attr);
$_ldapsync_ldap
->setOption('mail_attr', $server->mail_attr);
$_ldapsync_ldap
->setOption('puid_attr', $server->puid_attr);
$_ldapsync_ldap
->setOption('binary_puid', $server->binary_puid);
$_ldapsync_ldap
->setOption('binddn', $server->binddn);
$_ldapsync_ldap
->setOption('bindpw', $server->bindpw);
return $_ldapsync_ldap;
}
}