Code

Added scalix and nagios accounts.
[gosa.git] / gosa-core / setup / class_setupStep_Migrate.inc
index 344cdaf2c705e4317688a5f17ad65a16b186f175..9f20ab6a24425da072d9f29020a91d6ded8081e6 100644 (file)
@@ -323,7 +323,7 @@ class Step_Migrate extends setup_step
 
     /* Get winstation ou */
     if($cv['generic_settings']['wws_ou_active']) {
-      $winstation_ou = $cv['generic_settings']['ws_ou'];
+      $winstation_ou = $cv['generic_settings']['wws_ou'];
     }else{
       $winstation_ou = "ou=winstations";
     }
@@ -1019,6 +1019,16 @@ class Step_Migrate extends setup_step
   {
     $pw1 = $pw2 = "";
     $uid = "";
+
+    /* On first call check for rid/sid base */
+    $cv = $this->parent->captured_values;
+    $ldap_l = new LDAP($cv['admin'],
+        $cv['password'],
+        $cv['connection'],
+        FALSE,
+        $cv['tls']);
+
+    $ldap = new ldapMultiplexer($ldap_l);
   
     if(isset($_POST['new_user_uid'])){
       $uid = $_POST['new_user_uid'];
@@ -1030,6 +1040,14 @@ class Step_Migrate extends setup_step
       $pw2 = $_POST['new_user_password2'];
     }
   
+    
+    $ldap->cd($cv['base']);
+    $ldap->search("(uid=".$uid.")");
+    if($ldap->count()){
+      msg_dialog::display(_("Input error"),msgPool::duplicated(_("Uid")), ERROR_DIALOG);
+      return false;
+    }
+    
     if(empty($pw1) || empty($pw2) | ($pw1 != $pw2)){
       msg_dialog::display(_("Password error"), _("Provided passwords do not match!"), ERROR_DIALOG);
       return false;
@@ -1039,17 +1057,8 @@ class Step_Migrate extends setup_step
       msg_dialog::display(_("Input error"), _("Specify a valid user ID!"), ERROR_DIALOG);
       return false;
     }
-    
-    /* On first call check for rid/sid base */
-    $cv = $this->parent->captured_values;
-    $ldap_l = new LDAP($cv['admin'],
-        $cv['password'],
-        $cv['connection'],
-        FALSE,
-        $cv['tls']);
-
-    $ldap = new ldapMultiplexer($ldap_l);
-
     /* Get current base attributes */
     $ldap->cd($cv['base']);
   
@@ -1960,7 +1969,7 @@ class Step_Migrate extends setup_step
 
     /* Get winstation ou */
     if($cv['generic_settings']['wws_ou_active']) {
-      $winstation_ou = $cv['generic_settings']['ws_ou'];
+      $winstation_ou = $cv['generic_settings']['wws_ou'];
     }else{
       $winstation_ou = "ou=winstations";
     }
@@ -2309,7 +2318,7 @@ class Step_Migrate extends setup_step
            */
           if(!$ldap->success()){
             msg_dialog::display(_("LDAP error"), 
-                sprintf(_("Ldap add failed for %s with error %s"),
+                sprintf(_("Adding '%s' to the LDAP failed: %s"),
                   "<b>".LDAP::fix($newdn)."</b>", 
                   "<br><br><i>".$ldap->get_error()."</i>"), ERROR_DIALOG);
           }else{
@@ -2329,7 +2338,7 @@ class Step_Migrate extends setup_step
             $ldap->cat($device['DN'],array("gotoHotplugDevice"));
             if(!$ldap->success()){
               msg_dialog::display(_("LDAP error"), 
-                  sprintf(_("Ldap update failed for %s with error %s"),
+                  sprintf(_("Updating '%s' failed: %s"),
                     "<b>".LDAP::fix($device['DN'])."</b>", 
                     "<br><br><i>".$ldap->get_error()."</b>"), ERROR_DIALOG);
             }else{
@@ -2339,6 +2348,7 @@ class Step_Migrate extends setup_step
         }
       }
     }
+    $this->check_usb_devices();
   }
 
 
@@ -2445,7 +2455,7 @@ class Step_Migrate extends setup_step
            */
           if(!$ldap->success()){
             msg_dialog::display(_("LDAP error"), 
-                sprintf(_("Ldap update failed for %s with error %s"),
+                sprintf(_("Updating '%s' failed: %s"),
                   "<b>".LDAP::fix($service['DN'])."</b>", 
                   "<br><br><i>".$ldap->get_error()."</b>"), ERROR_DIALOG);
           }else{
@@ -2542,8 +2552,8 @@ class Step_Migrate extends setup_step
 
     /* Create readable prefix for "What will be done" infos 
      */
-    $s_add = "<i>"._("add")."</i>\t";
-    $s_del = "<i>"._("remove")."</i>\t";
+    $s_add = "<i>"._("Add")."</i>\t";
+    $s_del = "<i>"._("Remove")."</i>\t";
 
     /* Walk through all found old-style menu configurations.
         -Prepare ldap update list     $data   
@@ -2732,7 +2742,7 @@ class Step_Migrate extends setup_step
     if(count($this->menu)){
       $this->checks['old_style_menus']['STATUS']    = FALSE;
       $this->checks['old_style_menus']['STATUS_MSG']= "<font style='color:#F0A500'>"._("Warning")."</font>";
-      $this->checks['old_style_menus']['ERROR_MSG'] = sprintf(_("There are %s application menus which have to be converted."),
+      $this->checks['old_style_menus']['ERROR_MSG'] = sprintf(_("There are %s application menus which have to be migrated."),
                                                       count($this->menu))."<input type='submit' name='menu_dialog' value='"._("Migrate")."'>";
     }else{
       $this->checks['old_style_menus']['STATUS']    = TRUE;