From f9e634898104782b4b12524c014776ca5357f58f Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 23 Sep 2009 12:14:13 +0000 Subject: [PATCH] Updated license listings git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14331 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../opsiLicenses/class_licenseByProduct.inc | 37 ++----------------- .../opsiLicenses/class_licenseUsageByHost.inc | 37 ++----------------- .../opsiLicenses/class_opsiLicenseHandler.inc | 3 ++ 3 files changed, 11 insertions(+), 66 deletions(-) diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc index f54b036a4..7dfa32139 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc +++ b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseByProduct.inc @@ -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() diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsageByHost.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsageByHost.inc index 10d9a2074..9b38d320a 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsageByHost.inc +++ b/gosa-plugins/opsi/admin/opsiLicenses/class_licenseUsageByHost.inc @@ -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() diff --git a/gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenseHandler.inc b/gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenseHandler.inc index d7055cd55..2fafdae3b 100644 --- a/gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenseHandler.inc +++ b/gosa-plugins/opsi/admin/opsiLicenses/class_opsiLicenseHandler.inc @@ -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); } -- 2.30.2