From b27afb64e9d2b18e524ef3c957baa530ed5f9904 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Fri, 28 Dec 2007 17:55:25 +0000 Subject: * completed basic tests and started to work on tests for aggregated values (attributes) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1436 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/OpenSLX/ConfigDB.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'config-db/OpenSLX/ConfigDB.pm') diff --git a/config-db/OpenSLX/ConfigDB.pm b/config-db/OpenSLX/ConfigDB.pm index 9030311d..f4f9b0e2 100644 --- a/config-db/OpenSLX/ConfigDB.pm +++ b/config-db/OpenSLX/ConfigDB.pm @@ -1246,6 +1246,9 @@ sub setClientIDsOfSystem my $systemID = shift; my $clientIDs = _aref(shift); + # associating a client to the default system makes no sense + return 0 if $systemID == 0; + my @uniqueClientIDs = _unique(@$clientIDs); return $self->{'meta-db'}->setClientIDsOfSystem( @@ -1355,6 +1358,9 @@ sub setGroupIDsOfSystem my $systemID = shift; my $groupIDs = _aref(shift); + # associating a group to the default system makes no sense + return 0 if $systemID == 0; + my @uniqueGroupIDs = _unique(@$groupIDs); return $self->{'meta-db'}->setGroupIDsOfSystem($systemID, \@uniqueGroupIDs); @@ -1558,7 +1564,8 @@ sub setSystemIDsOfClient my $clientID = shift; my $systemIDs = _aref(shift); - my @uniqueSystemIDs = _unique(@$systemIDs); + # filter out the default system, as no client should be associated to it + my @uniqueSystemIDs = grep { $_ > 0; } _unique(@$systemIDs); return $self->{'meta-db'}->setSystemIDsOfClient( $clientID, \@uniqueSystemIDs @@ -1972,7 +1979,8 @@ sub setSystemIDsOfGroup my $groupID = shift; my $systemIDs = _aref(shift); - my @uniqueSystemIDs = _unique(@$systemIDs); + # filter out the default system, as no group should be associated to it + my @uniqueSystemIDs = grep { $_ > 0; } _unique(@$systemIDs); return $self->{'meta-db'}->setSystemIDsOfGroup($groupID, \@uniqueSystemIDs); } -- cgit v1.2.3-55-g7522