X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_ldap.inc;h=17ae13ff4071b267c4f606dbe63bf5e69bfc1197;hb=cf52f2875e8d24c2985898e38bfe03acf8900e44;hp=f3b1adb9e05c6de5cf85fbc9304dc9b29424d831;hpb=03e90e80fd2293c9daa2e8407623dd8c73e4b620;p=gosa.git diff --git a/include/class_ldap.inc b/include/class_ldap.inc index f3b1adb9e..17ae13ff4 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -445,7 +445,7 @@ class LDAP{ */ function copy_FAI_resource_recursive($sourcedn,$destinationdn,$destinationName,$type="branch",$is_first = true,$depth=0) { - error_reporting(E_ALL); + error_reporting(E_ALL | E_STRICT); if($is_first){ echo "

".sprintf(_("Creating copy of %s"),"".@LDAP::fix($sourcedn)."")."

"; @@ -573,7 +573,7 @@ class LDAP{ } if($this->error != "Success"){ - /* Some error occured */ + /* Some error occurred */ print "---------------------------------------------"; print $this->get_error()."
"; print $sourcedn."
"; @@ -857,7 +857,7 @@ class LDAP{ $url= preg_replace('!\?\?.*$!', '', $url); $server= preg_replace('!^([^:]+://[^/]+)/.*$!', '\\1', $url); - if ($referrals == NULL){ + if ($referrals === NULL){ $referrals= $this->referrals; } @@ -1112,6 +1112,13 @@ class LDAP{ */ function import_single_entry($str_attr,$modify,$delete) { + global $config; + + if(!$config){ + trigger_error("Can't import ldif, can't read config object."); + } + + if($this->reconnect) $this->connect(); $ret = false; @@ -1189,7 +1196,8 @@ class LDAP{ /* Create missing trees */ $this->cd ($this->basedn); - $this->create_missing_trees($data['dn']); + $this->cd($config->current['BASE']); + $this->create_missing_trees(preg_replace("/^[^,]+,/","",$data['dn'])); $this->cd($data['dn']); $dn = $data['dn'];