From 1270ae4e403c3ada93e2df62fe8b619d0280abeb Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 25 Nov 2012 17:04:01 +0000 Subject: [PATCH] added function to extract RDN value --- lam/lib/account.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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.