index 7e4f4e50cdae96191642a8b48a40da75acd1aa0f..ed479f75f706b06018ba398114b1d8eaabcbe0ac 100644 (file)
/* 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");
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);
}
$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);
}
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);
}