s3-netdomjoin-gui: allow to switch between workgroups/domains with the same name.
authorGünther Deschner <gd@samba.org>
Fri, 15 May 2009 17:43:19 +0000 (19:43 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 15 May 2009 17:51:03 +0000 (19:51 +0200)
Guenther

source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c

index 0a06a77..c482113 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;
        }
-       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;
        }
@@ -972,7 +973,8 @@ static void callback_enter_domain_and_unlock(GtkWidget *widget,
                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;
        }