On 21/10/04 6:19 pm, Jesse, Rich <[EMAIL PROTECTED]> wrote:

> Yes, I thought of that too, after some RTFMing.  The kicker is that the LDAP
> record could exist, but without that particular ObjectClass.  If I used the
> filter, I would have to report such a record as "non existant", when actually
> it's just the ObjectClass that's missing -- it would add confusion to the
> folks that would be maintaining the user accounts.
> 
> Thanks for the suggestion, though!

Rich, this ought to work for you:

    $oc = $entry->get_value("objectclass", alloptions => 1);
    if (grep /^MyHPUXClass$/i, @{$oc->{''}}) {
        # do your thing
    }

I'm sure that alloptions is much use for you in this case, and perhaps using
asref => 1 would be better. Or even, frankly, a plain
get_value('objectclass') in a list context.

    if (grep /^MyHPUXClass$/i, $entry->get_value('objectclass')) {
        # found it
    }

Cheers,

Chris


Reply via email to