lib/ldap: Call getConnection before bind
Looks more natural
This commit is contained in:
parent
5651392ce7
commit
70a6157631
|
@ -538,9 +538,9 @@ class LdapConnection implements Selectable, Inspectable
|
||||||
*/
|
*/
|
||||||
public function hasDn($dn)
|
public function hasDn($dn)
|
||||||
{
|
{
|
||||||
|
$ds = $this->getConnection();
|
||||||
$this->bind();
|
$this->bind();
|
||||||
|
|
||||||
$ds = $this->getConnection();
|
|
||||||
$result = ldap_read($ds, $dn, '(objectClass=*)', array('objectClass'));
|
$result = ldap_read($ds, $dn, '(objectClass=*)', array('objectClass'));
|
||||||
return ldap_count_entries($ds, $result) > 0;
|
return ldap_count_entries($ds, $result) > 0;
|
||||||
}
|
}
|
||||||
|
@ -556,9 +556,9 @@ class LdapConnection implements Selectable, Inspectable
|
||||||
*/
|
*/
|
||||||
public function deleteRecursively($dn)
|
public function deleteRecursively($dn)
|
||||||
{
|
{
|
||||||
|
$ds = $this->getConnection();
|
||||||
$this->bind();
|
$this->bind();
|
||||||
|
|
||||||
$ds = $this->getConnection();
|
|
||||||
$result = @ldap_list($ds, $dn, '(objectClass=*)', array('objectClass'));
|
$result = @ldap_list($ds, $dn, '(objectClass=*)', array('objectClass'));
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
if (ldap_errno($ds) === self::LDAP_NO_SUCH_OBJECT) {
|
if (ldap_errno($ds) === self::LDAP_NO_SUCH_OBJECT) {
|
||||||
|
@ -591,9 +591,9 @@ class LdapConnection implements Selectable, Inspectable
|
||||||
*/
|
*/
|
||||||
public function deleteDn($dn)
|
public function deleteDn($dn)
|
||||||
{
|
{
|
||||||
|
$ds = $this->getConnection();
|
||||||
$this->bind();
|
$this->bind();
|
||||||
|
|
||||||
$ds = $this->getConnection();
|
|
||||||
$result = @ldap_delete($ds, $dn);
|
$result = @ldap_delete($ds, $dn);
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
if (ldap_errno($ds) === self::LDAP_NO_SUCH_OBJECT) {
|
if (ldap_errno($ds) === self::LDAP_NO_SUCH_OBJECT) {
|
||||||
|
|
Loading…
Reference in New Issue