[icinga-checkins] icinga.org: icinga-web/mhein/default: Added "defaultTarget" property for principals

git at icinga.org git at icinga.org
Tue May 25 11:59:21 CEST 2010


Module: icinga-web
Branch: mhein/default
Commit: c5c2975cbef4cfdfecc75c9721fba91a3274b43b
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=c5c2975cbef4cfdfecc75c9721fba91a3274b43b

Author: jmosshammer <jannis.mosshammer at netways.de>
Date:   Thu May 20 13:16:02 2010 +0200

Added "defaultTarget" property for principals

---

 ...DataHostCustomVariablePrincipalTarget.class.php |    4 +++-
 .../IcingaDataHostgroupPrincipalTarget.class.php   |    2 ++
 .../principal/IcingaDataPrincipalTarget.class.php  |   10 +++++++---
 ...aServiceCustomVariablePrincipalTarget.class.php |    4 +++-
 ...IcingaDataServicegroupPrincipalTarget.class.php |    2 ++
 5 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/app/modules/Web/lib/principal/IcingaDataHostCustomVariablePrincipalTarget.class.php b/app/modules/Web/lib/principal/IcingaDataHostCustomVariablePrincipalTarget.class.php
index a1cad6e..f793467 100644
--- a/app/modules/Web/lib/principal/IcingaDataHostCustomVariablePrincipalTarget.class.php
+++ b/app/modules/Web/lib/principal/IcingaDataHostCustomVariablePrincipalTarget.class.php
@@ -6,11 +6,13 @@ class IcingaDataHostCustomVariablePrincipalTarget extends IcingaDataPrincipalTar
 		
 		parent::__construct();
 		
+		$this->setDefaultTarget('host');
+
 		$this->setFields(array(
 			'cv_name'	=> 'Name of the custom variable',
 			'cv_value'	=> 'Value contained ba the variable'
 		));
-		
+	
 		$this->setApiMappingFields(array(
 			'cv_name'	=> 'HOST_CUSTOMVARIABLE_NAME',
 			'cv_value'	=> 'HOST_CUSTOMVARIABLE_VALUE'
diff --git a/app/modules/Web/lib/principal/IcingaDataHostgroupPrincipalTarget.class.php b/app/modules/Web/lib/principal/IcingaDataHostgroupPrincipalTarget.class.php
index a61eba8..dc98cb0 100644
--- a/app/modules/Web/lib/principal/IcingaDataHostgroupPrincipalTarget.class.php
+++ b/app/modules/Web/lib/principal/IcingaDataHostgroupPrincipalTarget.class.php
@@ -6,6 +6,8 @@ class IcingaDataHostgroupPrincipalTarget extends IcingaDataPrincipalTarget {
 	public function __construct() {
 		
 		parent::__construct();
+
+		$this->setDefaultTarget('hostgroup');
 		
 		$this->setFields(array(
 			'hostgroup'	=> 'The sql part of a hostgroup name'
diff --git a/app/modules/Web/lib/principal/IcingaDataPrincipalTarget.class.php b/app/modules/Web/lib/principal/IcingaDataPrincipalTarget.class.php
index cfd402f..f034b0f 100644
--- a/app/modules/Web/lib/principal/IcingaDataPrincipalTarget.class.php
+++ b/app/modules/Web/lib/principal/IcingaDataPrincipalTarget.class.php
@@ -1,15 +1,19 @@
 <?php
 
 class IcingaDataPrincipalTarget extends AppKitPrincipalTarget {
-	protected $securityDefinition = array();
+	protected $defaultTarget = '';
 	protected $api_mapping_fields = array ();
 
 	public function getApiMappingFields() {
 		return $this->api_mapping_fields;
 	}
 	
-	public function getSecurityDefinition() {
-		return $this->securityDefinition;
+	public function setDefaultTarget($target) {
+		$this->defaultTarget = $target;	
+	}
+	
+	public function getDefaultTarget() {
+		return $this->defaultTarget;
 	}
 	
 	protected function setApiMappingFields(array $a) {
diff --git a/app/modules/Web/lib/principal/IcingaDataServiceCustomVariablePrincipalTarget.class.php b/app/modules/Web/lib/principal/IcingaDataServiceCustomVariablePrincipalTarget.class.php
index 5d2bfa9..c02121c 100644
--- a/app/modules/Web/lib/principal/IcingaDataServiceCustomVariablePrincipalTarget.class.php
+++ b/app/modules/Web/lib/principal/IcingaDataServiceCustomVariablePrincipalTarget.class.php
@@ -5,7 +5,8 @@ class IcingaDataServiceCustomVariablePrincipalTarget extends IcingaDataPrincipal
 	public function __construct() {
 		
 		parent::__construct();
-		
+			$this->setDefaultTarget('service');
+			
 		$this->setFields(array(
 			'cv_name'	=> 'Name of the custom variable',
 			'cv_value'	=> 'Value contained ba the variable'
@@ -16,6 +17,7 @@ class IcingaDataServiceCustomVariablePrincipalTarget extends IcingaDataPrincipal
 			'cv_value'	=> 'SERVICE_CUSTOMVARIABLE_VALUE'
 		));
 		
+		
 		$this->setType('IcingaDataTarget');
 		
 		$this->setDescription('Limit data access to customvariables');
diff --git a/app/modules/Web/lib/principal/IcingaDataServicegroupPrincipalTarget.class.php b/app/modules/Web/lib/principal/IcingaDataServicegroupPrincipalTarget.class.php
index cce0e34..2da0c7b 100644
--- a/app/modules/Web/lib/principal/IcingaDataServicegroupPrincipalTarget.class.php
+++ b/app/modules/Web/lib/principal/IcingaDataServicegroupPrincipalTarget.class.php
@@ -7,6 +7,8 @@ class IcingaDataServicegroupPrincipalTarget extends IcingaDataPrincipalTarget {
 		
 		parent::__construct();
 		
+		$this->setDefaultTarget('servicegroup');
+			
 		$this->setFields(array(
 			'servicegroup'	=> 'The sql part of a servicegroup name'
 		));





More information about the icinga-checkins mailing list