From c4dfca36a6acd068bfc877302236b5d56dd2aa0d Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 17 Jul 2008 08:04:31 +0000 Subject: [PATCH] Updated FAI management. -Updated FAIstate detection git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11695 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/fai/admin/fai/class_FAI.inc | 21 ++++++++++- .../fai/admin/fai/class_faiManagement.inc | 35 +------------------ 2 files changed, 21 insertions(+), 35 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_FAI.inc b/gosa-plugins/fai/admin/fai/class_FAI.inc index f935bd4c9..9b25238f7 100644 --- a/gosa-plugins/fai/admin/fai/class_FAI.inc +++ b/gosa-plugins/fai/admin/fai/class_FAI.inc @@ -26,7 +26,14 @@ class FAI /* Collect some basic informations and initialize some variables */ $base_release = FAI::get_release_dn($Current_DN); - $previous_releases = array_reverse(FAI:: get_previous_releases_of_this_release($base_release,true)); + $previous_releases = array_reverse(FAI::get_previous_releases_of_this_release($base_release,true)); + + $ldap->cat($base_release); + $attrs = $ldap->fetch(); + $FAIstate = "branch"; + if(isset($attrs['FAIstate'][0])){ + $FAIstate = $attrs['FAIstate'][0]; + } /* We must also include the given release dn */ $previous_releases[] = $base_release; @@ -59,6 +66,18 @@ class FAI } } + /* Seems to be an inherited class, apply current FAIstate to this classes + */ + if(!preg_match("/".normalizePreg($base_release)."$/i",$attr['dn'])){ + $buffer['FAIstate'] = $FAIstate; + }else{ + + /* Seems to be created within this release department. + This indicates - it can't be of state "freeze" + */ + $buffer['FAIstate'] = "branch"; + } + /* In detailed mode are some additonal informations visible */ if($detailed){ diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index b2b9a2541..3e495a9d5 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -1082,16 +1082,6 @@ class faiManagement extends plugin $ldap = $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); - /* Get release tag - If current release is freezed, all objects are freezed to. - */ - $ldap->cat($base); - $release_attrs = $ldap->fetch(); - $force_freezed = FALSE; - if(isset($release_attrs['FAIstate'][0]) && preg_match("/freeze/i",$release_attrs['FAIstate'][0])){ - $force_freezed = TRUE; - } - foreach($tmp as $entry){ /* Get some more informations about the object */ @@ -1117,33 +1107,10 @@ class faiManagement extends plugin $obj['dn'] = $object['dn']; $obj['acl'] = $acl; $obj['class'] = $rest ['ACL']; + $obj['FAIstate'] = $entry['FAIstate']; $obj['description'] = $object['description'][0]; $obj['objectClass'] = $object['objectClass']; - /* Append type to this string, to be able to check if the selected - * entry is of type 'freeze' or 'branch' - */ -# if(!isset($object['FAIstate'])){ - - /* Is this entry inherited from an earlier release? - In this case inherit the FAIstate from the release container. - If this is a newly created entry (allow_freeze_object_attach == TRUE) - then allow to edit this entry by setting its FAIstate manually to branch. - */ - if($this->allow_freeze_object_attach && preg_match("/".normalizePreg($this->fai_release)."$/i",$object['dn'])){ - $obj['FAIstate'] = "branch|overridden_by_management_reload"; - }else{ - $obj['FAIstate'] = $this->lock_type; - } - -# }else{ -# $obj['FAIstate'] = $object['FAIstate'][0]; -# } - - if($force_freezed && !$this->allow_freeze_object_attach){ - $obj['FAIstate'] = "freeze"; - } - $this->objects[strtolower($obj['cn']).$obj['cn'].$type] = $obj; $this->objects[strtolower($obj['cn']).$obj['cn'].$type]['type']=$type; } -- 2.30.2