You are here

public function SimpleLdapServer::copy in Simple LDAP 7

Same name and namespace in other branches
  1. 7.2 SimpleLdapServer.class.php \SimpleLdapServer::copy()

Copy an entry to a new DN.

@throw SimpleLdapException

Parameters

string $dn: The distinguished name of an LDAP entry.

string $newdn: The distinguished name of the new LDAP entry.

Return value

boolean TRUE on success

File

./SimpleLdapServer.class.php, line 640
Class to handle LDAP server connections and related operations.

Class

SimpleLdapServer
Simple LDAP server class.

Code

public function copy($dn, $newdn) {

  // Get the LDAP entry.
  $entry = $this
    ->search($dn, '(objectclass=*)', 'base');

  // Create the copy.
  $result = $this
    ->add($newdn, $entry[$dn]);
  return $result;
}