From: hickert Date: Thu, 10 May 2007 09:41:03 +0000 (+0000) Subject: Migration-> Admin -> Added error message if requested admin user already exists X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e043aed8c7c9dc3ca239a21c35847440903302de;p=gosa.git Migration-> Admin -> Added error message if requested admin user already exists git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6340 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/setup/class_setupStep_Migrate.inc b/setup/class_setupStep_Migrate.inc index 6d94881da..b166c1a37 100644 --- a/setup/class_setupStep_Migrate.inc +++ b/setup/class_setupStep_Migrate.inc @@ -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);