Code

Updated license listings
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 23 Sep 2009 12:14:13 +0000 (12:14 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 23 Sep 2009 12:14:13 +0000 (12:14 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14331 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 f54b036a4c50702c256c8b879b28f1698180d66c..7dfa32139c03e9ed9757a9fa7e0f219009102ce7 100644 (file)
@@ -29,7 +29,7 @@ class licenseByProduct extends plugin
   var $init_successfull = FALSE;
 
 
-  function __construct(&$config,$dn)
+  function __construct(&$config,$dn,$a,$b)
   {
     $this->config = $config;
     $this->dn = $this->orig_dn = $dn;
@@ -55,7 +55,7 @@ class licenseByProduct extends plugin
       $this->init_successfull = TRUE;
     }else{
 
-      $res = $this->si->getLicenseUsage("", $this->cn);
+      $res = $this->si->getLicensesForProduct($this->cn);
       if($this->si->is_error()){
         $this->init_successfull = FALSE;
         return;
@@ -126,37 +126,8 @@ class licenseByProduct extends plugin
   }
   
 
-  /* Saves object modifications
-   */  
-  function save()
-  {
-    plugin::save();
-
-    // Send modify/add events
-    $mode = "modify";
-    if($this->orig_dn == "new"){
-      $mode = "add";
-    }
-
-    $this->si->createPool($this->cn, $this->description,$this->productIds,$this->softwareIds);#
-    if($this->si->is_error()){
-      msg_dialog::display(_("Error"),msgPool::siError($this->si->get_error()),ERROR_DIALOG);
-    }else{
-      $this->handle_post_events($mode);
-    }
-
-    // Log action
-    if($mode == "modify"){
-      new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$this->si->get_error());
-    }else{
-      new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$this->si->get_error());
-    }
-
-    return 0;
-  }
-
-  function remove_from_parent(){ return; }
+  function save( ){}
+  function remove_from_parent(){ }
 
  
   static function plInfo()
index 10d9a2074900fa63366d96cdfef82597f02962c6..9b38d320ad1d22ca18ff2d14bdd649df1ee02102 100644 (file)
@@ -40,7 +40,7 @@ class licenseUsageByHost extends plugin
       $this->initially_was_account = FALSE;
     }else{
       $this->initially_was_account = TRUE;
-      $this->cn = $this->orig_cn = preg_replace("/^opsi:cn=([^,]*),.*$/","\\1",$dn);
+      $this->cn = $this->orig_cn = preg_replace("/^opsi:=([^,]*),.*$/","\\1",$dn);
     }
 
     // Extract pool name out of the fake dn.
@@ -55,7 +55,7 @@ class licenseUsageByHost extends plugin
       $this->init_successfull = TRUE;
     }else{
 
-      $res = $this->si->getLicenseUsage("", $this->cn);
+      $res = $this->si->getLicenseUsage($this->cn);
       if($this->si->is_error()){
         $this->init_successfull = FALSE;
         return;
@@ -126,37 +126,8 @@ class licenseUsageByHost extends plugin
   }
   
 
-  /* Saves object modifications
-   */  
-  function save()
-  {
-    plugin::save();
-
-    // Send modify/add events
-    $mode = "modify";
-    if($this->orig_dn == "new"){
-      $mode = "add";
-    }
-
-    $this->si->createPool($this->cn, $this->description,$this->productIds,$this->softwareIds);#
-    if($this->si->is_error()){
-      msg_dialog::display(_("Error"),msgPool::siError($this->si->get_error()),ERROR_DIALOG);
-    }else{
-      $this->handle_post_events($mode);
-    }
-
-    // Log action
-    if($mode == "modify"){
-      new log("modify","users/".get_class($this),$this->dn,array_keys($this->attrs),$this->si->get_error());
-    }else{
-      new log("create","users/".get_class($this),$this->dn,array_keys($this->attrs),$this->si->get_error());
-    }
-
-    return 0;
-  }
-
-  function remove_from_parent(){ return; }
+  function save(){ }
+  function remove_from_parent(){ }
 
  
   static function plInfo()
index d7055cd55275481b609ccfd8a59e73b4a7b2f4ef..2fafdae3b0db9ce38aceccfcda736405f7841a33 100644 (file)
@@ -303,6 +303,9 @@ class opsiLicenceHandler extends opsi  {
     $data= array();
     $data['productId'] = htmlentities($productId);
     $res = $this->send_data("gosa_opsi_getLicenseInformationForProduct",$this->target,$data,TRUE);
+
+    print_a($res);
+
     if(isset($res['XML'][0]['ANSWER_OPSI_UNASSIGNALLSOFTWARELICENSESFROMHOST'])){
       return(TRUE);
     }