X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_ldap.inc;h=b3ae4983b38e7ac0bfd609cd4e391325114fc3b2;hb=7c4b0a6716966dd6a0a0fe550a1e2fe8c334d4dc;hp=e5809d72099e075eb69c1fdbd23d80e1c098f6b7;hpb=debae573752557eb5a0d09189ff40eca92c3735b;p=gosa.git
diff --git a/include/class_ldap.inc b/include/class_ldap.inc
index e5809d720..b3ae4983b 100644
--- a/include/class_ldap.inc
+++ b/include/class_ldap.inc
@@ -549,6 +549,7 @@ class LDAP{
unset($attr['dn']);
if((!in_array("gosaApplication" , $attr['objectClass'])) && (!in_array("gotoMimeType", $attr['objectClass']))){
+ $attr['FAIdebianRelease'] = $destinationName;
if($type=="branch"){
$attr['FAIstate'] ="branch";
}elseif($type=="freeze"){
@@ -583,6 +584,8 @@ class LDAP{
}
}
+ echo "" ;
+
$this->ls ("(objectClass=*)",$sourcedn);
while ($this->fetch()){
$deldn= $this->getDN();
@@ -826,7 +829,7 @@ class LDAP{
function gen_xls ($dn, $filter= "(objectClass=*)", $attributes= array('*'), $recursive= TRUE,$r_array=0)
{
- $display= "";
+ $display= array();
$this->cd($dn);
$this->search("$filter");
@@ -988,7 +991,7 @@ class LDAP{
$ndn = split("#", $lineone[0]);
$line = base64_decode($ndn[1]);
- $dnn = split (":",$line);
+ $dnn = split (":",$line,2);
$current_line = $ndn[0];
$dn = $dnn[0];
$value = $dnn[1];
@@ -1217,6 +1220,38 @@ class LDAP{
}
}
}
+
+ /* added by Guido Serra aka Zeph */
+ function getCn($dn){
+ $simple= split(",", $dn);
+
+ foreach($simple as $piece) {
+ $partial= split("=", $piece);
+
+ if($partial[0] == "cn"){
+ return $partial[1];
+ }
+ }
+ }
+
+ function get_naming_contexts($server, $admin= "", $password= "")
+ {
+ /* Build LDAP connection */
+ $ds= ldap_connect ($server);
+ if (!$ds) {
+ die ("Can't bind to LDAP. No check possible!");
+ }
+ ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
+ $r= ldap_bind ($ds, $admin, $password);
+
+ /* Get base to look for naming contexts */
+ $sr = @ldap_read ($ds, "", "objectClass=*", array("namingContexts"));
+ $attr= @ldap_get_entries($ds,$sr);
+
+ return ($attr[0]['namingcontexts']);
+ }
+
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: