You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I extended the FreeIPAUser to include a relationship:
<?phpnamespaceApp\Ldap\FreeIPA;
useApp\Ldap\FreeIPA\Mail\Alias;
useLdapRecord\Models\FreeIPA\UserasFreeIPAUser;
class User extends FreeIPAUser
{
publicfunctionaliases()
{
return$this->hasMany(Alias::class, 'owner');
}
}
My Alias model is defined this way:
<?phpnamespaceApp\Ldap\FreeIPA\Mail;
useApp\Ldap\FreeIPA\User;
useLdapRecord\Models\FreeIPA\EntryasModel;
class Alias extends Model
{
publicstatic$objectClasses = [
'top',
'mailGroup',
'groupOfMailEnhancedUniqueNames',
'mailRecipient',
];
publicfunctionowners()
{
return$this->hasManyIn(User::class, 'owner');
}
}
When I try to query for all aliases belonging to a user, I get things which aren't aliases - they don't have the objectClasses that alias is supposed to have - it includes any entry in LDAP that has a matching owner attribute:
When I inspect the query being run against the LDAP server (using $idm_user->aliases()->getRelationQuery()), it seems to be setting (objectClass=*) in the search.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I extended the
FreeIPAUserto include a relationship:My
Aliasmodel is defined this way:When I try to query for all
aliasesbelonging to a user, I get things which aren't aliases - they don't have theobjectClasses thataliasis supposed to have - it includes any entry in LDAP that has a matchingownerattribute:When I inspect the query being run against the LDAP server (using
$idm_user->aliases()->getRelationQuery()), it seems to be setting(objectClass=*)in the search.How do I get it to search the correct entries?
Beta Was this translation helpful? Give feedback.
All reactions