Code

Updated statistics to use over time data
[gosa.git] / gosa-core / setup / class_setupStep_Ldap.inc
index 03525da833329b87746a20781aef3dcd88181401..cf0370712e984f5aea7eb22cce501a60d9e06a5e 100644 (file)
@@ -42,6 +42,7 @@ class Step_Ldap extends setup_step
 
   var $header_image= "images/setup/ldap.png";
 
+    var $b_displayCheckbutton = TRUE;
   function Step_Ldap()
   {
     $this->update_strings();
@@ -96,10 +97,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);