diff --git a/gosa-core/setup/class_setupStep_Migrate.inc b/gosa-core/setup/class_setupStep_Migrate.inc
index 46f5ca525884125223379d8851c8e3e73fb276a7..9f20ab6a24425da072d9f29020a91d6ded8081e6 100644 (file)
/* 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";
}
{
$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'];
$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;
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']);
}
if(isset($_POST['migrate_menus'])){
- $this->migrate_usb_menus();
+ $this->migrate_menus();
# $this->dialog = FALSE;
# $this->show_details = FALSE;
# $this->menu_dialog = FALSE;
/* 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";
}
}
$this->checks['old_style_devices']['STATUS'] = FALSE;
- $this->checks['old_style_devices']['STATUS_MSG']= _("Failed");
+ $this->checks['old_style_devices']['STATUS_MSG']= "<font style='color:#F0A500'>"._("Warning")."</font>";
$this->checks['old_style_devices']['ERROR_MSG'] =
sprintf(_("There are %s devices that need to be migrated."),count($this->device)).
"<input type='submit' name='device_dialog' value='"._("Migrate")."'>";
*/
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{
$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{
}
}
}
+ $this->check_usb_devices();
}
*/
if(count($this->service)){
$this->checks['old_style_services']['STATUS'] = FALSE;
- $this->checks['old_style_services']['STATUS_MSG']= _("Failed");
+ $this->checks['old_style_services']['STATUS_MSG']= "<font style='color:#F0A500'>"._("Warning")."</font>";
$this->checks['old_style_services']['ERROR_MSG'] =
sprintf(_("There are %s services that need to be migrated."),
count($this->service)).
*/
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{
which configured parameter belongs to which application entry.
*/
$amap= array();
+ $todo = array();
$ldap->cd($cv['base']);
$ldap->search("(objectClass=gosaApplication)", array("cn", "gosaApplicationParameter"));
while($info = $ldap->fetch()){
/* 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
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;
All selected menus will be converted (DETAILS = TRUE).
The ldap actions collected by check_menus() will be executed.
*/
- function migrate_usb_menus()
+ function migrate_menus()
{
/* Establish ldap connection
$success = TRUE;
foreach($menu['TODO']['ADD'] as $dn => $data){
$ldap->cd($cv['base']);
- $base = preg_replace("/^[^,]+,/","",$dn);
if(!$ldap->dn_exists($dn)){
$ldap->cd($dn);
$ldap->add($data);
*/
foreach($menu['TODO']['MODIFY'] as $dn => $data){
$ldap->cd($cv['base']);
- if(!$ldap->dn_exists($dn)){
+ if($ldap->dn_exists($dn)){
$ldap->cd($dn);
$ldap->modify($data);
if (!$ldap->success()){