Code

Updating spanish translation for gosa 2.5
[gosa.git] / include / class_config.inc
index 7b55d77337bbeaf03a17f25be40dd6ffb37f0435..d783fc41cc4baee05cc7564e69629f3061f3bf3a 100644 (file)
@@ -179,13 +179,21 @@ class config  {
     $this->level--;
   }
 
-  function get_ldap_link($sizelimit= FALSE)
+
+  function get_credentials($creds)
   {
-    if($this->ldap === NULL || !is_resource($this->ldap->cid)){
+    if (isset($_SERVER['HTTP_GOSA_KEY'])){
+      return (cred_decrypt($creds, $_SERVER['HTTP_GOSA_KEY']));
+    }
+    return ($creds);
+  }
+
 
+  function get_ldap_link($sizelimit= FALSE)
+  {
       /* Build new connection */
       $this->ldap= ldap_init ($this->current['SERVER'], $this->current['BASE'],
-          $this->current['ADMIN'], $this->current['PASSWORD']);
+          $this->current['ADMIN'], $this->get_credentials($this->current['PASSWORD']));
 
       /* Check for connection */
       if (is_null($this->ldap) || (is_int($this->ldap) && $this->ldap == 0)){
@@ -213,7 +221,7 @@ class config  {
       } else {
         $this->ldap->referrals= $this->current['REFERRAL'];
       }
-    }
+#    } 
     return ($this->ldap);
   }
 
@@ -223,6 +231,9 @@ class config  {
     if (!isset($this->current['PEOPLE'])){
       $this->current['PEOPLE']= "ou=people";
     }
+    if (!isset($this->current['SAMBAVERSION'])){
+      $this->current['SAMBAVERSION']= 3;
+    }
     if (!isset($this->current['GROUPS'])){
       $this->current['GROUPS']= "ou=groups";
     }