From: hickert Date: Fri, 21 Apr 2006 07:45:45 +0000 (+0000) Subject: Removed seperate readBinary function X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=55887d6e97350a82e53e614ef69f2a626253fc25;p=gosa.git Removed seperate readBinary function git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3079 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_faiHook.inc b/plugins/admin/fai/class_faiHook.inc index 09b270d83..21433ac06 100644 --- a/plugins/admin/fai/class_faiHook.inc +++ b/plugins/admin/fai/class_faiHook.inc @@ -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: diff --git a/plugins/admin/fai/class_faiScript.inc b/plugins/admin/fai/class_faiScript.inc index 6ba262020..9a6649f30 100644 --- a/plugins/admin/fai/class_faiScript.inc +++ b/plugins/admin/fai/class_faiScript.inc @@ -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: diff --git a/plugins/admin/fai/class_faiTemplate.inc b/plugins/admin/fai/class_faiTemplate.inc index 8d7d51fb2..befb92022 100644 --- a/plugins/admin/fai/class_faiTemplate.inc +++ b/plugins/admin/fai/class_faiTemplate.inc @@ -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: