From 974e16335b45596798d119e42b98a986dd5357ef Mon Sep 17 00:00:00 2001 From: rettenbe Date: Mon, 20 Oct 2008 09:07:36 +0000 Subject: [PATCH] bugfix: opsi_set_product_properties without xml tag hostid act for all opsi clients git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12737 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-server | 13 ++++--------- gosa-si/server/events/opsi_com.pm | 3 ++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 83d2f2637..e4cc7185d 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -2193,16 +2193,12 @@ sub change_fai_state { my %tmp = map { $_ => 1 } $entry->get_value("objectClass"); if (exists $tmp{'FAIobject'}){ if ($state eq ''){ - $result= $ldap_handle->modify($entry->dn, changes => [ - delete => [ FAIstate => [] ] ]); + $result= $ldap_handle->modify($entry->dn, changes => [ delete => [ FAIstate => [] ] ]); } else { - $result= $ldap_handle->modify($entry->dn, changes => [ - replace => [ FAIstate => $state ] ]); + $result= $ldap_handle->modify($entry->dn, changes => [ replace => [ FAIstate => $state ] ]); } } elsif ($state ne ''){ - $result= $ldap_handle->modify($entry->dn, changes => [ - add => [ objectClass => 'FAIobject' ], - add => [ FAIstate => $state ] ]); + $result= $ldap_handle->modify($entry->dn, changes => [ add => [ objectClass => 'FAIobject' ], add => [ FAIstate => $state ] ]); } # Errors? @@ -2265,8 +2261,7 @@ sub change_goto_state { daemon_log("$session_id INFO: Setting gotoMode to '$state' for ".$entry->dn, 5); my $result; - $result= $ldap_handle->modify($entry->dn, changes => [ - replace => [ gotoMode => $state ] ]); + $result= $ldap_handle->modify($entry->dn, changes => [replace => [ gotoMode => $state ] ]); # Errors? if ($result->code){ diff --git a/gosa-si/server/events/opsi_com.pm b/gosa-si/server/events/opsi_com.pm index fd6ba5da5..851a65e02 100644 --- a/gosa-si/server/events/opsi_com.pm +++ b/gosa-si/server/events/opsi_com.pm @@ -685,7 +685,8 @@ sub opsi_set_product_properties { return ( &create_xml_string($out_hash) ); } } - if ((exists $msg_hash->{'hostId'}) && (@{$msg_hash->{'hostId'}} != 1) || (@{$msg_hash->{'hostId'}}[0] eq ref 'HASH')) { + # if no hostId is given, set_product_properties will act on globally + if ((exists $msg_hash->{'hostId'}) && (@{$msg_hash->{'hostId'}} > 1)) { &add_content2xml_hash($out_hash, "error_string", "hostId contains no or more than one values"); &add_content2xml_hash($out_hash, "error", "hostId"); &main::daemon_log("$session_id ERROR: hostId contains no or more than one values: $msg", 1); -- 2.30.2