mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
fix Scrutinizer bug: replace new ldap (wrong namespace) with Api\Ldap::factory()
This commit is contained in:
parent
6c6f9eae7a
commit
056e0f97d2
@ -1147,11 +1147,9 @@ class Ldap
|
|||||||
error_log(__METHOD__."('$baseDN') baseDN does NOT exist and we cant/wont create it! ldap_errno()=".ldap_errno($this->ds).', ldap_error()='.ldap_error($this->ds));
|
error_log(__METHOD__."('$baseDN') baseDN does NOT exist and we cant/wont create it! ldap_errno()=".ldap_errno($this->ds).', ldap_error()='.ldap_error($this->ds));
|
||||||
return $this->_error(__LINE__); // baseDN does NOT exist and we cant/wont create it
|
return $this->_error(__LINE__); // baseDN does NOT exist and we cant/wont create it
|
||||||
}
|
}
|
||||||
// create a admin connection to add the needed DN
|
|
||||||
$adminLDAP = new ldap;
|
|
||||||
$adminDS = $adminLDAP->ldapConnect();
|
|
||||||
|
|
||||||
list(,$ou) = explode(',',$baseDN);
|
list(,$ou) = explode(',',$baseDN);
|
||||||
|
$adminDS = null;
|
||||||
foreach(array(
|
foreach(array(
|
||||||
'ou=contacts,'.$this->allContactsDN,
|
'ou=contacts,'.$this->allContactsDN,
|
||||||
$ou.',ou=contacts,'.$this->allContactsDN,
|
$ou.',ou=contacts,'.$this->allContactsDN,
|
||||||
@ -1167,16 +1165,16 @@ class Ldap
|
|||||||
'objectClass' => $var == 'cn' ? 'organizationalRole' : 'organizationalUnit',
|
'objectClass' => $var == 'cn' ? 'organizationalRole' : 'organizationalUnit',
|
||||||
$var => $val,
|
$var => $val,
|
||||||
);
|
);
|
||||||
|
// create a admin connection to add the needed DN
|
||||||
|
if (!isset($adminDS)) $adminDS = Api\Ldap::factory();
|
||||||
if(!@ldap_add($adminDS, $dn, $data))
|
if(!@ldap_add($adminDS, $dn, $data))
|
||||||
{
|
{
|
||||||
//echo "<p>ldap_add($adminDS,'$dn',".print_r($data,true).")</p>\n";
|
//echo "<p>ldap_add($adminDS,'$dn',".print_r($data,true).")</p>\n";
|
||||||
$err = lang("Can't create dn %1",$dn).': '.$this->_error(__LINE__,$adminDS);
|
$err = lang("Can't create dn %1",$dn).': '.$this->_error(__LINE__,$adminDS);
|
||||||
$adminLDAP->ldapDisconnect();
|
|
||||||
return $err;
|
return $err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$adminLDAP->ldapDisconnect();
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user