Code

Updated host and product handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 23 Sep 2009 12:50:31 +0000 (12:50 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 23 Sep 2009 12:50:31 +0000 (12:50 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14332 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc
gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsageByHost.inc
gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenseHandler.inc

index 7dfa32139c03e9ed9757a9fa7e0f219009102ce7..b7c2ce5f99e8c3ce68fecd5dedd2a574614d7152 100644 (file)
@@ -56,7 +56,7 @@ class licenseByProduct extends plugin
     }else{
 
       $res = $this->si->getLicensesForProduct($this->cn);
-      if($this->si->is_error()){
+      if($this->si->is_error() || !$res){
         $this->init_successfull = FALSE;
         return;
       }
index 9b38d320ad1d22ca18ff2d14bdd649df1ee02102..a6ba92f37c3bc22cfb72cff4f3f1a009cfa7bc0c 100644 (file)
@@ -56,7 +56,7 @@ class licenseUsageByHost extends plugin
     }else{
 
       $res = $this->si->getLicenseUsage($this->cn);
-      if($this->si->is_error()){
+      if($this->si->is_error() || !$res){
         $this->init_successfull = FALSE;
         return;
       }
index 2fafdae3b0db9ce38aceccfcda736405f7841a33..63e472935c823af1c62319ce93fae364097fee66 100644 (file)
@@ -304,10 +304,12 @@ class opsiLicenceHandler extends opsi  {
     $data['productId'] = htmlentities($productId);
     $res = $this->send_data("gosa_opsi_getLicenseInformationForProduct",$this->target,$data,TRUE);
 
-    print_a($res);
-
+    if(isset($res['XML'][0]['ERROR_OPSI_GETLICENSEINFORMATIONFORPRODUCT'])){
+#      $this->set_error($res['XML'][0]['ERROR_OPSI_GETLICENSEINFORMATIONFORPRODUCT']);
+      return(FALSE);
+    }
     if(isset($res['XML'][0]['ANSWER_OPSI_UNASSIGNALLSOFTWARELICENSESFROMHOST'])){
-      return(TRUE);
+      return($res['XML'][0]);
     }
     return(FALSE);
   }