protected function extractCNFromDN($dn)
    {

        // explode the DN
        $splitArray = explode(',', $dn);
        $keyValue = array();

        // iterate over all elements
        foreach ($splitArray as $value) {
            $tempArray  = explode('=', $value);
            $keyValue[$tempArray[0]] = array();
            $keyValue[$tempArray[0]][] = $tempArray[1];
        }

        // return the CN
        return $keyValue[LdapLoginmodule::CN];
    }
protected function extractCNFromDN($dn)
    {

        // explode the DN
        $splitArray = explode(',', $dn);
        $keyValue = array();

        // iterate over all elements
        foreach ($splitArray as $value) {
            $tempArray  = explode('=', $value);
            $keyValue[$tempArray[0]] = array();
            $keyValue[$tempArray[0]][] = $tempArray[1];
        }

        // return the CN
        return $keyValue[LdapLoginmodule::CN];
    }
protected function extractCNFromDN ( $ dn ) { // explode the DN $ splitArray = explode ( ',' , $ dn ) ; $ keyValue = array ( ) ; // iterate over all elements foreach ( $ splitArray as $ value ) { $ tempArray = explode ( '=' , $ value ) ; $ keyValue [ $ tempArray [ 0 ] ] = array ( ) ; $ keyValue [ $ tempArray [ 0 ] ] [ ] = $ tempArray [ 1 ] ; } // return the CN return $ keyValue [ LdapLoginmodule :: CN ] ; }
Extracts the common name from a distinguished name.

@param string $dn The distinguished name of the authenticating user

@return array
Extracts the common name from a distinguished name .