From 1852db9891bba1618b34f397584db886d3ff0158 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 21 Jun 2007 08:57:42 +0000 Subject: [PATCH] Udpated fai checks git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6647 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiHookEntry.inc | 6 +++++- plugins/admin/fai/class_faiScript.inc | 1 + plugins/admin/fai/class_faiScriptEntry.inc | 6 +++++- plugins/admin/fai/class_faiTemplate.inc | 1 + plugins/admin/fai/class_faiTemplateEntry.inc | 6 +++++- plugins/admin/fai/class_faiVariable.inc | 2 ++ plugins/admin/fai/class_faiVariableEntry.inc | 6 +++++- 7 files changed, 24 insertions(+), 4 deletions(-) diff --git a/plugins/admin/fai/class_faiHookEntry.inc b/plugins/admin/fai/class_faiHookEntry.inc index 244af77bd..52b4e76b0 100644 --- a/plugins/admin/fai/class_faiHookEntry.inc +++ b/plugins/admin/fai/class_faiHookEntry.inc @@ -22,7 +22,7 @@ class faiHookEntry extends plugin var $FAIscript = ""; var $description = ""; var $status = "new"; - + var $parent = NULL; var $FAIstate = ""; function faiHookEntry ($config, $dn= NULL,$object=false) @@ -142,6 +142,10 @@ class faiHookEntry extends plugin /* Call common method to give check the hook */ $message= plugin::check(); + if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){ + $message[] =_("There is already a hook with the given name."); + } + if(empty($this->FAIscript)) { $message[]=_("Please enter a value for script."); } diff --git a/plugins/admin/fai/class_faiScript.inc b/plugins/admin/fai/class_faiScript.inc index 9c01f5489..72f2d2009 100644 --- a/plugins/admin/fai/class_faiScript.inc +++ b/plugins/admin/fai/class_faiScript.inc @@ -155,6 +155,7 @@ class faiScript extends plugin $this->dialog= new $this->subClassName($this->config,"new"); $this->dialog->set_acl_base($this->acl_base); $this->dialog->set_acl_category("fai"); + $this->dialog->parent = &$this; $this->is_dialog=true; } diff --git a/plugins/admin/fai/class_faiScriptEntry.inc b/plugins/admin/fai/class_faiScriptEntry.inc index f7473c553..4f5cf2990 100644 --- a/plugins/admin/fai/class_faiScriptEntry.inc +++ b/plugins/admin/fai/class_faiScriptEntry.inc @@ -20,7 +20,7 @@ class faiScriptEntry extends plugin var $FAIscript = ""; var $description = ""; var $status = "new"; - + var $parent = NULL; var $FAIstate = ""; function faiScriptEntry ($config, $dn= NULL,$object=false) @@ -132,6 +132,10 @@ class faiScriptEntry extends plugin /* Call common method to give check the hook */ $message= plugin::check(); + if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){ + $message[] =_("There is already a script with the given name."); + } + if(empty($this->cn)){ $message[] = _("Please enter a name."); } diff --git a/plugins/admin/fai/class_faiTemplate.inc b/plugins/admin/fai/class_faiTemplate.inc index e2fe6d383..09d8e2321 100644 --- a/plugins/admin/fai/class_faiTemplate.inc +++ b/plugins/admin/fai/class_faiTemplate.inc @@ -186,6 +186,7 @@ class faiTemplate extends plugin $this->dialog= new $this->subClassName($this->config,"new"); $this->dialog->set_acl_base($this->acl_base); $this->dialog->set_acl_category("fai"); + $this->dialog->parent = &$this; $this->is_dialog=true; } } diff --git a/plugins/admin/fai/class_faiTemplateEntry.inc b/plugins/admin/fai/class_faiTemplateEntry.inc index 7a3c48ddf..203c789ba 100644 --- a/plugins/admin/fai/class_faiTemplateEntry.inc +++ b/plugins/admin/fai/class_faiTemplateEntry.inc @@ -25,7 +25,7 @@ class faiTemplateEntry extends plugin var $user = "root"; var $group = "root"; var $binary = false; - + var $parent = NULL; var $FAIstate = ""; function faiTemplateEntry ($config, $dn= NULL,$object=false) @@ -184,6 +184,10 @@ class faiTemplateEntry extends plugin /* Call common method to give check the hook */ $message= plugin::check(); + if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){ + $message[] =_("There is already a template with the given name."); + } + if(empty($this->FAItemplateFile)){ $message[]=_("Please specify a value for attribute 'file'."); } diff --git a/plugins/admin/fai/class_faiVariable.inc b/plugins/admin/fai/class_faiVariable.inc index dce2b16f3..f275209ef 100644 --- a/plugins/admin/fai/class_faiVariable.inc +++ b/plugins/admin/fai/class_faiVariable.inc @@ -124,6 +124,7 @@ class faiVariable extends plugin $this->dialog= new $this->subClassName($this->config,"new"); $this->dialog->set_acl_base($this->acl_base_for_current_object($this->dn)); $this->dialog->set_acl_category("fai"); + $this->dialog->parent = &$this; $this->is_dialog=true; } @@ -140,6 +141,7 @@ class faiVariable extends plugin $this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$var]); $this->dialog->set_acl_category("fai"); $this->dialog->set_acl_base($c_dn); + $this->dialog->parent = &$this; $_SESSION['objectinfo'] = $this->SubObjects[$var]['dn']; $this->is_dialog=true; } diff --git a/plugins/admin/fai/class_faiVariableEntry.inc b/plugins/admin/fai/class_faiVariableEntry.inc index 6dc864d17..ce47af952 100644 --- a/plugins/admin/fai/class_faiVariableEntry.inc +++ b/plugins/admin/fai/class_faiVariableEntry.inc @@ -18,7 +18,7 @@ class faiVariableEntry extends plugin var $FAIvariableContent = ""; var $description = ""; var $status = "new"; - + var $parent = NULL; var $FAIstate = ""; function faiVariableEntry ($config, $dn= NULL,$object=false) @@ -98,6 +98,10 @@ class faiVariableEntry extends plugin { /* Call common method to give check the hook */ $message= plugin::check(); + + if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){ + $message[] =_("There is already a variable with the given name."); + } if(empty($this->FAIvariableContent)) { $message[]=_("Please specify a value for the attribute 'content'."); -- 2.30.2