added function to extract RDN value
This commit is contained in:
parent
1ebed3d86d
commit
1270ae4e40
|
@ -876,6 +876,18 @@ function extractRDNAttribute($dn) {
|
|||
return $parts[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the RDN attribute value from a given DN.
|
||||
*
|
||||
* @param String $dn DN
|
||||
* @return String RDN attribute value
|
||||
*/
|
||||
function extractRDNValue($dn) {
|
||||
if ($dn == null) return null;
|
||||
$parts = explode("=", substr($dn, 0, strpos($dn, ',')));
|
||||
return $parts[1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the DN suffix from a given DN.
|
||||
* E.g. ou=people,dc=test,dc=com will result in dc=test,dc=com.
|
||||
|
|
Loading…
Reference in New Issue