diff --git a/lam/lib/account.inc b/lam/lib/account.inc index e6ea0840..081f83ff 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -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.