steffen: server/perl-kolab/Kolab Kolab.pm,1.3,1.4

cvs at intevation.de cvs at intevation.de
Fri Jun 11 11:55:26 CEST 2004


Author: steffen

Update of /kolabrepository/server/perl-kolab/Kolab
In directory doto:/tmp/cvs-serv11563/Kolab

Modified Files:
	Kolab.pm 
Log Message:
allow multivalued attributes, added new config templates

Index: Kolab.pm
===================================================================
RCS file: /kolabrepository/server/perl-kolab/Kolab/Kolab.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Kolab.pm	20 Apr 2004 00:27:05 -0000	1.3
+++ Kolab.pm	11 Jun 2004 09:55:24 -0000	1.4
@@ -151,7 +151,15 @@
             if (!$mesg->code) {
                 $ldapobject = $mesg->pop_entry;
                 foreach $tempval ($ldapobject->attributes) {
-                    $config{$tempval} = $ldapobject->get_value($tempval);
+		    my $vals = $ldapobject->get_value($tempval, asref => 1 );
+		    if( !ref($vals) ) {
+		      # Not a ref at all???
+		      &log('C', "Attribute $tempval does not exist", KOLAB_WARN );
+		    } elsif( @{$vals} == 1 ) {
+		      $config{$tempval} = $vals->[0];
+		    } else {
+		      $config{$tempval} = $vals;
+		    }
                 }
             } else {
                 &log('C', "Unable to find kolab object `" . $config{'kolab_dn'} . "'", KOLAB_ERROR);





More information about the commits mailing list