From: hickert Date: Thu, 8 Sep 2005 07:58:02 +0000 (+0000) Subject: Added quick create icons X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=41eb37681ad7940736a8b8be94567f03e467abb9;p=gosa.git Added quick create icons git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1327 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/FAI/class_faiHook.inc b/plugins/admin/FAI/class_faiHook.inc index 71406487d..e3355cda0 100644 --- a/plugins/admin/FAI/class_faiHook.inc +++ b/plugins/admin/FAI/class_faiHook.inc @@ -202,10 +202,20 @@ class faiHook extends plugin plugin::save(); $ldap = $this->config->get_ldap_link(); - - /* Write FAIscript to ldap*/ - $ldap->cd($this->dn); - $ldap->modify($this->attrs); + + $ldap->cat($this->dn); + if($ldap->count()!=0){ + /* Write FAIscript to ldap*/ + $ldap->cd($this->dn); + $ldap->modify($this->attrs); + }else{ + /* Write FAIscript to ldap*/ + $ldap->cd($this->dn); + $ldap->create_missing_trees($this->dn); + $ldap->cd($this->dn); + $ldap->add($this->attrs); + } + show_ldap_error($ldap->get_error()); /* Prepare FAIscriptEntry to write it to ldap * First sort array. diff --git a/plugins/admin/FAI/class_faiManagement.inc b/plugins/admin/FAI/class_faiManagement.inc index 16307e7ba..76bf88bf2 100644 --- a/plugins/admin/FAI/class_faiManagement.inc +++ b/plugins/admin/FAI/class_faiManagement.inc @@ -111,6 +111,14 @@ class faiManagement extends plugin foreach($_POST as $key => $val){ if(preg_match("/create_partition/i",$key)){ $s_action = "new_partition"; + }elseif(preg_match("/create_script/i",$key)){ + $s_action = "new_script"; + }elseif(preg_match("/create_hook/i",$key)){ + $s_action = "new_hook"; + }elseif(preg_match("/create_variable/i",$key)){ + $s_action = "new_variable"; + }elseif(preg_match("/create_template/i",$key)){ + $s_action = "new_template"; }elseif(preg_match("/UseNewClass/",$key)){ $s_action = "select_class_name_finished"; }elseif(preg_match("/UseSelectedClass/",$key)){ @@ -215,6 +223,26 @@ class faiManagement extends plugin $this->dialog = new askClassName($this->config,$this->dn,$this->ui,"FAIpartitionTable"); } + /* Dialog handling */ + if($s_action == "new_script"){ + $this->dialog = new askClassName($this->config,$this->dn,$this->ui,"FAIscript"); + } + + /* Dialog handling */ + if($s_action == "new_hook"){ + $this->dialog = new askClassName($this->config,$this->dn,$this->ui,"FAIhook"); + } + + /* Dialog handling */ + if($s_action == "new_variable"){ + $this->dialog = new askClassName($this->config,$this->dn,$this->ui,"FAIvariable"); + } + + /* Dialog handling */ + if($s_action == "new_template"){ + $this->dialog = new askClassName($this->config,$this->dn,$this->ui,"FAItemplate"); + } + if($s_action == "select_class_name_finished"){ $this->dialog->save_object(); if(count($this->dialog->check())!=0){ @@ -223,10 +251,12 @@ class faiManagement extends plugin } }else{ $this->dn = "new" ; + $a_setup= $this->get_type(array("objectClass"=>array($this->dialog->objectClass))); $name = $this->dialog->save(); - $this->dialog = new tabsPartition($this->config, - $this->config->data['TABS']['FAIPARTITIONTABS'],$this->dn); - $this->dialog->by_object['faiPartitionTable']->cn = $name; + + $this->dialog = new $a_setup[0]($this->config, + $this->config->data['TABS'][$a_setup[2]],$this->dn); + $this->dialog->by_object[$a_setup[1]]->cn = $name; $this->is_dialog = true; } } @@ -309,11 +339,20 @@ class faiManagement extends plugin "  ". "  ". - "  ". + "  ". + + "  ". + + "  ". - "  ". + "  ". + + "  ". ""; diff --git a/plugins/admin/FAI/class_faiScript.inc b/plugins/admin/FAI/class_faiScript.inc index ff452e087..f0e0ac5b0 100644 --- a/plugins/admin/FAI/class_faiScript.inc +++ b/plugins/admin/FAI/class_faiScript.inc @@ -203,9 +203,19 @@ class faiScript extends plugin $ldap = $this->config->get_ldap_link(); - /* Write FAIscript to ldap*/ - $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $ldap->cat($this->dn); + if($ldap->count()!=0){ + /* Write FAIscript to ldap*/ + $ldap->cd($this->dn); + $ldap->modify($this->attrs); + }else{ + /* Write FAIscript to ldap*/ + $ldap->cd($this->dn); + $ldap->create_missing_trees($this->dn); + $ldap->cd($this->dn); + $ldap->add($this->attrs); + } + show_ldap_error($ldap->get_error()); /* Prepare FAIscriptEntry to write it to ldap * First sort array. diff --git a/plugins/admin/FAI/class_faiTemplate.inc b/plugins/admin/FAI/class_faiTemplate.inc index e34fa213d..1ddd0120a 100644 --- a/plugins/admin/FAI/class_faiTemplate.inc +++ b/plugins/admin/FAI/class_faiTemplate.inc @@ -203,9 +203,19 @@ class faiTemplate extends plugin $ldap = $this->config->get_ldap_link(); - /* Write FAIscript to ldap*/ - $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $ldap->cat($this->dn); + if($ldap->count()!=0){ + /* Write FAIscript to ldap*/ + $ldap->cd($this->dn); + $ldap->modify($this->attrs); + }else{ + /* Write FAIscript to ldap*/ + $ldap->cd($this->dn); + $ldap->create_missing_trees($this->dn); + $ldap->cd($this->dn); + $ldap->add($this->attrs); + } + show_ldap_error($ldap->get_error()); /* Prepare FAIscriptEntry to write it to ldap * First sort array. diff --git a/plugins/admin/FAI/class_faiVariable.inc b/plugins/admin/FAI/class_faiVariable.inc index a110e0b72..08b839c01 100644 --- a/plugins/admin/FAI/class_faiVariable.inc +++ b/plugins/admin/FAI/class_faiVariable.inc @@ -203,9 +203,19 @@ class faiVariable extends plugin $ldap = $this->config->get_ldap_link(); - /* Write FAIscript to ldap*/ - $ldap->cd($this->dn); - $ldap->modify($this->attrs); + $ldap->cat($this->dn); + if($ldap->count()!=0){ + /* Write FAIscript to ldap*/ + $ldap->cd($this->dn); + $ldap->modify($this->attrs); + }else{ + /* Write FAIscript to ldap*/ + $ldap->cd($this->dn); + $ldap->create_missing_trees($this->dn); + $ldap->cd($this->dn); + $ldap->add($this->attrs); + } + show_ldap_error($ldap->get_error()); /* Prepare FAIscriptEntry to write it to ldap * First sort array.