Code

Changed attribute name 'gosaLastSystemLogin' to 'gotoLastSystemLogin'.
[gosa.git] / include / class_config.inc
index 887288feb759716fec8c0aec3419d6a40082866f..270f1e2565c7f5484e10308ce47d45a1a1805a40 100644 (file)
@@ -179,16 +179,21 @@ class config  {
     $this->level--;
   }
 
+
+  function get_credentials($creds)
+  {
+    if (isset($_SERVER['HTTP_GOSA_KEY'])){
+      return (cred_decrypt($creds, $_SERVER['HTTP_GOSA_KEY']));
+    }
+    return ($creds);
+  }
+
+
   function get_ldap_link($sizelimit= FALSE)
   {
-# Reuse same handle ldap handle.
-# Disabled due to unpredictable results
-#
-#    if($this->ldap === NULL || !is_resource($this->ldap->cid)){
-#
       /* 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)){