index 07543b03c0166ee4a0ff6ff805d2d8096fe3d55f..cc71020a27a0d30fcf7e6a6ffbe9e4af4d1dad3c 100644 (file)
gosa_log ("FAI class '".$this->dn."' has been tagged as removed");
$this->dialog= NULL;
$to_del = clean_up_releases($this->dn);
+ save_release_changes_now();
foreach($to_del as $dn){
$ldap->rmdir_recursive($dn);
/* Duplicate applications
*/
- $ldap->cd ($appdst);
- $ldap->recursive_remove();
- $ldap->cd ($this->config->current['BASE']);
- $ldap->copy_FAI_resource_recursive($appsrc,$appdst,$NewReleaseName,$type,true);
-
+ $ldap->cat($appsrc,array("dn")) ;
+ if($ldap->count()){
+ $ldap->cd ($appdst);
+ $ldap->recursive_remove();
+ $ldap->cd ($this->config->current['BASE']);
+ $ldap->copy_FAI_resource_recursive($appsrc,$appdst,$NewReleaseName,$type,true);
+ }
+
/* Duplicate mime types
*/
- $ldap->cd ($appdst);
- $ldap->recursive_remove();
- $ldap->cd ($this->config->current['BASE']);
- $ldap->copy_FAI_resource_recursive($mimesrc,$mimedst,$NewReleaseName,$type,true);
-
+ $ldap->cat($mimesrc,array("dn")) ;
+ if($ldap->count()){
+ $ldap->cd ($appdst);
+ $ldap->recursive_remove();
+ $ldap->cd ($this->config->current['BASE']);
+ $ldap->copy_FAI_resource_recursive($mimesrc,$mimedst,$NewReleaseName,$type,true);
+ }
$attr = array();
$attr['objectClass'] = array("organizationalUnit","FAIbranch");
- $attr['ou'] = $name;
+ $attr['ou'] = $name;
+ $attr['FAIstate'] = $type;
$ldap->cd($this->config->current['BASE']);
$ldap->cd("ou=".$name.",".$baseToUse);
$ldap->cat("ou=".$name.",".$baseToUse);
$this->dialog = new $a_setup[0]($this->config,
$this->config->data['TABS'][$a_setup[2]],$this->dn);
- $this->is_dialog = true;
+ $this->is_dialog = false;
}
}
}else{
$this->dialog->save();
+ save_release_changes_now();
if (!isset($_POST['edit_apply'])){
del_lock ($this->dn);
unset($this->dialog);
if(($this->dialog != NULL) && (isset($this->dialog->config))){
$display .= $this->dialog->execute();
/* Don't show buttons if tab dialog requests this */
- if (((isset($this->dialog->current))&&($this->dialog->by_object[$this->dialog->current]->is_dialog))){
-
- }elseif(((isset($this->dialog->current))&&(!$this->dialog->by_object[$this->dialog->current]->is_dialog))){
- $display.= "<p style=\"text-align:right\">\n";
- $display.= "<input type=\"submit\" name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
- $display.= " \n";
- if ($this->dn != "new"){
- $display.= "<input type=submit name=\"edit_apply\" value=\""._("Apply")."\">\n";
+
+ if(isset($this->dialog->current)){
+
+ $obj = $this->dialog->by_object[$this->dialog->current];
+
+ if((isset($obj->is_dialog) && (!$obj->is_dialog)) || (isset($obj->dialog) && (!$obj->dialog))){
+
+ $display.= "<p style=\"text-align:right\">\n";
+ $display.= "<input type=\"submit\" name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
$display.= " \n";
+ if ($this->dn != "new"){
+ $display.= "<input type=submit name=\"edit_apply\" value=\""._("Apply")."\">\n";
+ $display.= " \n";
+ }
+ $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
+ $display.= "</p>";
+ }elseif(!isset($this->dialog->current)){
+ $display.= "<p style=\"text-align:right\">\n";
+ $display.= "<input type=\"submit\" name=\"edit_continue\" value=\""._("Continue")."\"> ";
+ $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
+ $display.= "</p>";
}
- $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
- $display.= "</p>";
- }elseif(!isset($this->dialog->current)){
- $display.= "<p style=\"text-align:right\">\n";
- $display.= "<input type=\"submit\" name=\"edit_continue\" value=\""._("Continue")."\"> ";
- $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
- $display.= "</p>";
- }
- return($display);
+ }else{
+ $display.= "<p style=\"text-align:right\">\n";
+ $display.= "<input type=\"submit\" name=\"edit_continue\" value=\""._("Continue")."\"> ";
+ $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
+ $display.= "</p>";
+
+ }
+ return($display);
}
$ret = array("main"=>"/");
$ldap = $this->config->get_ldap_link();
if(!$base){
- $base= "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
+ $base= $_SESSION['CurrentMainBase'];
}
- $ldap->ls("(objectClass=FAIbranch)",$base);
- while($attrs = $ldap->fetch()){
- if((isset($attrs['ou']))&&($attrs['dn']!=$base)){
- $ret[$attrs['dn']]= $prefix.$attrs['ou'][0];
- $ret = array_merge($ret,$this->getBranches($attrs['dn'],"".$prefix.$attrs['ou'][0]."/"));
- }
+ $tmp = get_all_releases_from_base($base,true);
+ foreach($tmp as $dn => $name){
+ $ret[$dn]=$name;
}
-
return ($ret);
}
}
}
+ $this->lock_type = get_release_tag(get_release_dn($base));
+
/* Get resolved release dependencies */
$tmp = get_all_objects_for_given_base($base,"(&(|(objectClass=FAIpartitionTable)(objectClass=FAIpackageList)(objectClass=FAIscript)
(objectClass=FAIvariable)(objectClass=FAIhook)(objectClass=FAIprofile)(objectClass=FAItemplate))(cn=$Regex))");
}
/* Clean up object informations */
+ $obj = array();
$obj['cn'] = $object['cn'][0];
$obj['dn'] = $object['dn'];
$obj['description'] = $object['description'][0];
/* Append type to this string, to be able to check if the selected
* entry is of type 'freeze' or 'branch'
*/
- if(isset($object['FAIstate'])){
- $obj['FAIstate'] = $object['FAIstate'][0];
- $str.="|".$obj['FAIstate'];
+ if(!isset($object['FAIstate'])){
+ $obj['FAIstate'] = $this->lock_type;
}else{
- $obj['FAIstate'] ="";
+ $obj['FAIstate'] = $object['FAIstate'][0];
}
+
$this->objects[strtolower($obj['cn']).$obj['cn'].$type] = $obj;
$this->objects[strtolower($obj['cn']).$obj['cn'].$type]['type']=$type;
}
}
}
- /* Tell class what we have currently opened
- 'main' has type '' */
- if(preg_match("/freeze/",$str)){
- $this->lock_type = "freeze";
- }elseif(preg_match("/branch/",$str)){
- $this->lock_type = "branch";
- }else{
- $this->lock_type = "";
- }
-
ksort($this->objects);
reset ($this->objects);
function CheckNewBranchName($name,$base)
{
$f = $this->DivListFai->selectedBranch;
- if(empty($name)){
+ if($name == ""){
return(false);
}elseif(in_array($name,$this->getBranches($f))) {
return(false);
- }elseif(empty($name)){
- return(false);
}elseif(is_department_name_reserved($name,$base)){
return(false);
}
$this->DivListFai->save_object();
}
+
+ /* Return plugin informations for acl handling */
+ function plInfo()
+ {
+ return (array(
+ "plShortName" => _("Management"),
+ "plDescription" => _("FAI management"),
+ "plSelfModify" => FALSE,
+ "plDepends" => array(),
+ "plPriority" => 0,
+ "plSection" => array("administration"),
+ "plCategory" => array("fai"=> array("description" => _("FAI"),
+ "objectClass" => "FAIclass")),
+ "plProvidedAcls"=> array()));
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>