From: hickert Date: Mon, 15 Mar 2010 10:51:05 +0000 (+0000) Subject: Applied tls patch X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6e44dabba996e89c5a684439d94cff62b5aa37c9;p=gosa.git Applied tls patch git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16526 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/setup/class_setupStep_Ldap.inc b/gosa-core/setup/class_setupStep_Ldap.inc index 03525da83..eca54c38a 100644 --- a/gosa-core/setup/class_setupStep_Ldap.inc +++ b/gosa-core/setup/class_setupStep_Ldap.inc @@ -96,10 +96,17 @@ class Step_Ldap extends setup_step $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);