index 7e72481f99b84beb4fe34b651cc44e2977d07add..260957797c1585d60ff65c8ac092655dd7c3806f 100644 (file)
$this->is_dialog =true;
}
+ /* Configuration dialog open*/
+ if((isset($_POST['Markpkg']))&&(isset($_POST['usedPackages']))&&(!empty($_POST['usedPackages']))){
+ foreach($_POST['usedPackages'] as $pkg){
+ if (isset($this->usedPackages[$pkg])){
+ unset($this->usedPackages[$pkg]);
+ if (preg_match('/^-/', $pkg)){
+ $pkg= preg_replace('/^-/', '', $pkg);
+ } else {
+ $pkg= preg_replace('/^/', '-', $pkg);
+ }
+ $this->usedPackages[$pkg]= $pkg;
+ }
+ }
+ print_a($this->usedPackages);
+ }
+
/* Save Configuration */
if(isset($_POST['SaveObjectConfig'])){
if($this->FAIstate != "freeze"){
$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");
}
$c_str = " - "._("package is configured");
}
+ /* Adapt used name if we're marked for removal */
+ $dsc= "";
+ if (preg_match('/^-/', $usedName)){
+ $dsc= " - "._("Package marked for removal");
+ $usedName= preg_replace('/^-/', '! ', $usedName);
+ }
+
if(isset($this->list[$usedName][1])){
- $a_ret[$usedName] = $usedName." [".$this->list[$usedName][1]."]".$c_str;
+ $a_ret[$usedName] = $usedName." [".$this->list[$usedName][1]."]".$c_str.$dsc;
}else{
- $a_ret[$usedName] = $usedName.$c_str;
+ $a_ret[$usedName] = $usedName.$c_str.$dsc;
}
}
}
// $this->attrs["FAIinstallMethod"]= "aptitude";
- $ldap->cat($this->dn);
+ $ldap->cat($this->dn, array('dn'));
if($ldap->count()!=0){
/* Write FAIscript to ldap*/
$ldap->cd($this->dn);
$ldap->cd($this->dn);
$ldap->add($this->attrs);
}
- show_ldap_error($ldap->get_error());
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/package list with dn '%s' failed."),$this->dn));
+
+ /* Do object tagging */
+ $this->handle_object_tagging();
+ $ldap->cd($this->dn);
/* Save Package configurations */
foreach($this->ConfiguredPackages as $pkgname => $attrs){
foreach($attrs as $name => $attr){
+
+ $pkgattrs = array();
foreach($attr as $n=>$v){
if(empty($v)) $v = array();
}
/* Set attributes */
- $pkgattrs['objectClass'] = "FAIdebconfInfo";
+ $pkgattrs['objectClass'][] = "FAIdebconfInfo";
+
$pkgattrs['FAIpackage'] = $pkgname;
$pkgattrs['FAIvariable'] = $name;
$pkgattrs['FAIvariableType'] = $attr['Type'];
$pkgdn = "FAIvariable=".$name.",".$this->dn;
/* cehck if object already exists */
- $ldap->cat($pkgdn);
+ $ldap->cat($pkgdn,array("objectClass"));
+
+ /* Workaround for missing "gosaAdministrativeUnitTag" */
+ $attrs = $ldap->fetch();
+ if((isset($attrs['objectClass'])) && (in_array_ics("gosaAdministrativeUnitTag",$attrs['objectClass']))){
+ $pkgattrs['objectClass'][] = "gosaAdministrativeUnitTag";
+ }
+
if($ldap->count()!=0){
$ldap->cd($pkgdn);
$this->cleanup();
$ldap->cd($pkgdn);
$ldap->add($pkgattrs);
}
- show_ldap_error($ldap->get_error());
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/package list with dn '%s' failed."),$this->dn));
+
+ /* Handle tagging */
+ $this->handle_object_tagging($pkgdn, $this->gosaUnitTag);
}
}
-
-
-
-
}
}