Code

Migration-> Admin -> Added error message if requested admin user already exists
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 May 2007 09:41:03 +0000 (09:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 10 May 2007 09:41:03 +0000 (09:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6340 594d385d-05f5-0310-b6e9-bd551577e9d8

setup/class_setupStep_Migrate.inc

index 6d94881da11e3cbecb68e3af570cb53d28e0d878..b166c1a3767d54843a2e81ede57e5220c5301b25 100644 (file)
@@ -955,8 +955,15 @@ class Step_Migrate extends setup_step
     $new_user['cn']  = "System Administrator";
     $new_user['uid'] = $uid;
     $new_user['userPassword'] = $hash;
-    
+   
     $ldap->cd($cv['base']);
+  
+    $ldap->cat($dn,array("dn"));
+    if($ldap->count()){
+      print_red(sprintf(_("Could not add administrative user, there is already an object with the same dn '%s' in your ldap database."),$dn));
+      return(FALSE);  
+    }
+
     $ldap->create_missing_trees(preg_replace("/^[^,]+,/","",$dn));
     $ldap->cd($dn);  
     $res = $ldap->add($new_user);