summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4cad962)
raw | patch | inline | side by side (parent: 4cad962)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 7 Jul 2006 06:03:42 +0000 (06:03 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 7 Jul 2006 06:03:42 +0000 (06:03 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4042 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/fai/class_faiPackage.inc | patch | blob | history |
index 260957797c1585d60ff65c8ac092655dd7c3806f..3c50c6929c87ad25781b8dd42aaf2a316e319084 100644 (file)
/* Search for configuration objects */
$ldap = $this->config->get_ldap_link();
- $ldap->search($PackageFilter,array("FAIvariable","FAIvariableType","FAIvariableContent","FAIpackage","FAIdebianSection"));
+ $ldap->search($PackageFilter,array("FAIvariable","FAIvariableType","FAIvariableContent","FAIpackage","FAIdebianSection","FAIstate"));
/* Walk through configurations and append them to our list of ConfiguredPackages */
while($attr = $ldap->fetch()){
+
+ /* Skip objects, that are tagged as removed */
+ if(isset($object['FAIstate'][0])){
+ if(preg_match("/removed$/",$attr['FAIstate'][0])){
+ continue;
+ }
+ }
+
$tmp =array();
$tmp['Name'] = $attr['FAIvariable'][0];
$tmp['Type'] = $attr['FAIvariableType'][0];
$smarty->assign("section" ,$strsec);
$smarty->assign("usedPackages",$this->printUsedPackages());
$display.= $smarty->fetch(get_template_path('faiPackage.tpl', TRUE));
+ print_a($this->ConfiguredPackages);
return($display);
}
{
$ldap = $this->config->get_ldap_link();
$ldap->cd ($this->dn);
- $ldap->rmdir_recursive($this->dn);
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of FAI/package list with dn '%s' failed."),$this->dn));
- $this->handle_post_events("remove");
+
+ $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $this->dn);
+ if($_SESSION['faifilter']['branch'] == "main"){
+ $use_dn = $this->dn;
+ }
+
+ prepare_to_save_FAI_object($use_dn,array(),true);
+
+ foreach($this->ConfiguredPackages as $pkgname => $attrs){
+ foreach($attrs as $name => $attr){
+ $pkgdn = "FAIvariable=".$name.",".$this->dn;
+ $use_dn = str_ireplace( get_release_dn($this->dn), $_SESSION['faifilter']['branch'], $pkgdn);
+ if($_SESSION['faifilter']['branch'] == "main"){
+ $use_dn = $obj['dn'];
+ }
+ prepare_to_save_FAI_object($use_dn,array(),true);
+ }
+ }
+ $this->handle_post_events("remove");
}
$this->attrs['FAIdebianSection'][] = $sec;
}
- // $this->attrs["FAIinstallMethod"]= "aptitude";
-
- $ldap->cat($this->dn, array('dn'));
- if($ldap->count()!=0){
- /* Write FAIscript to ldap*/
- $ldap->cd($this->dn);
- $this->cleanup();
- $ldap->modify ($this->attrs);
-
- }else{
- /* Write FAIscript to ldap*/
- $ldap->cd($this->config->current['BASE']);
- $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
- $ldap->cd($this->dn);
- $ldap->add($this->attrs);
- }
+ 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));
/* Do object tagging */
if((isset($attrs['objectClass'])) && (in_array_ics("gosaAdministrativeUnitTag",$attrs['objectClass']))){
$pkgattrs['objectClass'][] = "gosaAdministrativeUnitTag";
}
-
- if($ldap->count()!=0){
- $ldap->cd($pkgdn);
- $this->cleanup();
- $ldap->modify ($pkgattrs);
- }else{
- $ldap->cd($this->config->current['BASE']);
- $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $pkgdn));
- $ldap->cd($pkgdn);
- $ldap->add($pkgattrs);
- }
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/package list with dn '%s' failed."),$this->dn));
+ prepare_to_save_FAI_object($pkgdn,$pkgattrs);
/* Handle tagging */
$this->handle_object_tagging($pkgdn, $this->gosaUnitTag);