Code

Removed seperate readBinary function
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 Apr 2006 07:45:45 +0000 (07:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 Apr 2006 07:45:45 +0000 (07:45 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3079 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiHook.inc
plugins/admin/fai/class_faiScript.inc
plugins/admin/fai/class_faiTemplate.inc

index 09b270d8390f736d3dac3df287c472fe229ad573..21433ac06bffa99c78860e0eba41d88b419474f8 100644 (file)
@@ -89,7 +89,7 @@ class faiHook extends plugin
         foreach($this->subAttributes as $attrs){
           $this->SubObjects[$object['cn'][0]][$attrs]=addslashes($this->SubObjects[$object['cn'][0]][$attrs]);
         }
-        $this->SubObjects[$object['cn'][0]]['FAIscript']   = addslashes($this->readBinary("FAIscript",$object['dn']));
+        $this->SubObjects[$object['cn'][0]]['FAIscript']   = addslashes( $ldap->get_attribute($object['dn'], "FAIscript",$r_array=0));
       }
     }
   }
@@ -450,38 +450,6 @@ class faiHook extends plugin
       show_ldap_error($ldap->get_error()); 
     }
   }
-
-  function readBinary($attr,$dn){
-    $Data  ="";
-    $ds= ldap_connect($this->config->current['SERVER']);
-    ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
-    if (function_exists("ldap_set_rebind_proc") && isset($this->config->current['RECURSIVE']) && $this->config->current['RECURSIVE'] == "true") {
-      ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1);
-      ldap_set_rebind_proc($ds, array(&$this, "rebind"));
-    }
-
-    if(isset($this->config->current['TLS']) &&  $this->config->current['TLS'] == "true"){
-      ldap_start_tls($ds);
-    }
-
-    $r  = ldap_bind($ds);
-    $sr = @ldap_read($ds, $dn, $attr."=*", array($attr));
-
-    if ($sr) {
-      $ei=ldap_first_entry($ds, $sr);
-      if ($ei) {
-        if ($info = ldap_get_values_len($ds, $ei, $attr)){
-          $Data= $info[0];
-        }
-      }
-    }
-
-    /* close conncetion */
-    ldap_unbind($ds);
-    return($Data);
-  }
-
-
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 6ba262020c0ce7a4ae87a14ed2de02a5dd9f9b62..9a6649f304ea4356610075a5839d421ab6777f26 100644 (file)
@@ -89,7 +89,7 @@ class faiScript extends plugin
           $this->SubObjects[$object['cn'][0]][$attrs]=addslashes($this->SubObjects[$object['cn'][0]][$attrs]);
         }
 
-        $this->SubObjects[$object['cn'][0]]['FAIscript']   = addslashes ($this->readBinary("FAIscript",$object['dn']));
+        $this->SubObjects[$object['cn'][0]]['FAIscript']   = addslashes ($ldap->get_attribute($object['dn'], "FAIscript",$r_array=0));
 
         $this->SubObjects[$object['cn'][0]]['status']      = "edited";
         $this->SubObjects[$object['cn'][0]]['dn']          = $object['dn'];
@@ -432,39 +432,6 @@ class faiScript extends plugin
       show_ldap_error($ldap->get_error()); 
     }
   }
-
-
-  function readBinary($attr,$dn){
-    $Data  ="";
-    $ds= ldap_connect($this->config->current['SERVER']);
-    ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
-    if (function_exists("ldap_set_rebind_proc") && isset($this->config->current['RECURSIVE']) && $this->config->current['RECURSIVE'] == "true") {
-      ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1);
-      ldap_set_rebind_proc($ds, array(&$this, "rebind"));
-    }
-
-    if(isset($this->config->current['TLS']) &&  $this->config->current['TLS'] == "true"){
-      ldap_start_tls($ds);
-    }
-
-    $r  = ldap_bind($ds);
-    $sr = @ldap_read($ds, $dn, $attr."=*", array($attr));
-
-    if ($sr) {
-      $ei=ldap_first_entry($ds, $sr);
-      if ($ei) {
-        if ($info = ldap_get_values_len($ds, $ei, $attr)){
-          $Data= $info[0];
-        }
-      }
-    }
-
-    /* close conncetion */
-    ldap_unbind($ds);
-    return($Data);
-  }
-
-
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 8d7d51fb2e37aff5d3f9eec017ef97c91b5da66b..befb92022d9f77cb8aaa8344476e3e5921692164 100644 (file)
@@ -84,8 +84,8 @@ class faiTemplate extends plugin
           $this->SubObjects[$object['cn'][0]][$codeIt]= base64_decode($this->SubObjects[$object['cn'][0]][$codeIt]);
         }       
 
-        $this->SubObjects[$object['cn'][0]]['FAItemplateFile']= $this->readBinary("FAItemplateFile",$object['dn']);
-       
+        $this->SubObjects[$object['cn'][0]]['FAItemplateFile']= $ldap->get_attribute($object['dn'], "FAItemplateFile",$r_array=0);
+        
         $this->SubObjects[$object['cn'][0]]['status']= "edited";
         $this->SubObjects[$object['cn'][0]]['dn']= $object['dn'];
       }
@@ -354,36 +354,6 @@ $ldap->modify ($tmp);
       show_ldap_error($ldap->get_error()); 
     }
   }
-
-  function readBinary($attr,$dn){
-    $Data  ="";
-    $ds= ldap_connect($this->config->current['SERVER']);
-    ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
-    if (function_exists("ldap_set_rebind_proc") && isset($this->config->current['RECURSIVE']) && $this->config->current['RECURSIVE'] == "true") {
-      ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1);
-      ldap_set_rebind_proc($ds, array(&$this, "rebind"));
-    }
-
-    if(isset($this->config->current['TLS']) &&  $this->config->current['TLS'] == "true"){
-      ldap_start_tls($ds);
-    }
-
-    $r  = ldap_bind($ds);
-    $sr = @ldap_read($ds, $dn, $attr."=*", array($attr));
-
-    if ($sr) {
-      $ei=ldap_first_entry($ds, $sr);
-      if ($ei) {
-        if ($info = ldap_get_values_len($ds, $ei, $attr)){
-          $Data= $info[0];
-        }
-      }
-    }
-
-    /* close conncetion */
-    ldap_unbind($ds);
-    return($Data);
-  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: