index 8b9ed80c677c027547ed2fe54847d57e322dff23..cf0370712e984f5aea7eb22cce501a60d9e06a5e 100644 (file)
var $header_image= "images/setup/ldap.png";
+ var $b_displayCheckbutton = TRUE;
function Step_Ldap()
{
$this->update_strings();
$this->bind_id = FALSE;
@ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
- $this->connect_id = @ldap_connect($this->connection);
+ $this->connect_id = ldap_connect($this->connection);
- @ldap_set_option($this->connect_id, LDAP_OPT_PROTOCOL_VERSION, 3);
- $this->bind_id = @ldap_bind($this->connect_id, $this->admin, $this->password);
+ if($this->tls){
+ if(@ldap_set_option($this->connect_id, LDAP_OPT_REFERRALS, 0))
+ if(@ldap_start_tls($this->connect_id))
+ $this->bind_id = @ldap_bind($this->connect_id, $this->admin, $this->password);
+ @ldap_set_option($this->connect_id, LDAP_OPT_PROTOCOL_VERSION, 3);
+ }else{
+ @ldap_set_option($this->connect_id, LDAP_OPT_PROTOCOL_VERSION, 3);
+ $this->bind_id = @ldap_bind($this->connect_id, $this->admin, $this->password);
+ }
if(!$this->bind_id){
$str = sprintf(_("Anonymous bind to server '%s' failed!"),$this->connection);
$ldap->search("(&(objectClass=person)(|(uid=".$filter.")(cn=".$filter.")))");
$tmp = array();
while($attrs = $ldap->fetch()){
- $tmp[base64_encode($attrs['dn'])]= @LDAP::fix($attrs['dn']);
+ $tmp[base64_encode($attrs['dn'])]= LDAP::fix($attrs['dn']);
natcasesort($tmp);
}
return($tmp);