diff options
Diffstat (limited to 'lib/Fripost/Schema/Type')
-rw-r--r-- | lib/Fripost/Schema/Type/Domain.pm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Fripost/Schema/Type/Domain.pm b/lib/Fripost/Schema/Type/Domain.pm index f85ea87..0d2be17 100644 --- a/lib/Fripost/Schema/Type/Domain.pm +++ b/lib/Fripost/Schema/Type/Domain.pm @@ -14,6 +14,8 @@ our $VERSION = '0.01'; # domain is given, returns all domains. # Filters on values of both keys `domain' and `owner' (unless they are # undefined). +# If `owner' is the empty string, serch for non self-managed domains +# only. sub search { my $self = shift; @@ -26,7 +28,14 @@ sub search { my @filters = ('(ObjectClass=virtualDomain)'); push @filters, "(dc=" .$_[0]->{domain}. ")" if defined $_[0]->{domain}; - push @filters, "(owner=" .$owner. ")" if defined $_[0]->{owner}; + if (defined $_[0]->{owner}) { + if ($_[0]->{owner} eq '') { + push @filters, "(!(owner=*))"; + } + else { + push @filters, "(owner=" .$owner. ")"; + } + } my $filter; if ($#filters == 0) { $filter = $filters[0]; |