From: hickert Date: Tue, 15 Jan 2008 12:45:30 +0000 (+0000) Subject: Replaced prepare_to_save_FAI_object with fai_func::prepare_to_save_FAI_object X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ede7b2ad67ff027adc53e04c62c9b04bdb205f07;p=gosa.git Replaced prepare_to_save_FAI_object with fai_func::prepare_to_save_FAI_object git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8351 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/fai/class_faiHook.inc b/gosa-core/plugins/admin/fai/class_faiHook.inc index 6aa43ba98..22da2e5a2 100644 --- a/gosa-core/plugins/admin/fai/class_faiHook.inc +++ b/gosa-core/plugins/admin/fai/class_faiHook.inc @@ -409,7 +409,7 @@ class faiHook extends plugin $use_dn = $this->dn; } - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); new log("remove","fai/".get_class($this),$use_dn,$this->attributes); @@ -418,7 +418,7 @@ class faiHook extends plugin if($faifilter['branch'] == "main"){ $use_dn = $obj['dn']; } - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); } $this->handle_post_events("remove"); } @@ -456,7 +456,7 @@ class faiHook extends plugin $ldap = $this->config->get_ldap_link(); - prepare_to_save_FAI_object($this->dn,$this->attrs); + fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs); show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/hook with dn '%s' failed."),$this->dn)); if($this->initially_was_account){ @@ -537,13 +537,13 @@ class faiHook extends plugin } if($obj['status'] == "delete"){ - prepare_to_save_FAI_object($sub_dn,array(),true); + fai_func::prepare_to_save_FAI_object($sub_dn,array(),true); $this->handle_post_events("remove"); }elseif($obj['status'] == "edited"){ - prepare_to_save_FAI_object($sub_dn,$tmp); + fai_func::prepare_to_save_FAI_object($sub_dn,$tmp); $this->handle_post_events("modify"); }elseif($obj['status']=="new"){ - prepare_to_save_FAI_object($sub_dn,$tmp); + fai_func::prepare_to_save_FAI_object($sub_dn,$tmp); $this->handle_post_events("add"); } $this->handle_object_tagging($sub_dn, $this->gosaUnitTag); diff --git a/gosa-core/plugins/admin/fai/class_faiPackage.inc b/gosa-core/plugins/admin/fai/class_faiPackage.inc index 3e4656b42..2e62249bb 100644 --- a/gosa-core/plugins/admin/fai/class_faiPackage.inc +++ b/gosa-core/plugins/admin/fai/class_faiPackage.inc @@ -341,7 +341,7 @@ class faiPackage extends plugin $use_dn = $this->dn; } - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); new log("remove","fai/".get_class($this),$use_dn,$this->attributes); @@ -352,7 +352,7 @@ class faiPackage extends plugin if($faifilter['branch'] == "main"){ $use_dn = $obj['dn']; } - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); } } $this->handle_post_events("remove"); @@ -492,7 +492,7 @@ class faiPackage extends plugin $this->attrs['FAIdebianSection'][] = $sec; } - prepare_to_save_FAI_object($this->dn,$this->attrs); + fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs); show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/package list with dn '%s' failed."),$this->dn)); if($this->initially_was_account){ @@ -534,7 +534,7 @@ class faiPackage extends plugin } if(in_array($pkgattrs['FAIvariableType'],array("boolean","multiselect","password","select","string","text"))){ - prepare_to_save_FAI_object($pkgdn,$pkgattrs); + fai_func::prepare_to_save_FAI_object($pkgdn,$pkgattrs); } /* Handle tagging */ diff --git a/gosa-core/plugins/admin/fai/class_faiPartitionTable.inc b/gosa-core/plugins/admin/fai/class_faiPartitionTable.inc index 29d3c86c9..55827a6a4 100644 --- a/gosa-core/plugins/admin/fai/class_faiPartitionTable.inc +++ b/gosa-core/plugins/admin/fai/class_faiPartitionTable.inc @@ -351,7 +351,7 @@ class faiPartitionTable extends plugin $use_dn = $this->dn; } - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); new log("remove","fai/".get_class($this),$use_dn,$this->attributes); @@ -362,7 +362,7 @@ class faiPartitionTable extends plugin if($faifilter['branch'] == "main"){ $use_dn = $disk_dn; } - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); foreach($disk['partitions'] as $key => $partition){ @@ -371,7 +371,7 @@ class faiPartitionTable extends plugin if($faifilter['branch'] == "main"){ $use_dn = $disk_dn; } - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); } } } @@ -414,7 +414,7 @@ class faiPartitionTable extends plugin $ldap = $this->config->get_ldap_link(); - prepare_to_save_FAI_object($this->dn,$this->attrs); + fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs); show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/partition table with dn '%s' failed."),$this->dn)); if($this->initially_was_account){ @@ -461,13 +461,13 @@ class faiPartitionTable extends plugin } if($disk['status'] == "delete"){ - prepare_to_save_FAI_object($disk_dn,array(),true); + fai_func::prepare_to_save_FAI_object($disk_dn,array(),true); $this->handle_post_events("remove"); }elseif($disk['status'] == "edited"){ - prepare_to_save_FAI_object($disk_dn,$disk_attrs); + fai_func::prepare_to_save_FAI_object($disk_dn,$disk_attrs); $this->handle_post_events("modify"); }elseif($disk['status']=="new"){ - prepare_to_save_FAI_object($disk_dn,$disk_attrs); + fai_func::prepare_to_save_FAI_object($disk_dn,$disk_attrs); $this->handle_post_events("add"); } @@ -512,13 +512,13 @@ class faiPartitionTable extends plugin } if($partition['status'] == "delete"){ - prepare_to_save_FAI_object($partition_dn,array(),true); + fai_func::prepare_to_save_FAI_object($partition_dn,array(),true); $this->handle_post_events("remove"); }elseif($partition['status'] == "edited"){ - prepare_to_save_FAI_object($partition_dn,$partition_attrs); + fai_func::prepare_to_save_FAI_object($partition_dn,$partition_attrs); $this->handle_post_events("modify"); }elseif($partition['status']=="new"){ - prepare_to_save_FAI_object($partition_dn,$partition_attrs); + fai_func::prepare_to_save_FAI_object($partition_dn,$partition_attrs); $this->handle_post_events("add"); } diff --git a/gosa-core/plugins/admin/fai/class_faiProfile.inc b/gosa-core/plugins/admin/fai/class_faiProfile.inc index fb6d1877e..382f09baf 100644 --- a/gosa-core/plugins/admin/fai/class_faiProfile.inc +++ b/gosa-core/plugins/admin/fai/class_faiProfile.inc @@ -376,7 +376,7 @@ class faiProfile extends plugin } new log("remove","fai/".get_class($this),$use_dn,$this->attributes); - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); $this->handle_post_events("remove"); } @@ -440,7 +440,7 @@ class faiProfile extends plugin $this->attrs['FAIclass']=trim($this->FAIclass); - prepare_to_save_FAI_object($this->dn,$this->attrs); + fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs); if($this->initially_was_account){ new log("modify","fai/".get_class($this),$this->dn,$this->attributes); diff --git a/gosa-core/plugins/admin/fai/class_faiScript.inc b/gosa-core/plugins/admin/fai/class_faiScript.inc index af71b587f..3f3ba1fbd 100644 --- a/gosa-core/plugins/admin/fai/class_faiScript.inc +++ b/gosa-core/plugins/admin/fai/class_faiScript.inc @@ -445,14 +445,14 @@ class faiScript extends plugin new log("remove","fai/".get_class($this),$use_dn,$this->attributes); - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); foreach($this->SubObjects as $name => $obj){ $use_dn = preg_replace("/".normalizePreg(fai_func::get_release_dn($this->dn))."/i", $faifilter['branch'], $obj['dn']); if($faifilter['branch'] == "main"){ $use_dn = $obj['dn']; } - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); } $this->handle_post_events("remove"); } @@ -503,7 +503,7 @@ class faiScript extends plugin $ldap = $this->config->get_ldap_link(); - prepare_to_save_FAI_object($this->dn,$this->attrs); + fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs); show_ldap_error($ldap->get_error(), sprintf(_("Creating of FAI/script with dn '%s' failed."),$this->dn)); if($this->initially_was_account){ @@ -587,13 +587,13 @@ class faiScript extends plugin } if($obj['status'] == "delete"){ - prepare_to_save_FAI_object($sub_dn,array(),true); + fai_func::prepare_to_save_FAI_object($sub_dn,array(),true); $this->handle_post_events("remove"); }elseif($obj['status'] == "edited"){ - prepare_to_save_FAI_object($sub_dn,$tmp); + fai_func::prepare_to_save_FAI_object($sub_dn,$tmp); $this->handle_post_events("modify"); }elseif($obj['status']=="new"){ - prepare_to_save_FAI_object($sub_dn,$tmp); + fai_func::prepare_to_save_FAI_object($sub_dn,$tmp); $this->handle_post_events("add"); } diff --git a/gosa-core/plugins/admin/fai/class_faiTemplate.inc b/gosa-core/plugins/admin/fai/class_faiTemplate.inc index 831f0c427..b3e24e863 100644 --- a/gosa-core/plugins/admin/fai/class_faiTemplate.inc +++ b/gosa-core/plugins/admin/fai/class_faiTemplate.inc @@ -393,7 +393,7 @@ class faiTemplate extends plugin $use_dn = $this->dn; } - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); new log("remove","fai/".get_class($this),$use_dn,$this->attributes); foreach($this->SubObjects as $name => $obj){ @@ -401,7 +401,7 @@ class faiTemplate extends plugin if($faifilter['branch'] == "main"){ $use_dn = $obj['dn']; } - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); } $this->handle_post_events("remove"); } @@ -434,7 +434,7 @@ class faiTemplate extends plugin $ldap = $this->config->get_ldap_link(); - prepare_to_save_FAI_object($this->dn,$this->attrs); + fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs); show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/template with dn '%s' failed."),$this->dn)); if($this->initially_was_account){ @@ -506,13 +506,13 @@ class faiTemplate extends plugin } if($obj['status'] == "delete"){ - prepare_to_save_FAI_object($sub_dn,array(),true); + fai_func::prepare_to_save_FAI_object($sub_dn,array(),true); $this->handle_post_events("remove"); }elseif($obj['status'] == "edited"){ - prepare_to_save_FAI_object($sub_dn,$tmp); + fai_func::prepare_to_save_FAI_object($sub_dn,$tmp); $this->handle_post_events("modify"); }elseif($obj['status']=="new"){ - prepare_to_save_FAI_object($sub_dn,$tmp); + fai_func::prepare_to_save_FAI_object($sub_dn,$tmp); $this->handle_post_events("add"); } diff --git a/gosa-core/plugins/admin/fai/class_faiVariable.inc b/gosa-core/plugins/admin/fai/class_faiVariable.inc index 24a5aed64..32f26c1b9 100644 --- a/gosa-core/plugins/admin/fai/class_faiVariable.inc +++ b/gosa-core/plugins/admin/fai/class_faiVariable.inc @@ -290,7 +290,7 @@ class faiVariable extends plugin $use_dn = $this->dn; } - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); new log("remove","fai/".get_class($this),$use_dn,$this->attributes); foreach($this->SubObjects as $name => $obj){ @@ -298,7 +298,7 @@ class faiVariable extends plugin if($faifilter['branch'] == "main"){ $use_dn = $obj['dn']; } - prepare_to_save_FAI_object($use_dn,array(),true); + fai_func::prepare_to_save_FAI_object($use_dn,array(),true); } $this->handle_post_events("remove"); } @@ -336,7 +336,7 @@ class faiVariable extends plugin plugin::save(); $ldap = $this->config->get_ldap_link(); - prepare_to_save_FAI_object($this->dn,$this->attrs); + fai_func::prepare_to_save_FAI_object($this->dn,$this->attrs); show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/variable with dn '%s' failed."),$this->dn)); if($this->initially_was_account){ @@ -402,13 +402,13 @@ class faiVariable extends plugin } if($obj['status'] == "delete"){ - prepare_to_save_FAI_object($sub_dn,array(),true); + fai_func::prepare_to_save_FAI_object($sub_dn,array(),true); $this->handle_post_events("remove"); }elseif($obj['status'] == "edited"){ - prepare_to_save_FAI_object($sub_dn,$tmp); + fai_func::prepare_to_save_FAI_object($sub_dn,$tmp); $this->handle_post_events("modify"); }elseif($obj['status']=="new"){ - prepare_to_save_FAI_object($sub_dn,$tmp); + fai_func::prepare_to_save_FAI_object($sub_dn,$tmp); $this->handle_post_events("add"); } diff --git a/gosa-core/plugins/admin/fai/functions_FAI.inc b/gosa-core/plugins/admin/fai/functions_FAI.inc index 2fd161d57..822860a3e 100644 --- a/gosa-core/plugins/admin/fai/functions_FAI.inc +++ b/gosa-core/plugins/admin/fai/functions_FAI.inc @@ -3,8 +3,6 @@ define("DEBUG_FAI_FUNC",FALSE); - - class fai_func { @@ -14,7 +12,7 @@ class fai_func This function resolves the releases from base up to the given dn. */ -static function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false) + static function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false) { global $config; $ldap = $config->get_ldap_link(); @@ -92,7 +90,7 @@ static function get_all_objects_for_given_base($Current_DN,$filter,$detailed = f /* Return all relevant FAI departments */ -static function get_FAI_departments($suffix = "") + static function get_FAI_departments($suffix = "") { $arr = array("hooks","scripts","disk","packages","profiles","templates","variables"); $tmp = array(); @@ -111,7 +109,7 @@ static function get_FAI_departments($suffix = "") /* Return all releases within the given base */ -static function get_all_releases_from_base($dn,$appendedName=false) + static function get_all_releases_from_base($dn,$appendedName=false) { global $config; @@ -137,7 +135,7 @@ static function get_all_releases_from_base($dn,$appendedName=false) /* Add this object to list of objects, that must be checked for release saving */ -static function prepare_to_save_FAI_object($Current_DN,$objectAttrs,$removed = false) + static function prepare_to_save_FAI_object($Current_DN,$objectAttrs,$removed = false) { /* Get ldap object */ global $config; @@ -168,7 +166,7 @@ static function prepare_to_save_FAI_object($Current_DN,$objectAttrs,$removed = f /* Detect differences in attribute arrays */ -static function array_diff_FAI($ar1,$ar2) + static function array_diff_FAI($ar1,$ar2) { if((!isset($ar1['description'])) || (isset($ar1['description']) && (count($ar1['description']) == 0))){ @@ -203,7 +201,7 @@ static function array_diff_FAI($ar1,$ar2) } -static function arr_diff($ar1,$ar2) + static function arr_diff($ar1,$ar2) { foreach($ar1 as $ak1 => $av1){ if(!isset($ar2[$ak1]) || (!($av1 === $ar2[$ak1]))){ @@ -219,7 +217,7 @@ static function arr_diff($ar1,$ar2) /* check which objects must be saved, and save them */ -static function save_release_changes_now() + static function save_release_changes_now() { /* Variable init*/ $to_save = array(); @@ -397,7 +395,7 @@ static function save_release_changes_now() /* this function will remove all unused (deleted) objects, that have no parent object */ -static function clean_up_releases($Current_DN) + static function clean_up_releases($Current_DN) { global $config; $ldap = $config->get_ldap_link(); @@ -452,7 +450,7 @@ static function clean_up_releases($Current_DN) /* Remove numeric index and 'count' from ldap->fetch result */ -static function prepare_ldap_fetch_to_be_saved($attrs) + static function prepare_ldap_fetch_to_be_saved($attrs) { foreach($attrs as $key => $value){ if(is_numeric($key) || ($key == "count") || ($key == "dn")){ @@ -467,7 +465,7 @@ static function prepare_ldap_fetch_to_be_saved($attrs) /* Save given attrs to specified dn*/ -static function save_FAI_object($dn,$attrs) + static function save_FAI_object($dn,$attrs) { global $config; $ldap = $config->get_ldap_link(); @@ -498,7 +496,7 @@ static function save_FAI_object($dn,$attrs) /* Return FAIstate freeze branch or "" for specified release department */ -static function get_release_tag($dn) + static function get_release_tag($dn) { global $config; $ldap = $config->get_ldap_link(); @@ -520,7 +518,7 @@ static function get_release_tag($dn) } -static function get_following_releases_that_inherit_this_object($dn) + static function get_following_releases_that_inherit_this_object($dn) { global $config; $ldap = $config->get_ldap_link(); @@ -556,7 +554,7 @@ static function get_following_releases_that_inherit_this_object($dn) /* Get previous version of the object dn */ -static function get_parent_release_object($dn,$include_myself=true) + static function get_parent_release_object($dn,$include_myself=true) { global $config; $ldap = $config->get_ldap_link(); @@ -593,7 +591,7 @@ static function get_parent_release_object($dn,$include_myself=true) /* return release names of all parent releases */ -static function get_previous_releases_of_this_release($dn,$flat) + static function get_previous_releases_of_this_release($dn,$flat) { global $config; $ldap = $config->get_ldap_link(); @@ -641,7 +639,7 @@ static function get_previous_releases_of_this_release($dn,$flat) /* This function returns all sub release names, recursivly */ -static function get_sub_releases_of_this_release($dn,$flat = false) + static function get_sub_releases_of_this_release($dn,$flat = false) { global $config; $res = array(); @@ -674,7 +672,7 @@ static function get_sub_releases_of_this_release($dn,$flat = false) /* Check if the given department is a release department */ -static function is_release_department($dn) + static function is_release_department($dn) { global $config; $ldap = $config->get_ldap_link(); @@ -699,7 +697,7 @@ static function is_release_department($dn) /* This function returns the dn of the object release */ -static function get_release_dn($Current_DN) + static function get_release_dn($Current_DN) { global $config; $ldap = $config->get_ldap_link();