summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 01e9064)
raw | patch | inline | side by side (parent: 01e9064)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 Apr 2008 09:02:52 +0000 (09:02 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 Apr 2008 09:02:52 +0000 (09:02 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10349 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/fai/admin/fai/class_faiHook.inc b/gosa-plugins/fai/admin/fai/class_faiHook.inc
index 0e5a17105739cf73dcb6bb90bdd8f232efe78371..84964327618141c13c91b3b185440ccba491c85c 100644 (file)
if(isset($this->SubObjects[base64_decode($_GET['getFAIHook'])])){
$obj = $this->SubObjects[base64_decode($_GET['getFAIHook'])];
$obj = $this->get_object_attributes($obj,$this->sub_Load_Later);
- send_binary_content(stripslashes($obj['FAIscript']),$obj['cn'].".FAIhook");
+ send_binary_content(stripslashes($obj['FAIhook']),$obj['cn'].".FAIhook");
}
}
/* Call common method to give check the hook */
$message= plugin::check();
+ /* Ensure that we do not overwrite an allready existing entry
+ */
+ if($this->is_new){
+ $new_dn= 'cn='.$this->cn.",".get_ou('faihookou').get_ou('faiou').session::get('CurrentMainBase');
+ $faifilter = session::get('faifilter');
+ if($faifilter['branch']!="main"){
+ $new_dn ='cn='.$this->cn.",".get_ou('faihookou').$faifilter['branch'];
+ }
+
+ $res = faiManagement::check_class_name("FAIhook",$this->cn,$new_dn);
+ if(isset($res[$this->cn])){
+ $message[] = msgPool::duplicated(_("Name"));
+ }
+ }
+
return ($message);
}
"description" => _("Description"))
));
}
+
+
+ /*! \brief Used for copy & paste.
+ Returns a HTML input mask, which allows to change the cn of this entry.
+ @param Array Array containing current status && a HTML template.
+ */
+ function getCopyDialog()
+ {
+ $vars = array("cn");
+ $smarty = get_smarty();
+ $smarty->assign("cn", htmlentities($this->cn));
+ $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+ }
+
+
+ /*! \brief Used for copy & paste.
+ Some entries must be renamed to avaoid duplicate entries.
+ */
+ function saveCopyDialog()
+ {
+ if(isset($_POST['cn'])){
+ $this->cn = get_post('cn');
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc
index b6ea4355990103474a06652e7e4837374fc5d400..e855f87757f4c8298f6a5f8784494a9da71103a6 100644 (file)
}
+ /* Check if the given FAI class is used in this release
+ */
+ static function check_class_name($oc,$name,$dn)
+ {
+ $base = FAI::get_release_dn($dn);
+ $res = FAI::get_all_objects_for_given_base($base,"(objectClass=".$oc.")",TRUE);
+ $delete = array();
+ $used = array();
+ foreach($res as $object){
+ $used[$object['cn'][0]]= $object['cn'][0];
+ }
+ return($used);
+ }
+
+
/* Return plugin informations for acl handling */
static function plInfo()
{
diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc
index 76f5cae5cc5797702e2c4fca4ea94a00b99769f4..fe7989ea1eb37c2f9fdecf7c278b2772bee4d0e9 100644 (file)
$message[]=_("Please choose a valid release/section combination for your repository setup!");
}
+ /* Ensure that we do not overwrite an allready existing entry
+ */
+ if($this->is_new){
+ $new_dn= 'cn='.$this->cn.",".get_ou('faipackageou').get_ou('faiou').session::get('CurrentMainBase');
+ $faifilter = session::get('faifilter');
+ if($faifilter['branch']!="main"){
+ $new_dn ='cn='.$this->cn.",".get_ou('faipackageou').$faifilter['branch'];
+ }
+
+ $res = faiManagement::check_class_name("FAIpackageList",$this->cn,$new_dn);
+ if(isset($res[$this->cn])){
+ $message[] = msgPool::duplicated(_("Name"));
+ }
+ }
return ($message);
}
}
+ /*! \brief Used for copy & paste.
+ Returns a HTML input mask, which allows to change the cn of this entry.
+ @param Array Array containing current status && a HTML template.
+ */
+ function getCopyDialog()
+ {
+ $vars = array("cn");
+ $smarty = get_smarty();
+ $smarty->assign("cn", htmlentities($this->cn));
+ $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+ }
+
+
+ /*! \brief Used for copy & paste.
+ Some entries must be renamed to avaoid duplicate entries.
+ */
+ function saveCopyDialog()
+ {
+ if(isset($_POST['cn'])){
+ $this->cn = get_post('cn');
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
index 3179e4cb23e70fd3aa3ff0618fa52281395298f8..a3ed119a810ced7d84bb71f15579650af1160b0c 100644 (file)
/* Call common method to give check the hook */
$message= plugin::check();
+ /* Ensure that we do not overwrite an allready existing entry
+ */
+ if($this->is_new){
+ $new_dn= 'cn='.$this->cn.",".get_ou('faipartitionou').get_ou('faiou').session::get('CurrentMainBase');
+ $faifilter = session::get('faifilter');
+ if($faifilter['branch']!="main"){
+ $new_dn ='cn='.$this->cn.",".get_ou('faipartitionou').$faifilter['branch'];
+ }
+
+ $res = faiManagement::check_class_name("FAIpartitionTable",$this->cn,$new_dn);
+ if(isset($res[$this->cn])){
+ $message[] = msgPool::duplicated(_("Name"));
+ }
+ }
return ($message);
}
"description" => _("Description"))
));
}
+
+
+ /*! \brief Used for copy & paste.
+ Returns a HTML input mask, which allows to change the cn of this entry.
+ @param Array Array containing current status && a HTML template.
+ */
+ function getCopyDialog()
+ {
+ $vars = array("cn");
+ $smarty = get_smarty();
+ $smarty->assign("cn", htmlentities($this->cn));
+ $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+ }
+
+
+ /*! \brief Used for copy & paste.
+ Some entries must be renamed to avaoid duplicate entries.
+ */
+ function saveCopyDialog()
+ {
+ if(isset($_POST['cn'])){
+ $this->cn = get_post('cn');
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc
index ab8ef9a19e3cbb120c7c4cee02416ddc078cee48..d94b760c24e9e159ac6dd1b6182422f7117eab56 100644 (file)
/* Call common method to give check the hook */
$message= plugin::check();
+ /* Ensure that we do not overwrite an allready existing entry
+ */
+ if($this->is_new){
+ $new_dn= 'cn='.$this->cn.",".get_ou('faiscriptou').get_ou('faiou').session::get('CurrentMainBase');
+ $faifilter = session::get('faifilter');
+ if($faifilter['branch']!="main"){
+ $new_dn ='cn='.$this->cn.",".get_ou('faiscriptou').$faifilter['branch'];
+ }
+
+ $res = faiManagement::check_class_name("FAIscript",$this->cn,$new_dn);
+ if(isset($res[$this->cn])){
+ $message[] = msgPool::duplicated(_("Name"));
+ }
+ }
+
return ($message);
}
$this->SubObjects[$objects['cn']] = $objects;
}
}
+
+
+ /*! \brief Used for copy & paste.
+ Returns a HTML input mask, which allows to change the cn of this entry.
+ @param Array Array containing current status && a HTML template.
+ */
+ function getCopyDialog()
+ {
+ $vars = array("cn");
+ $smarty = get_smarty();
+ $smarty->assign("cn", htmlentities($this->cn));
+ $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+ }
+
+
+ /*! \brief Used for copy & paste.
+ Some entries must be renamed to avaoid duplicate entries.
+ */
+ function saveCopyDialog()
+ {
+ if(isset($_POST['cn'])){
+ $this->cn = get_post('cn');
+ }
+ }
/* Return plugin informations for acl handling */
diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc
index 0fdd00ed4501e00306374b2fe785753254ed43b0..ab20b94bb06c5cba7d87f0b6519ca1a8101dd0b3 100644 (file)
/* Call common method to give check the hook */
$message= plugin::check();
+ /* Ensure that we do not overwrite an allready existing entry
+ */
+ if($this->is_new){
+ $new_dn= 'cn='.$this->cn.",".get_ou('faitemplateou').get_ou('faiou').session::get('CurrentMainBase');
+ $faifilter = session::get('faifilter');
+ if($faifilter['branch']!="main"){
+ $new_dn ='cn='.$this->cn.",".get_ou('faitemplateou').$faifilter['branch'];
+ }
+
+ $res = faiManagement::check_class_name("FAItemplate",$this->cn,$new_dn);
+ if(isset($res[$this->cn])){
+ $message[] = msgPool::duplicated(_("Name"));
+ }
+ }
+
return ($message);
}
"description" => _("Description"))
));
}
+
+
+ /*! \brief Used for copy & paste.
+ Returns a HTML input mask, which allows to change the cn of this entry.
+ @param Array Array containing current status && a HTML template.
+ */
+ function getCopyDialog()
+ {
+ $vars = array("cn");
+ $smarty = get_smarty();
+ $smarty->assign("cn", htmlentities($this->cn));
+ $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+ }
+
+
+ /*! \brief Used for copy & paste.
+ Some entries must be renamed to avaoid duplicate entries.
+ */
+ function saveCopyDialog()
+ {
+ if(isset($_POST['cn'])){
+ $this->cn = get_post('cn');
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/gosa-plugins/fai/admin/fai/class_faiVariable.inc
index 53bf6706b5c387159985394a43d84e87cc47c2e6..21722813e27da2251466ec79351338e6a802727c 100644 (file)
/* Call common method to give check the hook */
$message= plugin::check();
+ /* Ensure that we do not overwrite an allready existing entry
+ */
+ if($this->is_new){
+ $new_dn= 'cn='.$this->cn.",".get_ou('faivariableou').get_ou('faiou').session::get('CurrentMainBase');
+ $faifilter = session::get('faifilter');
+ if($faifilter['branch']!="main"){
+ $new_dn ='cn='.$this->cn.",".get_ou('faivariableou').$faifilter['branch'];
+ }
+
+ $res = faiManagement::check_class_name("FAIvariable",$this->cn,$new_dn);
+ if(isset($res[$this->cn])){
+ $message[] = msgPool::duplicated(_("Name"));
+ }
+ }
+
return ($message);
}
"description" => _("Description"))
));
}
+
+
+ /*! \brief Used for copy & paste.
+ Returns a HTML input mask, which allows to change the cn of this entry.
+ @param Array Array containing current status && a HTML template.
+ */
+ function getCopyDialog()
+ {
+ $vars = array("cn");
+ $smarty = get_smarty();
+ $smarty->assign("cn", htmlentities($this->cn));
+ $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
+ }
+
+
+ /*! \brief Used for copy & paste.
+ Some entries must be renamed to avaoid duplicate entries.
+ */
+ function saveCopyDialog()
+ {
+ if(isset($_POST['cn'])){
+ $this->cn = get_post('cn');
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: