From: hickert Date: Thu, 17 Apr 2008 10:04:11 +0000 (+0000) Subject: Only reload FAI classes, if a class was added or removed X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=85d8706b9b4d41399e2b6c645420227034204932;p=gosa.git Only reload FAI classes, if a class was added or removed git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10533 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_FAI.inc b/gosa-plugins/fai/admin/fai/class_FAI.inc index 14bf01cd0..b0677537f 100644 --- a/gosa-plugins/fai/admin/fai/class_FAI.inc +++ b/gosa-plugins/fai/admin/fai/class_FAI.inc @@ -295,6 +295,8 @@ class FAI global $config; /* Variable init*/ $to_save = array(); + + $reload_fai_classes = FALSE; /* check which objects must be saved */ $FAI_objects_to_save = session::get('FAI_objects_to_save'); @@ -378,6 +380,12 @@ class FAI }else{ $objectAttrs['FAIstate'][0] = "|removed"; } + + /* Force reload of FAI classes */ + $classes = array("FAIprofile","FAIscript","FAIpackageList","FAIpartitionTable","FAIHook","FAIvariable","FAItemplate"); + if(count(array_intersect($classes,$objectAttrs['objectClass']))){ + $reload_fai_classes = TRUE; + } } } @@ -390,6 +398,13 @@ class FAI print_a($objectAttrs); } FAI::save_FAI_object($Current_DN,$objectAttrs); + + /* Force reload of FAI classes */ + $classes = array("FAIprofile","FAIscript","FAIpackageList","FAIpartitionTable","FAIHook","FAIvariable","FAItemplate"); + if(count(array_intersect($classes,$objectAttrs['objectClass']))){ + $reload_fai_classes = TRUE; + } + }else{ /* This object is inherited by some sub releases */ @@ -404,6 +419,12 @@ class FAI /* New objects require special handling */ if($is_new){ + /* Force reload of FAI classes */ + $classes = array("FAIprofile","FAIscript","FAIpackageList","FAIpartitionTable","FAIHook","FAIvariable","FAItemplate"); + if(count(array_intersect($classes,$objectAttrs['objectClass']))){ + $reload_fai_classes = TRUE; + } + /* check if there is already an entry named like this, in one of our parent releases */ if(!empty($parent_obj)){ @@ -472,8 +493,8 @@ class FAI /* Reload GOsa si FAI DB/cache */ - if(count($to_save)){ - if(class_available("DaemonEvent") && class_available("gosaSupportDaemon")){ + if($reload_fai_classes){ + if( class_available("DaemonEvent") && class_available("gosaSupportDaemon")){ $events = DaemonEvent::get_event_types(SYSTEM_EVENT | HIDDEN_EVENT); if(isset($events['TRIGGERED']['DaemonEvent_recreate_fai_release_db'])){ $evt = $events['TRIGGERED']['DaemonEvent_recreate_fai_release_db'];