Code

Added copy & paste for profiles
[gosa.git] / setup / class_setupStep_Migrate.inc
index 6e4d85f7ea6cc4c9f863bfd78c6efa872d269169..5dcd8e649d9ccba0c9fdf273b1e8a08f0dc6d26c 100644 (file)
@@ -350,7 +350,7 @@ class Step_Migrate extends setup_step
     $valid_deps['/'] = $cv['base'];
     $ldap->search("(&(objectClass=gosaDepartment)(ou=*))",array("dn","ou"));
     while($attrs = $ldap->fetch()){
-      $valid_deps[$attrs['ou'][0]] = $attrs['dn'];
+      $valid_deps[] = $attrs['dn'];
     }
 
     /***********
@@ -417,7 +417,7 @@ class Step_Migrate extends setup_step
     $valid_deps['/'] = $cv['base'];
     $ldap->search("(&(objectClass=gosaDepartment)(ou=*))",array("dn","ou"));
     while($attrs = $ldap->fetch()){
-      $valid_deps[$attrs['ou'][0]] = $attrs['dn'];
+      $valid_deps[] = $attrs['dn'];
     }
 
     /***********
@@ -675,7 +675,7 @@ class Step_Migrate extends setup_step
     /* Skip GOsa internal departments */
     $skip_dns = array("/".$cv['peopleou']."/","/".$cv['groupou']."/","/^ou=people,/","/^ou=groups,/",
         "/(,|)ou=configs,/","/(,|)ou=systems,/",
-        "/(,|)ou=apps,/","/(,|)ou=mime,/","/^ou=aclroles,/","/^ou=incoming,/",
+        "/(,|)ou=apps,/","/(,|)ou=mime,/","/(,|)ou=devices/","/^ou=aclroles,/","/^ou=incoming,/",
         "/ou=snapshots,/","/(,|)dc=addressbook,/","/^(,|)ou=machineaccounts,/",
         "/(,|)ou=winstations,/");
 
@@ -699,7 +699,7 @@ class Step_Migrate extends setup_step
      */
     foreach($this->deps_to_migrate as $key => $attrs){
       $dn = $attrs['dn'];
-      $skip = false;
+      $skip = false;;
       foreach($skip_dns as $skip_dn){
         if(preg_match($skip_dn,$dn)){
           $skip = true;
@@ -934,9 +934,9 @@ class Step_Migrate extends setup_step
     }
 
     if($only_ldif){
-      $this->acl_create_changes ="\n".$cv['base']."\n";
+      $this->acl_create_changes ="\n".($ldap->fix($cv['base']))."\n";
       $this->acl_create_changes.=$this->array_to_ldif($attrs)."\n";
-      $this->acl_create_changes.="\n".$cv['base']."\n";
+      $this->acl_create_changes.="\n".($ldap->fix($cv['base']))."\n";
       $this->acl_create_changes.=$this->array_to_ldif($attrs_new);
     }else{
    
@@ -1063,7 +1063,7 @@ class Step_Migrate extends setup_step
         $dn = base64_decode($b_dn);
         $d_dn = preg_replace("/,.*$/",",".base64_decode($destination_dep),$dn);
         if(!$perform){
-          $this->outside_winstations[$b_dn]['ldif'] = _("Winstation will be moved from").":<br>\t".$dn."<br>"._("to").":<br>\t".$d_dn;
+          $this->outside_winstations[$b_dn]['ldif'] = _("Winstation will be moved from").":<br>\t".($ldap->fix($dn))."<br>"._("to").":<br>\t".($ldap->fix($d_dn));
 
 
           /* Check if there are references to this object */
@@ -1111,8 +1111,8 @@ class Step_Migrate extends setup_step
         $dn = base64_decode($b_dn);
         $d_dn = preg_replace("/,.*$/",",".base64_decode($destination_dep),$dn);
         if(!$perform){
-          $this->outside_groups[$b_dn]['ldif'] = _("Group will be moved from").":<br>\t".$dn."<br>"._("to").":<br>\t".$d_dn;
 
+          $this->outside_groups[$b_dn]['ldif'] = _("Group will be moved from").":<br>\t".($ldap->fix($dn))."<br>"._("to").":<br>\t".($ldap->fix($d_dn));
 
           /* Check if there are references to this object */
           $ldap->search("(&(member=".$dn.")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
@@ -1159,7 +1159,7 @@ class Step_Migrate extends setup_step
         $dn = base64_decode($b_dn);
         $d_dn = preg_replace("/,.*$/",",".base64_decode($destination_dep),$dn);
         if(!$perform){
-          $this->outside_users[$b_dn]['ldif'] = _("User will be moved from").":<br>\t".$dn."<br>"._("to").":<br>\t".$d_dn;
+          $this->outside_users[$b_dn]['ldif'] = _("User will be moved from").":<br>\t".($ldap->fix($dn))."<br>"._("to").":<br>\t".($ldap->fix($d_dn));
 
           /* Check if there are references to this object */
           $ldap->search("(&(member=".$dn.")(|(objectClass=gosaGroupOfNames)(objectClass=groupOfNames)))",array('dn'));
@@ -1216,10 +1216,17 @@ class Step_Migrate extends setup_step
     }
     
     if($this->outside_winstations_dialog){
+
+      /* Fix displayed dn syntax */ 
+      $tmp = $this->outside_winstations;
+      foreach($tmp as $key => $data){
+        $tmp[$key]['dn'] = @LDAP::fix($data['dn']);
+      }
+
       $smarty = get_smarty();
       $smarty->assign("ous",$this->get_all_winstation_ous());
       $smarty->assign("method","outside_winstations");
-      $smarty->assign("outside_winstations",$this->outside_winstations);
+      $smarty->assign("outside_winstations",$tmp);
       return($smarty->fetch(get_template_path("setup_migrate.tpl",TRUE,dirname(__FILE__))));
     }
     /*************
@@ -1255,10 +1262,17 @@ class Step_Migrate extends setup_step
     }
     
     if($this->outside_groups_dialog){
+
+      /* Fix displayed dn syntax */ 
+      $tmp = $this->outside_groups;
+      foreach($tmp as $key => $data){
+        $tmp[$key]['dn'] = @LDAP::fix($data['dn']);
+      }
+
       $smarty = get_smarty();
       $smarty->assign("ous",$this->get_all_group_ous());
       $smarty->assign("method","outside_groups");
-      $smarty->assign("outside_groups",$this->outside_groups);
+      $smarty->assign("outside_groups",$tmp);
       $smarty->assign("group_details", $this->show_details);
       return($smarty->fetch(get_template_path("setup_migrate.tpl",TRUE,dirname(__FILE__))));
     }
@@ -1296,10 +1310,17 @@ class Step_Migrate extends setup_step
     }
     
     if($this->outside_users_dialog){
+
+      /* Fix displayed dn syntax */ 
+      $tmp = $this->outside_users;
+      foreach($tmp as $key => $data){
+        $tmp[$key]['dn'] = @LDAP::fix($data['dn']);
+      }
+
       $smarty = get_smarty();
       $smarty->assign("ous",$this->get_all_people_ous());
       $smarty->assign("method","outside_users");
-      $smarty->assign("outside_users",$this->outside_users);
+      $smarty->assign("outside_users",$tmp);
       $smarty->assign("user_details", $this->show_details);
       return($smarty->fetch(get_template_path("setup_migrate.tpl",TRUE,dirname(__FILE__))));
     }
@@ -1413,8 +1434,15 @@ class Step_Migrate extends setup_step
 
     /* Display migration dialog */
     if($this->users_migration_dialog){
+
+      /* Fix displayed dn syntax */ 
+      $tmp = $this->users_to_migrate;
+      foreach($tmp as $key => $data){
+        $tmp[$key]['dn'] = @LDAP::fix($data['dn']);
+      }
+
       $smarty = get_smarty();
-      $smarty->assign("users_to_migrate",$this->users_to_migrate);
+      $smarty->assign("users_to_migrate",$tmp);
       $smarty->assign("method","migrate_users");
       $smarty->assign("user_details", $this->show_details);
       return($smarty->fetch(get_template_path("setup_migrate.tpl",TRUE,dirname(__FILE__))));
@@ -1462,7 +1490,14 @@ class Step_Migrate extends setup_step
     /* Display migration dialog */
     if($this->dep_migration_dialog){
       $smarty = get_smarty();
-      $smarty->assign("deps_to_migrate",$this->deps_to_migrate);
+   
+      /* Fix displayed dn syntax */ 
+      $tmp = $this->deps_to_migrate;
+      foreach($tmp as $key => $data){
+        $tmp[$key]['dn'] = @LDAP::fix($data['dn']);
+      }
+
+      $smarty->assign("deps_to_migrate",$tmp);
       $smarty->assign("method","migrate_deps");
       $smarty->assign("deps_details", $this->show_details);
       return($smarty->fetch(get_template_path("setup_migrate.tpl",TRUE,dirname(__FILE__))));