s3-netdomjoin-gui: allow to switch between workgroups/domains with the same name.
[ira/wip.git] / source3 / lib / netapi / examples / netdomjoin-gui / netdomjoin-gui.c
index 0a06a7789cb88f4d4caeb6fea849539e7de84233..c482113332744725ad5f6e6530c69d792130422b 100644 (file)
@@ -950,7 +950,8 @@ static void callback_enter_workgroup_and_unlock(GtkWidget *widget,
                gtk_widget_set_sensitive(GTK_WIDGET(state->button_ok), FALSE);
                return;
        }
                gtk_widget_set_sensitive(GTK_WIDGET(state->button_ok), FALSE);
                return;
        }
-       if (strcasecmp(state->name_buffer_initial, entry_text) == 0) {
+       if ((strcasecmp(state->name_buffer_initial, entry_text) == 0) &&
+           (state->name_type_initial == NetSetupWorkgroupName)) {
                gtk_widget_set_sensitive(GTK_WIDGET(state->button_ok), FALSE);
                return;
        }
                gtk_widget_set_sensitive(GTK_WIDGET(state->button_ok), FALSE);
                return;
        }
@@ -972,7 +973,8 @@ static void callback_enter_domain_and_unlock(GtkWidget *widget,
                gtk_widget_set_sensitive(GTK_WIDGET(state->button_ok), FALSE);
                return;
        }
                gtk_widget_set_sensitive(GTK_WIDGET(state->button_ok), FALSE);
                return;
        }
-       if (strcasecmp(state->name_buffer_initial, entry_text) == 0) {
+       if ((strcasecmp(state->name_buffer_initial, entry_text) == 0) &&
+           (state->name_type_initial == NetSetupDomainName)) {
                gtk_widget_set_sensitive(GTK_WIDGET(state->button_ok), FALSE);
                return;
        }
                gtk_widget_set_sensitive(GTK_WIDGET(state->button_ok), FALSE);
                return;
        }