From 086962f582fcf5ba0390e0e1b1d202808ea55b3f Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 15 Mar 2010 10:45:59 +0000 Subject: [PATCH] Applied patch from ptitoliv closes #890 -Allows to use tls in gosa setup. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@16524 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/setup/class_setupStep_Ldap.inc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gosa-core/setup/class_setupStep_Ldap.inc b/gosa-core/setup/class_setupStep_Ldap.inc index 03525da83..a57238e09 100644 --- a/gosa-core/setup/class_setupStep_Ldap.inc +++ b/gosa-core/setup/class_setupStep_Ldap.inc @@ -95,11 +95,18 @@ class Step_Ldap extends setup_step $this->connect_id = FALSE; $this->bind_id = FALSE; - @ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); - $this->connect_id = @ldap_connect($this->connection); + ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); + $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); -- 2.30.2